[IMP] stock_account: Add partner on account entries

Add the partner references on account entries created from
a purchase order receipt or a customer invoice

Part-of: odoo/odoo#99411
This commit is contained in:
Arnold Moyaux
2022-09-12 13:49:16 +02:00
parent 4adfeecdcf
commit 7016337331
+2 -1
View File
@@ -501,12 +501,13 @@ class StockMove(models.Model):
def _prepare_account_move_vals(self, credit_account_id, debit_account_id, journal_id, qty, description, svl_id, cost):
self.ensure_one()
valuation_partner_id = self._get_partner_id_for_valuation_lines()
move_ids = self._prepare_account_move_line(qty, cost, credit_account_id, debit_account_id, description)
date = self._context.get('force_period_date', fields.Date.context_today(self))
return {
'journal_id': journal_id,
'line_ids': move_ids,
'partner_id': valuation_partner_id,
'date': date,
'ref': description,
'stock_move_id': self.id,