Skip to content
Browse files

[FIX] sale: terms on vendor bills

Create a vendor bill from documents, change the partner, the default
terms and conditions are automatically set on the bill.

The problem is due to a wrong default value, the onchange only uses
the invoice type from the environment but never from the invoice itself.

  • Loading branch information...
Julien00859 committed Mar 18, 2019
1 parent 2942387 commit 4b68faea4ec60e00a31acc50ed9de2a627ecaba9
Showing with 2 additions and 1 deletion.
  1. +2 −1 addons/sale/models/
@@ -46,7 +46,8 @@ def unlink(self):
def _onchange_delivery_address(self):
addr = self.partner_id.address_get(['delivery'])
self.partner_shipping_id = addr and addr.get('delivery')
if self.env.context.get('type', 'out_invoice') == 'out_invoice':
inv_type = self.type or self.env.context.get('type', 'out_invoice')
if inv_type == 'out_invoice':
company = self.company_id or self.env.user.company_id
self.comment = company.with_context(lang=self.partner_id.lang).sale_note

0 comments on commit 4b68fae

Please sign in to comment.
You can’t perform that action at this time.