Skip to content

Commit 649489e

Browse files
committed
[MIG] purchase_manual_delivery: Migration to 16.0
1 parent cf237e8 commit 649489e

File tree

5 files changed

+27
-30
lines changed

5 files changed

+27
-30
lines changed

purchase_manual_delivery/__manifest__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
and adds the ability to manually generate them as the supplier confirms
99
the different purchase order lines.
1010
""",
11-
"version": "14.0.1.0.1",
11+
"version": "16.0.1.0.0",
1212
"license": "AGPL-3",
1313
"author": "ForgeFlow S.L.," "Odoo Community Association (OCA)",
1414
"website": "https://github.com/OCA/purchase-workflow",

purchase_manual_delivery/models/purchase_order.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ def _compute_pending_to_receive(self):
2424

2525
def button_confirm_manual(self):
2626
super(PurchaseOrder, self.with_context(manual_delivery=True)).button_confirm()
27+
return
2728

2829
def _create_picking(self):
2930
if self.env.context.get("manual_delivery", False) and self.manual_delivery:
@@ -38,7 +39,7 @@ class PurchaseOrderLine(models.Model):
3839

3940
existing_qty = fields.Float(
4041
compute="_compute_existing_qty",
41-
string="Existing Qty",
42+
string="Existing Quantity",
4243
digits="Product Unit of Measure",
4344
help="Quantity already planned or shipped (stock movements " "already created)",
4445
)

purchase_manual_delivery/tests/test_purchase_manual_delivery.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ def test_01_purchase_order_manual_delivery(self):
9797
wizard = (
9898
self.env["create.stock.picking.wizard"]
9999
.with_context(
100-
{
100+
**{
101101
"active_model": "purchase.order",
102102
"active_id": self.po1.id,
103103
"active_ids": self.po1.ids,
@@ -121,7 +121,7 @@ def test_01_purchase_order_manual_delivery(self):
121121
wizard = (
122122
self.env["create.stock.picking.wizard"]
123123
.with_context(
124-
{
124+
**{
125125
"active_model": "purchase.order",
126126
"active_id": self.po1.id,
127127
"active_ids": self.po1.ids,
@@ -143,7 +143,7 @@ def test_01_purchase_order_manual_delivery(self):
143143
wizard = (
144144
self.env["create.stock.picking.wizard"]
145145
.with_context(
146-
{
146+
**{
147147
"active_model": "purchase.order",
148148
"active_id": self.po1.id,
149149
"active_ids": self.po1.ids,
@@ -182,7 +182,7 @@ def test_02_purchase_order_line_manual_delivery(self):
182182
with self.assertRaises(UserError):
183183
# create a manual delivery for two lines different PO
184184
self.env["create.stock.picking.wizard"].with_context(
185-
{
185+
**{
186186
"active_model": "purchase.order.line",
187187
"active_ids": [self.po1_line1.id, self.po2_line1.id],
188188
}
@@ -192,7 +192,7 @@ def test_02_purchase_order_line_manual_delivery(self):
192192
wizard = (
193193
self.env["create.stock.picking.wizard"]
194194
.with_context(
195-
{
195+
**{
196196
"active_model": "purchase.order.line",
197197
"active_ids": self.po2.order_line.ids,
198198
}
@@ -232,7 +232,7 @@ def test_03_purchase_order_line_location(self):
232232
wizard = (
233233
self.env["create.stock.picking.wizard"]
234234
.with_context(
235-
{
235+
**{
236236
"active_model": "purchase.order",
237237
"active_id": self.po1.id,
238238
"active_ids": self.po1.ids,

purchase_manual_delivery/wizard/create_manual_stock_picking.py

+4-6
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44
from odoo import _, api, fields, models
55
from odoo.exceptions import UserError
66

7-
from odoo.addons import decimal_precision as dp
8-
97

108
class CreateManualStockPickingWizard(models.TransientModel):
119
_name = "create.stock.picking.wizard"
@@ -191,22 +189,22 @@ class CreateManualStockPickingWizardLine(models.TransientModel):
191189
product_qty = fields.Float(
192190
string="Quantity",
193191
related="purchase_order_line_id.product_qty",
194-
digits=dp.get_precision("Product Unit of Measure"),
192+
digits="Product Unit of Measure",
195193
)
196194
existing_qty = fields.Float(
197195
string="Existing Quantity",
198196
related="purchase_order_line_id.existing_qty",
199-
digits=dp.get_precision("Product Unit of Measure"),
197+
digits="Product Unit of Measure",
200198
)
201199
remaining_qty = fields.Float(
202200
string="Remaining Quantity",
203201
compute="_compute_remaining_qty",
204202
readonly=True,
205-
digits=dp.get_precision("Product Unit of Measure"),
203+
digits="Product Unit of Measure",
206204
)
207205
qty = fields.Float(
208206
string="Quantity to Receive",
209-
digits=dp.get_precision("Product Unit of Measure"),
207+
digits="Product Unit of Measure",
210208
help="This is the quantity taken into account to create the picking",
211209
)
212210
price_unit = fields.Float(

purchase_manual_delivery/wizard/create_manual_stock_picking.xml

+14-16
Original file line numberDiff line numberDiff line change
@@ -23,22 +23,20 @@
2323
groups="stock.group_stock_multi_locations"
2424
/>
2525
</group>
26-
<group>
27-
<field name="line_ids" nolabel="1">
28-
<tree create="false" editable="bottom">
29-
<field name="purchase_order_line_id" invisible="1" />
30-
<field name="product_id" />
31-
<field name="partner_id" />
32-
<field name="date_planned" />
33-
<field name="price_unit" />
34-
<field name="product_qty" string="Ordered Qty" />
35-
<field name="existing_qty" string="Existing Qty" />
36-
<field name="remaining_qty" string="Remaining Qty" />
37-
<field name="qty" string="Quantity" />
38-
<field name="product_uom" groups="uom.group_uom" />
39-
</tree>
40-
</field>
41-
</group>
26+
<field name="line_ids" nolabel="1">
27+
<tree create="false" editable="bottom">
28+
<field name="purchase_order_line_id" invisible="1" />
29+
<field name="product_id" />
30+
<field name="partner_id" />
31+
<field name="date_planned" />
32+
<field name="price_unit" />
33+
<field name="product_qty" string="Ordered Qty" />
34+
<field name="existing_qty" string="Existing Qty" />
35+
<field name="remaining_qty" string="Remaining Qty" />
36+
<field name="qty" string="Quantity" />
37+
<field name="product_uom" groups="uom.group_uom" />
38+
</tree>
39+
</field>
4240
<footer>
4341
<button
4442
name="create_stock_picking"

0 commit comments

Comments
 (0)