Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[14.0][FIX+FIX+FIX+FIX] rma + account_move_line_rma_order_line + rma_put_away + rma_scrap: fix data values #1

Open
wants to merge 4 commits into
base: 14.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from odoo import SUPERUSER_ID, api

from odoo.addons.account_move_line_rma_order_line import post_init_hook
from ... import post_init_hook

_logger = logging.getLogger(__name__)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def setUpClass(cls):
cls.group_account_invoice = cls.env.ref("account.group_account_invoice")
cls.group_account_manager = cls.env.ref("account.group_account_manager")
cls.stock_location = cls.env.ref("stock.stock_location_stock")
wh = cls.env.ref("stock.warehouse0")
wh = cls.env.ref("rma.warehouse_rma")
cls.stock_rma_location = wh.lot_rma_id
cls.customer_location = cls.env.ref("stock.stock_location_customers")
cls.supplier_location = cls.env.ref("stock.stock_location_suppliers")
Expand Down
20 changes: 14 additions & 6 deletions rma/data/stock_data.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
<?xml version="1.0" ?>
<odoo noupdate="1">
<record id="stock_location_stock_rma" model="stock.location">
<field name="name">RMA</field>
<field name="location_id" ref="stock.stock_location_locations" />
<field name="usage">view</field>
</record>

<record id="location_rma" model="stock.location">
<field name="name">WH RMA</field>
<field name="usage">internal</field>
<field name="location_id" ref="stock.stock_location_stock" />
<field name="location_id" ref="rma.stock_location_stock_rma" />
</record>

<record id="seq_picking_type_rma_cust_out" model="ir.sequence">
Expand Down Expand Up @@ -101,7 +107,9 @@
<field name="code">incoming</field>
</record>

<record id="stock.warehouse0" model="stock.warehouse">
<record id="warehouse_rma" model="stock.warehouse">
<field name="name">Warehouse RMA</field>
<field name="code">WHRMA</field>
<field name="lot_rma_id" ref="location_rma" />
<field name="rma_cust_out_type_id" ref="picking_type_rma_cust_out" />
<field name="rma_cust_in_type_id" ref="picking_type_rma_cust_in" />
Expand Down Expand Up @@ -142,7 +150,7 @@
<record id="rule_rma_customer_in_pull" model="stock.rule">
<field name="name">Customer → RMA</field>
<field name="action">pull</field>
<field name="warehouse_id" ref="stock.warehouse0" />
<field name="warehouse_id" ref="rma.warehouse_rma" />
<field name="location_src_id" ref="stock.stock_location_customers" />
<field name="location_id" ref="rma.location_rma" />
<field name="procure_method">make_to_stock</field>
Expand All @@ -153,7 +161,7 @@
<record id="rule_rma_customer_out_pull" model="stock.rule">
<field name="name">RMA → Customer</field>
<field name="action">pull</field>
<field name="warehouse_id" ref="stock.warehouse0" />
<field name="warehouse_id" ref="rma.warehouse_rma" />
<field name="location_src_id" ref="rma.location_rma" />
<field name="location_id" ref="stock.stock_location_customers" />
<field name="procure_method">make_to_stock</field>
Expand All @@ -164,7 +172,7 @@
<record id="rule_rma_supplier_out_pull" model="stock.rule">
<field name="name">RMA → Supplier</field>
<field name="action">pull</field>
<field name="warehouse_id" ref="stock.warehouse0" />
<field name="warehouse_id" ref="rma.warehouse_rma" />
<field name="location_id" ref="stock.stock_location_suppliers" />
<field name="location_src_id" ref="rma.location_rma" />
<field name="procure_method">make_to_stock</field>
Expand All @@ -175,7 +183,7 @@
<record id="rule_rma_supplier_in_pull" model="stock.rule">
<field name="name">Supplier → RMA</field>
<field name="action">pull</field>
<field name="warehouse_id" ref="stock.warehouse0" />
<field name="warehouse_id" ref="rma.warehouse_rma" />
<field name="location_id" ref="rma.location_rma" />
<field name="location_src_id" ref="stock.stock_location_suppliers" />
<field name="procure_method">make_to_stock</field>
Expand Down
8 changes: 4 additions & 4 deletions rma/demo/stock_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@
<record id="rule_rma_dropship_return" model="stock.rule">
<field name="name">Customer → Supplier</field>
<field name="action">pull</field>
<field name="warehouse_id" ref="stock.warehouse0" />
<field name="warehouse_id" ref="rma.warehouse_rma" />
<field name="location_id" ref="stock.stock_location_suppliers" />
<field name="location_src_id" ref="stock.stock_location_customers" />
<field name="procure_method">make_to_stock</field>
Expand All @@ -99,16 +99,16 @@
<record id="rule_rma_dropship" model="stock.rule">
<field name="name">Supplier → Customer</field>
<field name="action">pull</field>
<field name="warehouse_id" ref="stock.warehouse0" />
<field name="warehouse_id" ref="rma.warehouse_rma" />
<field name="location_id" ref="stock.stock_location_customers" />
<field name="location_src_id" ref="stock.stock_location_suppliers" />
<field name="procure_method">make_to_stock</field>
<field name="route_id" ref="rma.route_rma_dropship" />
<field name="picking_type_id" ref="rma.picking_type_rma_dropship" />
</record>

<!-- Enable the RMA in warehouse0 -->
<record id="stock.warehouse0" model="stock.warehouse">
<!-- Enable the RMA in warehouse -->
<record id="warehouse_rma" model="stock.warehouse">
<field name="rma_in_this_wh" eval="True" />
</record>

Expand Down
4 changes: 2 additions & 2 deletions rma/tests/test_rma.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def setUpClass(cls):

cls.partner_id = cls.env.ref("base.res_partner_2")
cls.stock_location = cls.env.ref("stock.stock_location_stock")
cls.wh = cls.env.ref("stock.warehouse0")
cls.wh = cls.env.ref("rma.warehouse_rma")
cls.stock_rma_location = cls.wh.lot_rma_id
cls.customer_location = cls.env.ref("stock.stock_location_customers")
cls.supplier_location = cls.env.ref("stock.stock_location_suppliers")
Expand Down Expand Up @@ -1039,7 +1039,7 @@ def test_06_warehouse_mismatch(self):
"code": "SHP",
}
)
wh2.resupply_wh_ids = self.env.ref("stock.warehouse0")
wh2.resupply_wh_ids = self.env.ref("rma.warehouse_rma")
wh2.rma_in_this_wh = True
wh2.lot_rma_id = self.env["stock.location"].create(
{
Expand Down
2 changes: 1 addition & 1 deletion rma_put_away/tests/test_rma_put_away.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def setUpClass(cls):
"company_id": cls.env.ref("base.main_company").id,
}
)
cls.wh = cls.env.ref("stock.warehouse0")
cls.wh = cls.env.ref("rma.warehouse_rma")
cls.stock_rma_location = cls.wh.lot_rma_id
cls.put_away_loc = cls.env["stock.location"].create(
{
Expand Down
2 changes: 1 addition & 1 deletion rma_scrap/tests/test_rma_scrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def setUpClass(cls):
"company_id": cls.env.ref("base.main_company").id,
}
)
cls.wh = cls.env.ref("stock.warehouse0")
cls.wh = cls.env.ref("rma.warehouse_rma")
cls.stock_rma_location = cls.wh.lot_rma_id
cls.scrap_loc = cls.env["stock.location"].create(
{
Expand Down