mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] - Make one migration from 12.0.1 to 12.0.4
[RMV] - Remove empty file [IMP] - Update no_update cron after migration [IMP] - move contract template recurrence info to line level [FIX] - Fix contract line model description [IMP] - Link contracts to analytic accounts [FIX] - Fix pylint [IMP] - Move chatter and attachments from analytic account to contract [IMP] - Move account_analytic_id to contract line level [IMP] - Improve version check in migration script [IMP] - Move contracts followers from analytic accounts [ADD] - Add mail.activity.mixin to contract.contract model remove data drop from migration scripts [12.0][FIX] - Fix _init_last_date_invoiced fix flake8 [ADD] - Update contributors list
This commit is contained in:
committed by
Francisco Ivan Anton Prieto
parent
c770e97adb
commit
f55b537d08
@@ -13,6 +13,7 @@ from .contract_line_constraints import get_allowed
|
||||
|
||||
class ContractLine(models.Model):
|
||||
_name = 'contract.line'
|
||||
_description = "Contract Line"
|
||||
_inherit = 'contract.abstract.contract.line'
|
||||
|
||||
sequence = fields.Integer(
|
||||
@@ -26,6 +27,10 @@ class ContractLine(models.Model):
|
||||
ondelete='cascade',
|
||||
oldname='analytic_account_id',
|
||||
)
|
||||
analytic_account_id = fields.Many2one(
|
||||
string="Analytic account",
|
||||
comodel_name='account.analytic.account',
|
||||
)
|
||||
date_start = fields.Date(
|
||||
string='Date Start',
|
||||
required=True,
|
||||
@@ -518,7 +523,7 @@ class ContractLine(models.Model):
|
||||
invoice_line_vals.update(
|
||||
{
|
||||
'name': name,
|
||||
'account_analytic_id': self.contract_id.analytic_account_id.id,
|
||||
'account_analytic_id': self.analytic_account_id.id,
|
||||
'price_unit': self.price_unit,
|
||||
}
|
||||
)
|
||||
@@ -597,6 +602,9 @@ class ContractLine(models.Model):
|
||||
def _init_last_date_invoiced(self):
|
||||
"""Used to init last_date_invoiced for migration purpose"""
|
||||
for rec in self:
|
||||
last_date_invoiced = rec.recurring_next_date - relativedelta(
|
||||
days=1
|
||||
)
|
||||
if rec.recurring_rule_type == 'monthlylastday':
|
||||
last_date_invoiced = (
|
||||
rec.recurring_next_date
|
||||
|
||||
Reference in New Issue
Block a user