mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[IMP] contract_invoice_merge_by_partner: Don't require to merge invoices later
Adapting source contract module, we don't need to rely on account_invoice_merge functionality for having all the invoices merged.
This commit is contained in:
@@ -19,8 +19,9 @@ class AccountAnalyticAccount(models.Model):
|
||||
@api.multi
|
||||
def _prepare_invoice(self):
|
||||
invoice_vals = super(AccountAnalyticAccount, self)._prepare_invoice()
|
||||
if self.payment_mode_id:
|
||||
invoice_vals['payment_mode_id'] = self.payment_mode_id.id
|
||||
contract = self[:1]
|
||||
if contract.payment_mode_id:
|
||||
invoice_vals['payment_mode_id'] = contract.payment_mode_id.id
|
||||
invoice = self.env['account.invoice'].new(invoice_vals)
|
||||
invoice.payment_mode_id_change()
|
||||
invoice_vals = invoice._convert_to_write(invoice._cache)
|
||||
|
||||
Reference in New Issue
Block a user