mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[MIG] rma: Migration to 14.0
This commit is contained in:
committed by
JasminSForgeFlow
parent
05bc2b1c1a
commit
d19184acd6
@@ -3,13 +3,13 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "RMA (Return Merchandise Authorization)",
|
"name": "RMA (Return Merchandise Authorization)",
|
||||||
"version": "13.0.1.0.0",
|
"version": "14.0.1.0.0",
|
||||||
"license": "LGPL-3",
|
"license": "LGPL-3",
|
||||||
"category": "RMA",
|
"category": "RMA",
|
||||||
"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/account-budgeting",
|
"website": "https://github.com/OCA/https://github.com/ForgeFlow/stock-rma",
|
||||||
"depends": ["stock", "mail", "web"],
|
"depends": ["stock", "mail", "web"],
|
||||||
"demo": ["demo/stock_demo.xml"],
|
"demo": ["demo/stock_demo.xml"],
|
||||||
"data": [
|
"data": [
|
||||||
|
|||||||
@@ -86,7 +86,7 @@ class RmaOrder(models.Model):
|
|||||||
@api.model
|
@api.model
|
||||||
def _default_warehouse_id(self):
|
def _default_warehouse_id(self):
|
||||||
warehouse = self.env["stock.warehouse"].search(
|
warehouse = self.env["stock.warehouse"].search(
|
||||||
[("company_id", "=", self.env.user.company_id.id)], limit=1
|
[("company_id", "=", self.env.company.id)], limit=1
|
||||||
)
|
)
|
||||||
return warehouse
|
return warehouse
|
||||||
|
|
||||||
@@ -123,16 +123,16 @@ class RmaOrder(models.Model):
|
|||||||
"res.company",
|
"res.company",
|
||||||
string="Company",
|
string="Company",
|
||||||
required=True,
|
required=True,
|
||||||
default=lambda self: self.env.user.company_id,
|
default=lambda self: self.env.company,
|
||||||
)
|
)
|
||||||
assigned_to = fields.Many2one(
|
assigned_to = fields.Many2one(
|
||||||
comodel_name="res.users",
|
comodel_name="res.users",
|
||||||
track_visibility="onchange",
|
tracking=True,
|
||||||
default=lambda self: self.env.uid,
|
default=lambda self: self.env.uid,
|
||||||
)
|
)
|
||||||
requested_by = fields.Many2one(
|
requested_by = fields.Many2one(
|
||||||
comodel_name="res.users",
|
comodel_name="res.users",
|
||||||
track_visibility="onchange",
|
tracking=True,
|
||||||
default=lambda self: self.env.uid,
|
default=lambda self: self.env.uid,
|
||||||
)
|
)
|
||||||
in_warehouse_id = fields.Many2one(
|
in_warehouse_id = fields.Many2one(
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ class RmaOrderLine(models.Model):
|
|||||||
rma_id = fields.Many2one(
|
rma_id = fields.Many2one(
|
||||||
comodel_name="rma.order",
|
comodel_name="rma.order",
|
||||||
string="RMA Group",
|
string="RMA Group",
|
||||||
track_visibility="onchange",
|
tracking=True,
|
||||||
readonly=True,
|
readonly=True,
|
||||||
)
|
)
|
||||||
name = fields.Char(
|
name = fields.Char(
|
||||||
@@ -213,7 +213,7 @@ class RmaOrderLine(models.Model):
|
|||||||
],
|
],
|
||||||
string="State",
|
string="State",
|
||||||
default="draft",
|
default="draft",
|
||||||
track_visibility="onchange",
|
tracking=True,
|
||||||
)
|
)
|
||||||
operation_id = fields.Many2one(
|
operation_id = fields.Many2one(
|
||||||
comodel_name="rma.operation",
|
comodel_name="rma.operation",
|
||||||
@@ -223,19 +223,19 @@ class RmaOrderLine(models.Model):
|
|||||||
)
|
)
|
||||||
assigned_to = fields.Many2one(
|
assigned_to = fields.Many2one(
|
||||||
comodel_name="res.users",
|
comodel_name="res.users",
|
||||||
track_visibility="onchange",
|
tracking=True,
|
||||||
default=lambda self: self.env.uid,
|
default=lambda self: self.env.uid,
|
||||||
)
|
)
|
||||||
requested_by = fields.Many2one(
|
requested_by = fields.Many2one(
|
||||||
comodel_name="res.users",
|
comodel_name="res.users",
|
||||||
track_visibility="onchange",
|
tracking=True,
|
||||||
default=lambda self: self.env.uid,
|
default=lambda self: self.env.uid,
|
||||||
)
|
)
|
||||||
partner_id = fields.Many2one(
|
partner_id = fields.Many2one(
|
||||||
comodel_name="res.partner",
|
comodel_name="res.partner",
|
||||||
required=True,
|
required=True,
|
||||||
store=True,
|
store=True,
|
||||||
track_visibility="onchange",
|
tracking=True,
|
||||||
string="Partner",
|
string="Partner",
|
||||||
readonly=True,
|
readonly=True,
|
||||||
states={"draft": [("readonly", False)]},
|
states={"draft": [("readonly", False)]},
|
||||||
@@ -295,13 +295,13 @@ class RmaOrderLine(models.Model):
|
|||||||
currency_id = fields.Many2one(
|
currency_id = fields.Many2one(
|
||||||
"res.currency",
|
"res.currency",
|
||||||
string="Currency",
|
string="Currency",
|
||||||
default=lambda self: self.env.user.company_id.currency_id,
|
default=lambda self: self.env.company.currency_id,
|
||||||
)
|
)
|
||||||
company_id = fields.Many2one(
|
company_id = fields.Many2one(
|
||||||
comodel_name="res.company",
|
comodel_name="res.company",
|
||||||
string="Company",
|
string="Company",
|
||||||
required=True,
|
required=True,
|
||||||
default=lambda self: self.env.user.company_id,
|
default=lambda self: self.env.company,
|
||||||
)
|
)
|
||||||
type = fields.Selection(
|
type = fields.Selection(
|
||||||
selection=[("customer", "Customer"), ("supplier", "Supplier")],
|
selection=[("customer", "Customer"), ("supplier", "Supplier")],
|
||||||
@@ -342,6 +342,7 @@ class RmaOrderLine(models.Model):
|
|||||||
string="Delivery Policy",
|
string="Delivery Policy",
|
||||||
default="no",
|
default="no",
|
||||||
readonly=True,
|
readonly=True,
|
||||||
|
ondelete="cascade",
|
||||||
states={"draft": [("readonly", False)]},
|
states={"draft": [("readonly", False)]},
|
||||||
)
|
)
|
||||||
in_route_id = fields.Many2one(
|
in_route_id = fields.Many2one(
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ class TestRma(common.SavepointCase):
|
|||||||
}
|
}
|
||||||
|
|
||||||
def _check_equal_quantity(self, qty1, qty2, msg):
|
def _check_equal_quantity(self, qty1, qty2, msg):
|
||||||
self.assertEquals(qty1, qty2, msg)
|
self.assertEqual(qty1, qty2, msg)
|
||||||
|
|
||||||
def test_01_rma_order_line(self):
|
def test_01_rma_order_line(self):
|
||||||
for line in self.rma_customer_id.rma_line_ids:
|
for line in self.rma_customer_id.rma_line_ids:
|
||||||
@@ -238,22 +238,22 @@ class TestRma(common.SavepointCase):
|
|||||||
line._compute_out_shipment_count()
|
line._compute_out_shipment_count()
|
||||||
|
|
||||||
# check assert if call reference_move_id onchange
|
# check assert if call reference_move_id onchange
|
||||||
self.assertEquals(line.product_id, line.reference_move_id.product_id)
|
self.assertEqual(line.product_id, line.reference_move_id.product_id)
|
||||||
self.assertEquals(line.product_qty, line.reference_move_id.product_uom_qty)
|
self.assertEqual(line.product_qty, line.reference_move_id.product_uom_qty)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
line.location_id.location_id, line.reference_move_id.location_id
|
line.location_id.location_id, line.reference_move_id.location_id
|
||||||
)
|
)
|
||||||
self.assertEquals(line.origin, line.reference_move_id.picking_id.name)
|
self.assertEqual(line.origin, line.reference_move_id.picking_id.name)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
line.delivery_address_id, line.reference_move_id.picking_partner_id
|
line.delivery_address_id, line.reference_move_id.picking_partner_id
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
line.qty_to_receive, line.reference_move_id.product_uom_qty
|
line.qty_to_receive, line.reference_move_id.product_uom_qty
|
||||||
)
|
)
|
||||||
line._onchange_product_id()
|
line._onchange_product_id()
|
||||||
line._onchange_operation_id()
|
line._onchange_operation_id()
|
||||||
# check assert if call operation_id onchange
|
# check assert if call operation_id onchange
|
||||||
self.assertEquals(line.operation_id.receipt_policy, line.receipt_policy)
|
self.assertEqual(line.operation_id.receipt_policy, line.receipt_policy)
|
||||||
|
|
||||||
data = {"customer_to_supplier": line.customer_to_supplier}
|
data = {"customer_to_supplier": line.customer_to_supplier}
|
||||||
line = self.rma_line.new(data)
|
line = self.rma_line.new(data)
|
||||||
@@ -287,20 +287,20 @@ class TestRma(common.SavepointCase):
|
|||||||
res = self.rma_customer_id.rma_line_ids.action_view_in_shipments()
|
res = self.rma_customer_id.rma_line_ids.action_view_in_shipments()
|
||||||
self.assertTrue("res_id" in res, "Incorrect number of pickings" "created")
|
self.assertTrue("res_id" in res, "Incorrect number of pickings" "created")
|
||||||
picking = self.env["stock.picking"].browse(res["res_id"])
|
picking = self.env["stock.picking"].browse(res["res_id"])
|
||||||
self.assertEquals(len(picking), 1, "Incorrect number of pickings created")
|
self.assertEqual(len(picking), 1, "Incorrect number of pickings created")
|
||||||
moves = picking.move_lines
|
moves = picking.move_lines
|
||||||
self.assertEquals(len(moves), 3, "Incorrect number of moves created")
|
self.assertEqual(len(moves), 3, "Incorrect number of moves created")
|
||||||
lines = self.rma_customer_id.rma_line_ids
|
lines = self.rma_customer_id.rma_line_ids
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_received"))), [0], "Wrong qty received"
|
list(set(lines.mapped("qty_received"))), [0], "Wrong qty received"
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_to_deliver"))), [0], "Wrong qty to deliver"
|
list(set(lines.mapped("qty_to_deliver"))), [0], "Wrong qty to deliver"
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_outgoing"))), [0], "Wrong qty outgoing"
|
list(set(lines.mapped("qty_outgoing"))), [0], "Wrong qty outgoing"
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_delivered"))), [0], "Wrong qty delivered"
|
list(set(lines.mapped("qty_delivered"))), [0], "Wrong qty delivered"
|
||||||
)
|
)
|
||||||
# product specific
|
# product specific
|
||||||
@@ -338,18 +338,18 @@ class TestRma(common.SavepointCase):
|
|||||||
picking.action_assign()
|
picking.action_assign()
|
||||||
for mv in picking.move_lines:
|
for mv in picking.move_lines:
|
||||||
mv.quantity_done = mv.product_uom_qty
|
mv.quantity_done = mv.product_uom_qty
|
||||||
picking.action_done()
|
picking._action_done()
|
||||||
lines = self.rma_customer_id.rma_line_ids
|
lines = self.rma_customer_id.rma_line_ids
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_to_receive"))), [0], "Wrong qty to_receive"
|
list(set(lines.mapped("qty_to_receive"))), [0], "Wrong qty to_receive"
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_incoming"))), [0], "Wrong qty incoming"
|
list(set(lines.mapped("qty_incoming"))), [0], "Wrong qty incoming"
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_outgoing"))), [0], "Wrong qty outgoing"
|
list(set(lines.mapped("qty_outgoing"))), [0], "Wrong qty outgoing"
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_delivered"))), [0], "Wrong qty delivered"
|
list(set(lines.mapped("qty_delivered"))), [0], "Wrong qty delivered"
|
||||||
)
|
)
|
||||||
# product specific
|
# product specific
|
||||||
@@ -397,15 +397,15 @@ class TestRma(common.SavepointCase):
|
|||||||
self.assertTrue("res_id" in res, "Incorrect number of pickings" "created")
|
self.assertTrue("res_id" in res, "Incorrect number of pickings" "created")
|
||||||
picking = self.env["stock.picking"].browse(res["res_id"])
|
picking = self.env["stock.picking"].browse(res["res_id"])
|
||||||
moves = picking.move_lines
|
moves = picking.move_lines
|
||||||
self.assertEquals(len(moves), 3, "Incorrect number of moves created")
|
self.assertEqual(len(moves), 3, "Incorrect number of moves created")
|
||||||
lines = self.rma_customer_id.rma_line_ids
|
lines = self.rma_customer_id.rma_line_ids
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_to_receive"))), [0], "Wrong qty to_receive"
|
list(set(lines.mapped("qty_to_receive"))), [0], "Wrong qty to_receive"
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_incoming"))), [0], "Wrong qty incoming"
|
list(set(lines.mapped("qty_incoming"))), [0], "Wrong qty incoming"
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_delivered"))), [0], "Wrong qty delivered"
|
list(set(lines.mapped("qty_delivered"))), [0], "Wrong qty delivered"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -444,15 +444,15 @@ class TestRma(common.SavepointCase):
|
|||||||
picking.action_assign()
|
picking.action_assign()
|
||||||
for mv in picking.move_lines:
|
for mv in picking.move_lines:
|
||||||
mv.quantity_done = mv.product_uom_qty
|
mv.quantity_done = mv.product_uom_qty
|
||||||
picking.action_done()
|
picking._action_done()
|
||||||
lines = self.rma_customer_id.rma_line_ids
|
lines = self.rma_customer_id.rma_line_ids
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_to_receive"))), [0], "Wrong qty to_receive"
|
list(set(lines.mapped("qty_to_receive"))), [0], "Wrong qty to_receive"
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_incoming"))), [0], "Wrong qty incoming"
|
list(set(lines.mapped("qty_incoming"))), [0], "Wrong qty incoming"
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_outgoing"))), [0], "Wrong qty_outgoing"
|
list(set(lines.mapped("qty_outgoing"))), [0], "Wrong qty_outgoing"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -489,7 +489,7 @@ class TestRma(common.SavepointCase):
|
|||||||
)
|
)
|
||||||
|
|
||||||
self.line.action_rma_done()
|
self.line.action_rma_done()
|
||||||
self.assertEquals(self.line.state, "done", "Wrong State")
|
self.assertEqual(self.line.state, "done", "Wrong State")
|
||||||
self.rma_customer_id.action_view_in_shipments()
|
self.rma_customer_id.action_view_in_shipments()
|
||||||
self.rma_customer_id.action_view_out_shipments()
|
self.rma_customer_id.action_view_out_shipments()
|
||||||
self.rma_customer_id.action_view_lines()
|
self.rma_customer_id.action_view_lines()
|
||||||
@@ -514,9 +514,9 @@ class TestRma(common.SavepointCase):
|
|||||||
res = self.rma_droship_id.rma_line_ids.action_view_in_shipments()
|
res = self.rma_droship_id.rma_line_ids.action_view_in_shipments()
|
||||||
self.assertTrue("res_id" in res, "Incorrect number of pickings" "created")
|
self.assertTrue("res_id" in res, "Incorrect number of pickings" "created")
|
||||||
picking = self.env["stock.picking"].browse(res["res_id"])
|
picking = self.env["stock.picking"].browse(res["res_id"])
|
||||||
self.assertEquals(len(picking), 1, "Incorrect number of pickings created")
|
self.assertEqual(len(picking), 1, "Incorrect number of pickings created")
|
||||||
moves = picking.move_lines
|
moves = picking.move_lines
|
||||||
self.assertEquals(len(moves), 3, "Incorrect number of moves created")
|
self.assertEqual(len(moves), 3, "Incorrect number of moves created")
|
||||||
wizard = self.make_supplier_rma.with_context(
|
wizard = self.make_supplier_rma.with_context(
|
||||||
{
|
{
|
||||||
"active_ids": self.rma_droship_id.rma_line_ids.ids,
|
"active_ids": self.rma_droship_id.rma_line_ids.ids,
|
||||||
@@ -527,15 +527,13 @@ class TestRma(common.SavepointCase):
|
|||||||
res = wizard.make_supplier_rma()
|
res = wizard.make_supplier_rma()
|
||||||
supplier_rma = self.rma.browse(res["res_id"])
|
supplier_rma = self.rma.browse(res["res_id"])
|
||||||
lines = supplier_rma.rma_line_ids
|
lines = supplier_rma.rma_line_ids
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_received"))), [0], "Wrong qty_received"
|
list(set(lines.mapped("qty_received"))), [0], "Wrong qty_received"
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_outgoing"))), [0], "Wrong qty_outgoing"
|
list(set(lines.mapped("qty_outgoing"))), [0], "Wrong qty_outgoing"
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(list(set(lines.mapped("qty_delivered"))), [0], "qty_delivered")
|
||||||
list(set(lines.mapped("qty_delivered"))), [0], "qty_delivered"
|
|
||||||
)
|
|
||||||
|
|
||||||
# product specific
|
# product specific
|
||||||
self._check_equal_quantity(
|
self._check_equal_quantity(
|
||||||
@@ -577,7 +575,7 @@ class TestRma(common.SavepointCase):
|
|||||||
"Wrong qty_in_supplier_rma",
|
"Wrong qty_in_supplier_rma",
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_to_supplier_rma"))),
|
list(set(lines.mapped("qty_to_supplier_rma"))),
|
||||||
[0],
|
[0],
|
||||||
"Wrong qty_to_supplier_rma",
|
"Wrong qty_to_supplier_rma",
|
||||||
@@ -586,7 +584,7 @@ class TestRma(common.SavepointCase):
|
|||||||
for line in self.rma_droship_id.rma_line_ids:
|
for line in self.rma_droship_id.rma_line_ids:
|
||||||
line.action_rma_done()
|
line.action_rma_done()
|
||||||
|
|
||||||
self.assertEquals(line.mapped("state"), ["done"], "Wrong State")
|
self.assertEqual(line.mapped("state"), ["done"], "Wrong State")
|
||||||
|
|
||||||
# Supplier RMA
|
# Supplier RMA
|
||||||
def test_04_supplier_rma(self):
|
def test_04_supplier_rma(self):
|
||||||
@@ -607,15 +605,13 @@ class TestRma(common.SavepointCase):
|
|||||||
self.assertTrue("res_id" in res, "Incorrect number of pickings" "created")
|
self.assertTrue("res_id" in res, "Incorrect number of pickings" "created")
|
||||||
picking = self.env["stock.picking"].browse(res["res_id"])
|
picking = self.env["stock.picking"].browse(res["res_id"])
|
||||||
moves = picking.move_lines
|
moves = picking.move_lines
|
||||||
self.assertEquals(len(moves), 3, "Incorrect number of moves created")
|
self.assertEqual(len(moves), 3, "Incorrect number of moves created")
|
||||||
|
|
||||||
lines = self.rma_supplier_id.rma_line_ids
|
lines = self.rma_supplier_id.rma_line_ids
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_received"))), [0], "Wrong qty_received"
|
list(set(lines.mapped("qty_received"))), [0], "Wrong qty_received"
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(list(set(lines.mapped("qty_delivered"))), [0], "qty_delivered")
|
||||||
list(set(lines.mapped("qty_delivered"))), [0], "qty_delivered"
|
|
||||||
)
|
|
||||||
|
|
||||||
# product specific
|
# product specific
|
||||||
self._check_equal_quantity(
|
self._check_equal_quantity(
|
||||||
@@ -648,24 +644,24 @@ class TestRma(common.SavepointCase):
|
|||||||
2,
|
2,
|
||||||
"Wrong qty_to_deliver",
|
"Wrong qty_to_deliver",
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_incoming"))), [0], "Wrong qty_incoming"
|
list(set(lines.mapped("qty_incoming"))), [0], "Wrong qty_incoming"
|
||||||
)
|
)
|
||||||
picking.action_assign()
|
picking.action_assign()
|
||||||
for mv in picking.move_lines:
|
for mv in picking.move_lines:
|
||||||
mv.quantity_done = mv.product_uom_qty
|
mv.quantity_done = mv.product_uom_qty
|
||||||
picking.action_done()
|
picking._action_done()
|
||||||
|
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_incoming"))), [0], "Wrong qty_incoming"
|
list(set(lines.mapped("qty_incoming"))), [0], "Wrong qty_incoming"
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_to_deliver"))), [0], "Wrong qty_to_deliver"
|
list(set(lines.mapped("qty_to_deliver"))), [0], "Wrong qty_to_deliver"
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_received"))), [0], "Wrong qty_received"
|
list(set(lines.mapped("qty_received"))), [0], "Wrong qty_received"
|
||||||
)
|
)
|
||||||
self.assertEquals(list(set(lines.mapped("qty_outgoing"))), [0], "qty_outgoing")
|
self.assertEqual(list(set(lines.mapped("qty_outgoing"))), [0], "qty_outgoing")
|
||||||
|
|
||||||
# product specific
|
# product specific
|
||||||
self._check_equal_quantity(
|
self._check_equal_quantity(
|
||||||
@@ -716,13 +712,13 @@ class TestRma(common.SavepointCase):
|
|||||||
res = self.rma_supplier_id.rma_line_ids.action_view_in_shipments()
|
res = self.rma_supplier_id.rma_line_ids.action_view_in_shipments()
|
||||||
self.assertTrue("res_id" in res, "Incorrect number of pickings" "created")
|
self.assertTrue("res_id" in res, "Incorrect number of pickings" "created")
|
||||||
pickings = self.env["stock.picking"].browse(res["res_id"])
|
pickings = self.env["stock.picking"].browse(res["res_id"])
|
||||||
self.assertEquals(len(pickings), 1, "Incorrect number of pickings created")
|
self.assertEqual(len(pickings), 1, "Incorrect number of pickings created")
|
||||||
picking_in = pickings[0]
|
picking_in = pickings[0]
|
||||||
moves = picking_in.move_lines
|
moves = picking_in.move_lines
|
||||||
self.assertEquals(len(moves), 3, "Incorrect number of moves created")
|
self.assertEqual(len(moves), 3, "Incorrect number of moves created")
|
||||||
|
|
||||||
lines = self.rma_supplier_id.rma_line_ids
|
lines = self.rma_supplier_id.rma_line_ids
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_to_deliver"))), [0], "qty_to_deliver"
|
list(set(lines.mapped("qty_to_deliver"))), [0], "qty_to_deliver"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -747,14 +743,14 @@ class TestRma(common.SavepointCase):
|
|||||||
picking_in.action_assign()
|
picking_in.action_assign()
|
||||||
for mv in picking_in.move_line_ids:
|
for mv in picking_in.move_line_ids:
|
||||||
mv.qty_done = mv.product_uom_qty
|
mv.qty_done = mv.product_uom_qty
|
||||||
picking_in.action_done()
|
picking_in._action_done()
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_outgoing"))), [0], "Wrong qty_outgoing"
|
list(set(lines.mapped("qty_outgoing"))), [0], "Wrong qty_outgoing"
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_incoming"))), [0], "Wrong qty_incoming"
|
list(set(lines.mapped("qty_incoming"))), [0], "Wrong qty_incoming"
|
||||||
)
|
)
|
||||||
self.assertEquals(
|
self.assertEqual(
|
||||||
list(set(lines.mapped("qty_to_deliver"))), [0], "qty_to_deliver"
|
list(set(lines.mapped("qty_to_deliver"))), [0], "qty_to_deliver"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -791,4 +787,4 @@ class TestRma(common.SavepointCase):
|
|||||||
)
|
)
|
||||||
for line in self.rma_supplier_id.rma_line_ids:
|
for line in self.rma_supplier_id.rma_line_ids:
|
||||||
line.action_rma_done()
|
line.action_rma_done()
|
||||||
self.assertEquals(line.mapped("state"), ["done"], "Wrong State")
|
self.assertEqual(line.mapped("state"), ["done"], "Wrong State")
|
||||||
|
|||||||
@@ -6,17 +6,10 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Select Move">
|
<form string="Select Move">
|
||||||
<group>
|
<group>
|
||||||
<field
|
<field name="partner_id" string="Customer" />
|
||||||
name="partner_id"
|
|
||||||
domain="[('customer','=',True)]"
|
|
||||||
string="Customer"
|
|
||||||
/>
|
|
||||||
</group>
|
</group>
|
||||||
<separator string="Select Stock Moves to add" />
|
<separator string="Select Stock Moves to add" />
|
||||||
<field
|
<field name="move_ids">
|
||||||
name="move_ids"
|
|
||||||
domain="[('picking_id.partner_id', '=', partner_id), ('location_dest_id.usage', '=', 'customer')]"
|
|
||||||
>
|
|
||||||
<tree>
|
<tree>
|
||||||
<field name="product_id" />
|
<field name="product_id" />
|
||||||
<field name="product_uom_qty" />
|
<field name="product_uom_qty" />
|
||||||
@@ -36,7 +29,6 @@
|
|||||||
/>
|
/>
|
||||||
<field name="create_date" groups="base.group_no_one" />
|
<field name="create_date" groups="base.group_no_one" />
|
||||||
<field name="date" string="Date" groups="base.group_no_one" />
|
<field name="date" string="Date" groups="base.group_no_one" />
|
||||||
<field name="date_expected" string="Date Expected" />
|
|
||||||
<field name="state" />
|
<field name="state" />
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
@@ -91,17 +83,10 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Select Move">
|
<form string="Select Move">
|
||||||
<group>
|
<group>
|
||||||
<field
|
<field name="partner_id" string="Supplier" />
|
||||||
name="partner_id"
|
|
||||||
domain="[('supplier','=',True)]"
|
|
||||||
string="Supplier"
|
|
||||||
/>
|
|
||||||
</group>
|
</group>
|
||||||
<separator string="Select Stock Moves to add" />
|
<separator string="Select Stock Moves to add" />
|
||||||
<field
|
<field name="move_ids" />
|
||||||
name="move_ids"
|
|
||||||
domain="[('picking_id.partner_id', '=', partner_id), ('location_id.usage', '=', 'supplier')]"
|
|
||||||
/>
|
|
||||||
<footer>
|
<footer>
|
||||||
<button
|
<button
|
||||||
string="Confirm"
|
string="Confirm"
|
||||||
|
|||||||
Reference in New Issue
Block a user