summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authoroco-odoo <oco@odoo.com>2018-02-26 14:04:30 +0100
committerGitHub <noreply@github.com>2018-02-26 14:04:30 +0100
commit60aa7596e508aa79a8ef005a5714bbbccc4ca6e0 (patch)
tree53b55c05c42bd99d5b898add6a4f7440f4e680fa /addons
parent5d2c63bf49b86b5615adaa9fc3070fc5e826da15 (diff)
[FIX] account, purchase: Recurrent vendor bills (#23320)
- set due date based on payment terms at generation for recurring bills - do not generate "This vendor bill has been created form POXXX" for bills that have been generated by cron
Diffstat (limited to 'addons')
-rw-r--r--addons/account/models/account_invoice.py2
-rw-r--r--addons/purchase/models/account_invoice.py2
2 files changed, 2 insertions, 2 deletions
diff --git a/addons/account/models/account_invoice.py b/addons/account/models/account_invoice.py
index c401ed93108..efbb103ccf3 100644
--- a/addons/account/models/account_invoice.py
+++ b/addons/account/models/account_invoice.py
@@ -509,7 +509,7 @@ class AccountInvoice(models.Model):
'is_recurring_document': True,
})
# set the due date
- #invoice._onchange_payment_term_date_invoice()
+ invoice._onchange_payment_term_date_invoice()
link = '<a href=# data-oe-model=account.invoice data-oe-id=%d>%s</a>' % (self.id, self.number)
invoice.message_post(body=_('This bill has been generated by %s') % link)
return invoice
diff --git a/addons/purchase/models/account_invoice.py b/addons/purchase/models/account_invoice.py
index 4847ddf11ee..fecd7515a39 100644
--- a/addons/purchase/models/account_invoice.py
+++ b/addons/purchase/models/account_invoice.py
@@ -212,7 +212,7 @@ class AccountInvoice(models.Model):
def create(self, vals):
invoice = super(AccountInvoice, self).create(vals)
purchase = invoice.invoice_line_ids.mapped('purchase_line_id.order_id')
- if purchase and not invoice.refund_invoice_id:
+ if purchase and not invoice.refund_invoice_id and not invoice.is_recurring_document:
message = _("This vendor bill has been created from: %s") % (",".join(["<a href=# data-oe-model=purchase.order data-oe-id="+str(order.id)+">"+order.name+"</a>" for order in purchase]))
invoice.message_post(body=message)
return invoice