mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[REF] Contract Sale Invoicing: split from analytic account
[REF] Contract Sale Invoicing: update translations [IMP] - Assert that the predecessor is available for new link at uncancel [RMV] - remove usless changes [RMV] - Remove usless field recurring_invoices after the total isolation between contract model and account analytic one. recurring_invoices which was used to mark analytic account as contract became usless [IMP] - P3 syntax [IMP] - use @openupgrade.migrate() and openupgrade.logged_query [IMP] - drop transient table in migration script
This commit is contained in:
committed by
Francisco Ivan Anton Prieto
parent
3ca769e079
commit
c770e97adb
@@ -455,7 +455,7 @@ class ContractLine(models.Model):
|
||||
|
||||
@api.constrains('recurring_next_date')
|
||||
def _check_recurring_next_date_recurring_invoices(self):
|
||||
for rec in self.filtered('contract_id.recurring_invoices'):
|
||||
for rec in self:
|
||||
if not rec.recurring_next_date and (
|
||||
not rec.date_end
|
||||
or not rec.last_date_invoiced
|
||||
@@ -916,9 +916,9 @@ class ContractLine(models.Model):
|
||||
contract.message_post(body=msg)
|
||||
for rec in self:
|
||||
if rec.predecessor_contract_line_id:
|
||||
rec.predecessor_contract_line_id.successor_contract_line_id = (
|
||||
rec
|
||||
)
|
||||
predecessor_contract_line = rec.predecessor_contract_line_id
|
||||
assert not predecessor_contract_line.successor_contract_line_id
|
||||
predecessor_contract_line.successor_contract_line_id = rec
|
||||
rec.is_canceled = False
|
||||
rec.recurring_next_date = recurring_next_date
|
||||
return True
|
||||
@@ -1052,7 +1052,6 @@ class ContractLine(models.Model):
|
||||
return [
|
||||
('is_auto_renew', '=', True),
|
||||
('is_canceled', '=', False),
|
||||
('contract_id.recurring_invoices', '=', True),
|
||||
('termination_notice_date', '<=', fields.Date.context_today(self)),
|
||||
]
|
||||
|
||||
@@ -1080,7 +1079,7 @@ class ContractLine(models.Model):
|
||||
view_id = self.env.ref(
|
||||
'contract.contract_line_customer_form_view'
|
||||
).id
|
||||
return super(ContractLine, self).fields_view_get(
|
||||
return super().fields_view_get(
|
||||
view_id, view_type, toolbar, submenu
|
||||
)
|
||||
|
||||
@@ -1091,7 +1090,7 @@ class ContractLine(models.Model):
|
||||
raise ValidationError(
|
||||
_("Contract line must be canceled before delete")
|
||||
)
|
||||
return super(ContractLine, self).unlink()
|
||||
return super().unlink()
|
||||
|
||||
@api.multi
|
||||
def _get_quantity_to_invoice(
|
||||
|
||||
Reference in New Issue
Block a user