mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[FIX+IMP+MIG] contract: Several refinements:
* Remove incorrect oldname attributes. * Add filter on partners for running contracts (+ a support o2m field for that). * Cover more tables in model renaming + cleaner code using a loop. * Don't copy contract lines, but rename table + copy contract records on pre. * Contract code is now populated to "Reference/Description" field in invoice. * Order on new contract model has been restored to the same as old analytic accounts.
This commit is contained in:
committed by
Christopher Rogos
parent
6e9ebe9a3f
commit
e432959974
@@ -14,6 +14,7 @@ from odoo.tools.translate import _
|
||||
class ContractContract(models.Model):
|
||||
_name = 'contract.contract'
|
||||
_description = "Contract"
|
||||
_order = 'code, name asc'
|
||||
_inherit = [
|
||||
'mail.thread',
|
||||
'mail.activity.mixin',
|
||||
@@ -44,7 +45,6 @@ class ContractContract(models.Model):
|
||||
comodel_name='contract.line',
|
||||
inverse_name='contract_id',
|
||||
copy=True,
|
||||
oldnae='contract_line_ids',
|
||||
)
|
||||
|
||||
user_id = fields.Many2one(
|
||||
@@ -273,7 +273,7 @@ class ContractContract(models.Model):
|
||||
if self.contract_type == 'purchase':
|
||||
invoice_type = 'in_invoice'
|
||||
return {
|
||||
'reference': self.code,
|
||||
'name': self.code,
|
||||
'type': invoice_type,
|
||||
'partner_id': self.invoice_partner_id.id,
|
||||
'currency_id': currency.id,
|
||||
|
||||
Reference in New Issue
Block a user