mirror of
https://github.com/OCA/stock-logistics-warehouse.git
synced 2025-01-21 14:27:28 +02:00
[14.0][IMP] stock_request_analytic: Add analytic account to procurement values
If procurement will trigger a purchase and not a move, there is no mean to transmit it (e.g.: to purchase).
This commit is contained in:
@@ -29,3 +29,13 @@ class StockRequest(models.Model):
|
||||
if self.order_id and self.order_id.default_analytic_account_id:
|
||||
self.analytic_account_id = self.order_id.default_analytic_account_id
|
||||
return res
|
||||
|
||||
def _prepare_procurement_values(self, group_id=False):
|
||||
|
||||
"""
|
||||
Add analytic account to procurement values
|
||||
"""
|
||||
res = super()._prepare_procurement_values(group_id=group_id)
|
||||
if self.analytic_account_id:
|
||||
res.update({"analytic_account_id": self.analytic_account_id.id})
|
||||
return res
|
||||
|
||||
Reference in New Issue
Block a user