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
sbejaoui
parent
24f57be03d
commit
a429b10c20
@@ -45,9 +45,7 @@ class ContractContract(models.Model):
|
||||
copy=True,
|
||||
oldnae='contract_line_ids',
|
||||
)
|
||||
recurring_invoices = fields.Boolean(
|
||||
string='Generate recurring invoices automatically'
|
||||
)
|
||||
|
||||
user_id = fields.Many2one(
|
||||
comodel_name='res.users',
|
||||
string='Responsible',
|
||||
@@ -80,7 +78,9 @@ class ContractContract(models.Model):
|
||||
ondelete='restrict',
|
||||
)
|
||||
partner_id = fields.Many2one(
|
||||
comodel_name='res.partner', inverse='_inverse_partner_id'
|
||||
comodel_name='res.partner',
|
||||
inverse='_inverse_partner_id',
|
||||
required=True
|
||||
)
|
||||
|
||||
@api.multi
|
||||
@@ -225,15 +225,6 @@ class ContractContract(models.Model):
|
||||
}
|
||||
}
|
||||
|
||||
@api.constrains('partner_id', 'recurring_invoices')
|
||||
def _check_partner_id_recurring_invoices(self):
|
||||
for contract in self.filtered('recurring_invoices'):
|
||||
if not contract.partner_id:
|
||||
raise ValidationError(
|
||||
_("You must supply a partner for the contract '%s'")
|
||||
% contract.name
|
||||
)
|
||||
|
||||
@api.multi
|
||||
def _convert_contract_lines(self, contract):
|
||||
self.ensure_one()
|
||||
@@ -393,12 +384,7 @@ class ContractContract(models.Model):
|
||||
domain = []
|
||||
if not date_ref:
|
||||
date_ref = fields.Date.context_today(self)
|
||||
domain.extend(
|
||||
[
|
||||
('recurring_invoices', '=', True),
|
||||
('recurring_next_date', '<=', date_ref),
|
||||
]
|
||||
)
|
||||
domain.extend([('recurring_next_date', '<=', date_ref)])
|
||||
return domain
|
||||
|
||||
@api.multi
|
||||
|
||||
Reference in New Issue
Block a user