Skip to content

Commit 26cd60a

Browse files
[MIG] stock_landed_costs
1 parent efbada3 commit 26cd60a

File tree

3 files changed

+57
-1
lines changed

3 files changed

+57
-1
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---Models in module 'stock_landed_costs'---
2+
---Fields in module 'stock_landed_costs'---
3+
stock_landed_costs / account.move.line / is_landed_costs_line (boolean): NEW
4+
# DONE: post-migration: filled it when corresponding
5+
6+
stock_landed_costs / product.template / split_method (selection) : DEL selection_keys: ['by_current_cost_price', 'by_quantity', 'by_volume', 'by_weight', 'equal']
7+
# NOTHING TO DO: it's used instead the split_method of stock.landed.cost.lines
8+
9+
stock_landed_costs / res.company / lc_journal_id (many2one) : NEW relation: account.journal
10+
stock_landed_costs / stock.landed.cost / activity_ids (one2many) : NEW relation: mail.activity
11+
stock_landed_costs / stock.landed.cost / vendor_bill_id (many2one) : NEW relation: account.move
12+
stock_landed_costs / account.move / landed_costs_ids (one2many) : NEW relation: stock.landed.cost
13+
# NOTHING TO DO: new feature
14+
15+
stock_landed_costs / stock.valuation.adjustment.lines / former_cost_per_unit (float) : DEL
16+
# NOTHING TO DO: it was a stored compute but not used anymore
17+
18+
stock_landed_costs / stock.move / landed_cost_value (float) : DEL
19+
stock_landed_costs / stock.valuation.layer / stock_landed_cost_id (many2one): NEW relation: stock.landed.cost
20+
stock_landed_costs / stock.landed.cost / stock_valuation_layer_ids (one2many): NEW relation: stock.valuation.layer
21+
# TODO: to check if we could use the landed_cost_value in the new layer implementation
22+
23+
---XML records in module 'stock_landed_costs'---
24+
DEL ir.actions.act_window: stock_landed_costs.stock_landed_cost_type_action
25+
DEL ir.actions.act_window.view: stock_landed_costs.stock_landed_cost_type_action1
26+
DEL ir.actions.act_window.view: stock_landed_costs.stock_landed_cost_type_action2
27+
DEL ir.ui.menu: stock_landed_costs.menu_stock_landed_cost_type
28+
NEW ir.ui.view: stock_landed_costs.account_view_move_form_inherited
29+
NEW ir.ui.view: stock_landed_costs.stock_valuation_layer_form_inherited
30+
NEW ir.ui.view: stock_landed_costs.view_stock_landed_cost_tree2
31+
DEL ir.ui.view: stock_landed_costs.stock_landed_cost_tree_view
32+
DEL ir.ui.view: stock_landed_costs.view_stock_landed_cost_type_form
33+
# NOTHING TO DO
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2020 ForgeFlow <http://www.forgeflow.com>
2+
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3+
from openupgradelib import openupgrade
4+
5+
6+
def fill_account_move_line_is_landed_costs_line(env):
7+
openupgrade.logged_query(
8+
env.cr, """
9+
UPDATE account_move_line aml
10+
SET is_landed_costs_line = TRUE
11+
FROM product_product pp
12+
JOIN product_template pt ON pp.product_tmpl_id = pt.id
13+
WHERE aml.product_id = pp.id
14+
AND pt.landed_cost_ok AND pt.type = 'service'""",
15+
)
16+
17+
18+
@openupgrade.migrate()
19+
def migrate(env, version):
20+
fill_account_move_line_is_landed_costs_line(env)
21+
openupgrade.load_data(
22+
env.cr, "stock_landed_costs",
23+
"migrations/13.0.1.1/noupdate_changes.xml")

odoo/openupgrade/doc/source/modules120-130.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -601,7 +601,7 @@ missing in the new release are marked with |del|.
601601
+----------------------------------------------+-------------------------------------------------+
602602
|stock_dropshipping | |
603603
+----------------------------------------------+-------------------------------------------------+
604-
|stock_landed_costs | |
604+
|stock_landed_costs | Done |
605605
+----------------------------------------------+-------------------------------------------------+
606606
|stock_picking_batch | Done |
607607
+----------------------------------------------+-------------------------------------------------+

0 commit comments

Comments
 (0)