[MV] - move onchange method to contract_product module

[RMV] - Remove useless check
This commit is contained in:
sbejaoui
2019-01-10 16:57:05 +01:00
committed by Pedro M. Baeza
parent 8b0398abc9
commit 10cbdf2e8e
2 changed files with 1 additions and 32 deletions

View File

@@ -157,7 +157,7 @@ class AccountAnalyticAccount(models.Model):
for contract in self.filtered('recurring_invoices'):
if not contract.partner_id:
raise ValidationError(
_("You must supply a customer for the contract '%s'")
_("You must supply a partner for the contract '%s'")
% contract.name
)
@@ -180,17 +180,6 @@ class AccountAnalyticAccount(models.Model):
@api.multi
def _prepare_invoice(self, date_invoice, journal=None):
self.ensure_one()
if not self.partner_id:
if self.contract_type == 'purchase':
raise ValidationError(
_("You must first select a Supplier for Contract %s!")
% self.name
)
else:
raise ValidationError(
_("You must first select a Customer for Contract %s!")
% self.name
)
if not journal:
journal = (
self.journal_id