Skip to content

Commit c3fa00a

Browse files
[MIG] purchase_stock_manual_currency: Migration to 17.0
1 parent edaa3e3 commit c3fa00a

File tree

3 files changed

+14
-14
lines changed

3 files changed

+14
-14
lines changed

purchase_stock_manual_currency/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
{
55
"name": "Purchase Stock Manual Currency",
6-
"version": "15.0.1.0.0",
6+
"version": "17.0.1.0.0",
77
"category": "Purchase Management",
88
"summary": "Extends manual currency from purchase to stock moves",
99
"author": "ForgeFlow, Odoo Community Association (OCA)",

purchase_stock_manual_currency/models/stock_move.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def _get_price_unit(self):
1212
# price unit to the company currency by using the manual rate, instead
1313
# of the default rate.
1414
self.ensure_one()
15-
price_company_curr = super(StockMove, self)._get_price_unit()
15+
price_company_curr = super()._get_price_unit()
1616
p_order = self.purchase_line_id.order_id
1717
if p_order and p_order.manual_currency:
1818
company_curr = p_order.company_id.currency_id

purchase_stock_manual_currency/tests/test_purchase_stock_manual_currency.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ def test_01_purchase_stock_manual_currency(self):
9090
self.assertEqual(len(self.p_order.picking_ids), 1)
9191
stock_picking = self.p_order.picking_ids
9292

93-
self.assertTrue(stock_picking.move_lines)
94-
self.assertEqual(len(stock_picking.move_lines), 1)
95-
stock_move = stock_picking.move_lines
93+
self.assertTrue(stock_picking.move_ids)
94+
self.assertEqual(len(stock_picking.move_ids), 1)
95+
stock_move = stock_picking.move_ids
9696
price = stock_move._get_price_unit()
9797
self.assertEqual(round(price, 2), 7.21)
98-
stock_picking.move_lines.write({"quantity_done": 10})
98+
stock_picking.move_ids.write({"quantity": 10})
9999
stock_picking.button_validate()
100100

101101
self.assertTrue(stock_move.stock_valuation_layer_ids)
@@ -121,12 +121,12 @@ def test_02_purchase_stock_manual_currency(self):
121121
self.assertEqual(len(self.p_order.picking_ids), 1)
122122
stock_picking = self.p_order.picking_ids
123123

124-
self.assertTrue(stock_picking.move_lines)
125-
self.assertEqual(len(stock_picking.move_lines), 1)
126-
stock_move = stock_picking.move_lines
124+
self.assertTrue(stock_picking.move_ids)
125+
self.assertEqual(len(stock_picking.move_ids), 1)
126+
stock_move = stock_picking.move_ids
127127
price = stock_move._get_price_unit()
128128
self.assertEqual(round(price, 2), 4.00)
129-
stock_picking.move_lines.write({"quantity_done": 10})
129+
stock_picking.move_ids.write({"quantity": 10})
130130
stock_picking.button_validate()
131131

132132
self.assertTrue(stock_move.stock_valuation_layer_ids)
@@ -151,12 +151,12 @@ def test_03_purchase_stock_manual_currency(self):
151151
self.assertEqual(len(self.p_order.picking_ids), 1)
152152
stock_picking = self.p_order.picking_ids
153153

154-
self.assertTrue(stock_picking.move_lines)
155-
self.assertEqual(len(stock_picking.move_lines), 1)
156-
stock_move = stock_picking.move_lines
154+
self.assertTrue(stock_picking.move_ids)
155+
self.assertEqual(len(stock_picking.move_ids), 1)
156+
stock_move = stock_picking.move_ids
157157
price = stock_move._get_price_unit()
158158
self.assertEqual(round(price, 2), 8.00)
159-
stock_picking.move_lines.write({"quantity_done": 10})
159+
stock_picking.move_ids.write({"quantity": 10})
160160
stock_picking.button_validate()
161161

162162
self.assertTrue(stock_move.stock_valuation_layer_ids)

0 commit comments

Comments
 (0)