mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[MIG] rma: Migration to 15.0
This commit is contained in:
committed by
JasminSForgeFlow
parent
69ab731eec
commit
99bd47ccf9
@@ -3,11 +3,10 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
"name": "RMA (Return Merchandise Authorization)",
|
"name": "RMA (Return Merchandise Authorization)",
|
||||||
"version": "14.0.1.0.0",
|
"version": "15.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/ForgeFlow/stock-rma",
|
"website": "https://github.com/ForgeFlow/stock-rma",
|
||||||
"depends": ["stock", "mail", "web"],
|
"depends": ["stock", "mail", "web"],
|
||||||
|
|||||||
@@ -266,29 +266,20 @@ class RmaOrder(models.Model):
|
|||||||
@api.onchange("in_warehouse_id")
|
@api.onchange("in_warehouse_id")
|
||||||
def _onchange_in_warehouse_id(self):
|
def _onchange_in_warehouse_id(self):
|
||||||
if self.in_warehouse_id and self.rma_line_ids:
|
if self.in_warehouse_id and self.rma_line_ids:
|
||||||
self.rma_line_ids.write(
|
for rma_line in self.rma_line_ids:
|
||||||
{
|
rma_line.in_warehouse_id = self.in_warehouse_id.id
|
||||||
"in_warehouse_id": self.in_warehouse_id.id,
|
rma_line.location_id = self.in_warehouse_id.lot_rma_id.id
|
||||||
"location_id": self.in_warehouse_id.lot_rma_id.id,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
@api.onchange("customer_to_supplier", "supplier_address_id")
|
@api.onchange("customer_to_supplier", "supplier_address_id")
|
||||||
def _onchange_customer_to_supplier(self):
|
def _onchange_customer_to_supplier(self):
|
||||||
if self.type == "customer" and self.rma_line_ids:
|
if self.type == "customer" and self.rma_line_ids:
|
||||||
self.rma_line_ids.write(
|
for rma_line in self.rma_line_ids:
|
||||||
{
|
rma_line.customer_to_supplier = self.customer_to_supplier
|
||||||
"customer_to_supplier": self.customer_to_supplier,
|
rma_line.supplier_address_id = self.supplier_address_id.id
|
||||||
"supplier_address_id": self.supplier_address_id.id,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|
||||||
@api.onchange("supplier_to_customer", "customer_address_id")
|
@api.onchange("supplier_to_customer", "customer_address_id")
|
||||||
def _onchange_supplier_to_customer(self):
|
def _onchange_supplier_to_customer(self):
|
||||||
if self.type == "supplier" and self.rma_line_ids:
|
if self.type == "supplier" and self.rma_line_ids:
|
||||||
self.rma_line_ids.write(
|
for rma_line in self.rma_line_ids:
|
||||||
{
|
rma_line.supplier_to_customer = self.supplier_to_customer
|
||||||
"supplier_to_customer": self.supplier_to_customer,
|
rma_line.customer_address_id = self.customer_address_id.id
|
||||||
"customer_address_id": self.customer_address_id.id,
|
|
||||||
}
|
|
||||||
)
|
|
||||||
|
|||||||
@@ -1,21 +1,25 @@
|
|||||||
<?xml version="1.0" encoding="utf-8" ?>
|
<?xml version="1.0" encoding="utf-8" ?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data>
|
<data>
|
||||||
<report
|
<record id="rma_order_line_report" model="ir.actions.report">
|
||||||
id="rma_order_line_report"
|
<field name="name">RMA</field>
|
||||||
string="RMA"
|
<field name="model">rma.order.line</field>
|
||||||
model="rma.order.line"
|
<field name="report_type">qweb-pdf</field>
|
||||||
report_type="qweb-pdf"
|
<field name="report_name">rma.report_rma_order_line</field>
|
||||||
file="rma.report_rma_order_line"
|
<field name="report_file">rma.report_rma_order_line</field>
|
||||||
name="rma.report_rma_order_line"
|
<field name="print_report_name">('RMA - %s' % (object.name))</field>
|
||||||
/>
|
<field name="binding_model_id" ref="model_rma_order_line" />
|
||||||
<report
|
<field name="binding_type">report</field>
|
||||||
id="rma_order_report"
|
</record>
|
||||||
string="RMA Group"
|
<record id="rma_order_report" model="ir.actions.report">
|
||||||
model="rma.order"
|
<field name="name">RMA Group</field>
|
||||||
report_type="qweb-pdf"
|
<field name="model">rma.order</field>
|
||||||
file="rma.report_rma_order"
|
<field name="report_type">qweb-pdf</field>
|
||||||
name="rma.report_rma_order"
|
<field name="report_name">rma.report_rma_order</field>
|
||||||
/>
|
<field name="report_file">rma.report_rma_order</field>
|
||||||
|
<field name="print_report_name">('RMA Group - %s' % (object.name))</field>
|
||||||
|
<field name="binding_model_id" ref="model_rma_order" />
|
||||||
|
<field name="binding_type">report</field>
|
||||||
|
</record>
|
||||||
</data>
|
</data>
|
||||||
</odoo>
|
</odoo>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ from odoo.exceptions import ValidationError
|
|||||||
from odoo.tests import common
|
from odoo.tests import common
|
||||||
|
|
||||||
|
|
||||||
class TestRma(common.SavepointCase):
|
class TestRma(common.TransactionCase):
|
||||||
""" Test the routes and the quantities """
|
""" Test the routes and the quantities """
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@@ -245,7 +245,7 @@ class TestRma(common.SavepointCase):
|
|||||||
)
|
)
|
||||||
self.assertEqual(line.origin, line.reference_move_id.picking_id.name)
|
self.assertEqual(line.origin, line.reference_move_id.picking_id.name)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
line.delivery_address_id, line.reference_move_id.picking_partner_id
|
line.delivery_address_id, line.reference_move_id.picking_id.partner_id
|
||||||
)
|
)
|
||||||
self.assertEqual(
|
self.assertEqual(
|
||||||
line.qty_to_receive, line.reference_move_id.product_uom_qty
|
line.qty_to_receive, line.reference_move_id.product_uom_qty
|
||||||
|
|||||||
@@ -166,7 +166,7 @@ class RmaMakePicking(models.TransientModel):
|
|||||||
procurements.append(procurement)
|
procurements.append(procurement)
|
||||||
self.env["procurement.group"].run(procurements)
|
self.env["procurement.group"].run(procurements)
|
||||||
except UserError as error:
|
except UserError as error:
|
||||||
errors.append(error.name)
|
errors.append(error.args[0])
|
||||||
if errors:
|
if errors:
|
||||||
raise UserError("\n".join(errors))
|
raise UserError("\n".join(errors))
|
||||||
return procurements
|
return procurements
|
||||||
|
|||||||
Reference in New Issue
Block a user