[FIX] account_analytic_default: invoice from PO
- Create a vendor bill - Add a PO thanks to the "Add Purchase Order" - The analytic accounts are not added on the lines opw-693313
This commit is contained in:
@@ -70,6 +70,14 @@ class account_invoice_line(osv.osv):
|
||||
self.account_analytic_id = False
|
||||
return res
|
||||
|
||||
def _set_additional_fields(self, invoice):
|
||||
rec = self.env['account.analytic.default'].account_get(self.product_id.id, self.invoice_id.partner_id.id, self._uid,
|
||||
time.strftime('%Y-%m-%d'), company_id=self.company_id.id, context=self._context)
|
||||
if rec:
|
||||
self.account_analytic_id = rec.analytic_id.id
|
||||
else:
|
||||
self.account_analytic_id = False
|
||||
super(account_invoice_line, self)._set_additional_fields(invoice)
|
||||
|
||||
class stock_picking(osv.osv):
|
||||
_inherit = "stock.picking"
|
||||
|
||||
Reference in New Issue
Block a user