mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[FIX+IMP] contract: recurring_next_date is required if date_end is null + rename recurring_interval to Invoice Every
This commit is contained in:
committed by
Christopher Rogos
parent
21b8519882
commit
b837118c79
@@ -75,8 +75,8 @@ class AccountAbstractAnalyticContractLine(models.AbstractModel):
|
|||||||
)
|
)
|
||||||
recurring_interval = fields.Integer(
|
recurring_interval = fields.Integer(
|
||||||
default=1,
|
default=1,
|
||||||
string='Repeat Every',
|
string='Invoice Every',
|
||||||
help="Repeat every (Days/Week/Month/Year)",
|
help="Invoice every (Days/Week/Month/Year)",
|
||||||
required=True,
|
required=True,
|
||||||
)
|
)
|
||||||
date_start = fields.Date(string='Date Start')
|
date_start = fields.Date(string='Date Start')
|
||||||
|
|||||||
@@ -436,7 +436,8 @@ class AccountAnalyticInvoiceLine(models.Model):
|
|||||||
def _check_recurring_next_date_recurring_invoices(self):
|
def _check_recurring_next_date_recurring_invoices(self):
|
||||||
for rec in self.filtered('contract_id.recurring_invoices'):
|
for rec in self.filtered('contract_id.recurring_invoices'):
|
||||||
if not rec.recurring_next_date and (
|
if not rec.recurring_next_date and (
|
||||||
not rec.last_date_invoiced
|
not rec.date_end
|
||||||
|
or not rec.last_date_invoiced
|
||||||
or rec.last_date_invoiced < rec.date_end
|
or rec.last_date_invoiced < rec.date_end
|
||||||
):
|
):
|
||||||
raise ValidationError(
|
raise ValidationError(
|
||||||
|
|||||||
Reference in New Issue
Block a user