Skip to content
Browse files

[FIX] account_analytic_default: apply same logic as in _prepare_invoi…


It was not possible to manually set a default analytic account as it was
overriden by the onchange, even if no account was returned by account_get

Apply the same logic as in _prepare_invoice_line on sale.order.line
  • Loading branch information...
MohsenWaleed authored and mart-e committed Jan 16, 2019
1 parent 8f2267b commit 39d79e443a5806ec4118182b5850c178ff46aa0a
Showing with 3 additions and 2 deletions.
  1. +3 −2 addons/account_analytic_default/models/
@@ -68,8 +68,9 @@ def _onchange_product_id(self):
res = super(AccountInvoiceLine, self)._onchange_product_id()
rec = self.env['account.analytic.default'].account_get(,, self.env.uid,,
self.account_analytic_id =
self.analytic_tag_ids = rec.analytic_tag_ids.ids
if rec:
self.account_analytic_id =
self.analytic_tag_ids = rec.analytic_tag_ids.ids
return res

def _set_additional_fields(self, invoice):

0 comments on commit 39d79e4

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