mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[MIG] rma: Migration to 14.0 - fix
This commit is contained in:
committed by
Florian da Costa
parent
1702da4350
commit
b7c138f31b
@@ -9,7 +9,7 @@
|
|||||||
"summary": "Introduces the return merchandise authorization (RMA) process "
|
"summary": "Introduces the return merchandise authorization (RMA) process "
|
||||||
"in odoo",
|
"in odoo",
|
||||||
"author": "ForgeFlow",
|
"author": "ForgeFlow",
|
||||||
"website": "https://github.com/OCA/https://github.com/ForgeFlow/stock-rma",
|
"website": "https://github.com/OCA/account-budgeting",
|
||||||
"depends": ["stock", "mail", "web"],
|
"depends": ["stock", "mail", "web"],
|
||||||
"demo": ["demo/stock_demo.xml"],
|
"demo": ["demo/stock_demo.xml"],
|
||||||
"data": [
|
"data": [
|
||||||
|
|||||||
@@ -217,6 +217,7 @@ class RmaOrderLine(models.Model):
|
|||||||
)
|
)
|
||||||
operation_id = fields.Many2one(
|
operation_id = fields.Many2one(
|
||||||
comodel_name="rma.operation",
|
comodel_name="rma.operation",
|
||||||
|
required=True,
|
||||||
string="Operation",
|
string="Operation",
|
||||||
readonly=True,
|
readonly=True,
|
||||||
states={"draft": [("readonly", False)]},
|
states={"draft": [("readonly", False)]},
|
||||||
@@ -342,7 +343,7 @@ class RmaOrderLine(models.Model):
|
|||||||
string="Delivery Policy",
|
string="Delivery Policy",
|
||||||
default="no",
|
default="no",
|
||||||
readonly=True,
|
readonly=True,
|
||||||
ondelete="cascade",
|
ondelete='cascade',
|
||||||
states={"draft": [("readonly", False)]},
|
states={"draft": [("readonly", False)]},
|
||||||
)
|
)
|
||||||
in_route_id = fields.Many2one(
|
in_route_id = fields.Many2one(
|
||||||
|
|||||||
@@ -533,7 +533,9 @@ class TestRma(common.SavepointCase):
|
|||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_outgoing"))), [0], "Wrong qty_outgoing"
|
list(set(lines.mapped("qty_outgoing"))), [0], "Wrong qty_outgoing"
|
||||||
)
|
)
|
||||||
self.assertEqual(list(set(lines.mapped("qty_delivered"))), [0], "qty_delivered")
|
self.assertEqual(
|
||||||
|
list(set(lines.mapped("qty_delivered"))), [0], "qty_delivered"
|
||||||
|
)
|
||||||
|
|
||||||
# product specific
|
# product specific
|
||||||
self._check_equal_quantity(
|
self._check_equal_quantity(
|
||||||
@@ -611,7 +613,9 @@ class TestRma(common.SavepointCase):
|
|||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_received"))), [0], "Wrong qty_received"
|
list(set(lines.mapped("qty_received"))), [0], "Wrong qty_received"
|
||||||
)
|
)
|
||||||
self.assertEqual(list(set(lines.mapped("qty_delivered"))), [0], "qty_delivered")
|
self.assertEqual(
|
||||||
|
list(set(lines.mapped("qty_delivered"))), [0], "qty_delivered"
|
||||||
|
)
|
||||||
|
|
||||||
# product specific
|
# product specific
|
||||||
self._check_equal_quantity(
|
self._check_equal_quantity(
|
||||||
|
|||||||
@@ -6,10 +6,15 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Select Move">
|
<form string="Select Move">
|
||||||
<group>
|
<group>
|
||||||
<field name="partner_id" string="Customer" />
|
<field
|
||||||
|
name="partner_id"
|
||||||
|
string="Customer"
|
||||||
|
/>
|
||||||
</group>
|
</group>
|
||||||
<separator string="Select Stock Moves to add" />
|
<separator string="Select Stock Moves to add" />
|
||||||
<field name="move_ids">
|
<field
|
||||||
|
name="move_ids"
|
||||||
|
>
|
||||||
<tree>
|
<tree>
|
||||||
<field name="product_id" />
|
<field name="product_id" />
|
||||||
<field name="product_uom_qty" />
|
<field name="product_uom_qty" />
|
||||||
@@ -83,10 +88,15 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Select Move">
|
<form string="Select Move">
|
||||||
<group>
|
<group>
|
||||||
<field name="partner_id" string="Supplier" />
|
<field
|
||||||
|
name="partner_id"
|
||||||
|
string="Supplier"
|
||||||
|
/>
|
||||||
</group>
|
</group>
|
||||||
<separator string="Select Stock Moves to add" />
|
<separator string="Select Stock Moves to add" />
|
||||||
<field name="move_ids" />
|
<field
|
||||||
|
name="move_ids"
|
||||||
|
/>
|
||||||
<footer>
|
<footer>
|
||||||
<button
|
<button
|
||||||
string="Confirm"
|
string="Confirm"
|
||||||
|
|||||||
@@ -206,18 +206,17 @@ class RmaMakePickingItem(models.TransientModel):
|
|||||||
|
|
||||||
wiz_id = fields.Many2one("rma_make_picking.wizard", string="Wizard", required=True)
|
wiz_id = fields.Many2one("rma_make_picking.wizard", string="Wizard", required=True)
|
||||||
line_id = fields.Many2one(
|
line_id = fields.Many2one(
|
||||||
"rma.order.line", string="RMA order Line", readonly=True, ondelete="cascade"
|
"rma.order.line", string="RMA order Line", ondelete="cascade"
|
||||||
)
|
)
|
||||||
rma_id = fields.Many2one(
|
rma_id = fields.Many2one(
|
||||||
"rma.order", related="line_id.rma_id", string="RMA Group", readonly=True
|
"rma.order", related="line_id.rma_id", string="RMA Group"
|
||||||
)
|
)
|
||||||
product_id = fields.Many2one("product.product", string="Product", readonly=True)
|
product_id = fields.Many2one("product.product", string="Product")
|
||||||
product_qty = fields.Float(
|
product_qty = fields.Float(
|
||||||
related="line_id.product_qty",
|
related="line_id.product_qty",
|
||||||
string="Quantity Ordered",
|
string="Quantity Ordered",
|
||||||
copy=False,
|
copy=False,
|
||||||
digits="Product Unit of Measure",
|
digits="Product Unit of Measure",
|
||||||
readonly=True,
|
|
||||||
)
|
)
|
||||||
qty_to_receive = fields.Float(
|
qty_to_receive = fields.Float(
|
||||||
string="Quantity to Receive", digits="Product Unit of Measure"
|
string="Quantity to Receive", digits="Product Unit of Measure"
|
||||||
@@ -225,4 +224,4 @@ class RmaMakePickingItem(models.TransientModel):
|
|||||||
qty_to_deliver = fields.Float(
|
qty_to_deliver = fields.Float(
|
||||||
string="Quantity To Deliver", digits="Product Unit of Measure"
|
string="Quantity To Deliver", digits="Product Unit of Measure"
|
||||||
)
|
)
|
||||||
uom_id = fields.Many2one("uom.uom", string="Unit of Measure", readonly=True)
|
uom_id = fields.Many2one("uom.uom", string="Unit of Measure")
|
||||||
|
|||||||
@@ -8,10 +8,12 @@
|
|||||||
<separator string="Select lines for picking" />
|
<separator string="Select lines for picking" />
|
||||||
<field name="item_ids">
|
<field name="item_ids">
|
||||||
<tree string="RMA Lines" editable="bottom" create="false">
|
<tree string="RMA Lines" editable="bottom" create="false">
|
||||||
<field name="rma_id" groups="rma.group_rma_groups" />
|
<field name="rma_id" groups="rma.group_rma_groups" readonly="1"/>
|
||||||
<field name="product_id" />
|
<field name="product_id" readonly="1"/>
|
||||||
<field name="product_qty" />
|
<field name="product_qty" />
|
||||||
<field name="uom_id" groups="uom.group_uom" />
|
<field name="line_id" invisible="1"/>
|
||||||
|
<field name="rma_id" invisible="1"/>
|
||||||
|
<field name="uom_id" groups="uom.group_uom" readonly="1"/>
|
||||||
<field name="qty_to_receive" readonly="0" />
|
<field name="qty_to_receive" readonly="0" />
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
Reference in New Issue
Block a user