summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/fields/basic_fields.js
diff options
context:
space:
mode:
authorRémy Voet (ryv) <ryv@odoo.com>2021-03-03 17:29:21 +0000
committerRémy Voet (ryv) <ryv@odoo.com>2021-03-04 09:43:44 +0000
commitc9f55c5ecf174414f8e9ed6df56170ac2c6d6e3e (patch)
tree7dc5d9ea2b86b0e201dbca99fc30a0099621d310 /addons/web/static/src/js/fields/basic_fields.js
parent336d5eee6484cfa66616560fdcca35cfcceb361d (diff)
[FIX] account: fix default context for `group_id`
Issue: - Activate "Analytic Tags" and "Analytic Accounting" Settings - Create an Analytic Tags and select "Analytic Distribution" - Create Product -> Product type: Storable product, Update Quantity as 100, Sales Price like 100 - Product category -> Costing Method: Average Cost (AVCO) Inventory Valuation: Automated - Create Analytic Defaults Rules -> select created Analytic Tags & Product. - Create a SO -> Confirm it -> Delivery -> Validate it then system give validation message message: "The operation cannot be completed: another model requires the record being deleted. If possible, archive it instead. Model: Analytic Line (account.analytic.line), Constraint: account_analytic_line_group_id_fkey” But can be validated from the Inventory app. Technical information: It is due to the `default_group_id` in context put in `action_view_delivery` method, it context key allows to create delivery (tree view of `stock.picking`) with the correct `group_id` ("Procurement Group"). But the this name field is also used in the `account.analytic.line` model. Moreover, the the `_prepare_analytic_distribution_line` doesn't return any value for `group_id` which means, that at the creation of the `account.analytic.line` the `group_id` (id of `procurement.group`) which will wrongly used. Solution: Because the `group_id` field on `account.analytic.line` is a related store of `account_id.group_id`. We can set it directly in the `_prepare_analytic_distribution_line` with the correct value. opw-2442493 closes odoo/odoo#67183 Signed-off-by: William André (wan) <wan@odoo.com>
Diffstat (limited to 'addons/web/static/src/js/fields/basic_fields.js')
0 files changed, 0 insertions, 0 deletions