mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[MIG] rma_sale: Migration to 16.0
This commit is contained in:
committed by
JasminSForgeFlow
parent
594b5e49ba
commit
8a758a67ff
@@ -3,7 +3,7 @@
|
||||
|
||||
{
|
||||
"name": "RMA Sale",
|
||||
"version": "15.0.1.0.1",
|
||||
"version": "16.0.1.0.0",
|
||||
"license": "LGPL-3",
|
||||
"category": "RMA",
|
||||
"summary": "Links RMA with Sales Orders",
|
||||
|
||||
@@ -201,7 +201,7 @@ class RmaOrderLine(models.Model):
|
||||
return result
|
||||
|
||||
def action_view_origin_sale_order(self):
|
||||
action = self.env.ref("sale.action_orders_salesteams")
|
||||
action = self.env.ref("sale.action_orders")
|
||||
result = action.sudo().read()[0]
|
||||
order_ids = self.sale_id.ids
|
||||
result["domain"] = [("id", "in", order_ids)]
|
||||
|
||||
@@ -40,7 +40,7 @@ class TestRmaStockAccountSale(TestRmaStockAccount):
|
||||
)
|
||||
cls.so1.action_confirm()
|
||||
for ml in cls.so1.picking_ids.move_line_ids:
|
||||
ml.qty_done = ml.product_uom_qty
|
||||
ml.qty_done = ml.reserved_uom_qty
|
||||
cls.so1.picking_ids.button_validate()
|
||||
|
||||
def test_01_cost_from_so_move(self):
|
||||
@@ -65,13 +65,13 @@ class TestRmaStockAccountSale(TestRmaStockAccount):
|
||||
picking = self._receive_rma(rma_line)
|
||||
# The price is not the standard price, is the value of the outgoing layer
|
||||
# of the SO
|
||||
rma_move_value = picking.move_lines.stock_valuation_layer_ids.value
|
||||
rma_move_value = picking.move_ids.stock_valuation_layer_ids.value
|
||||
so_move_value = self.so1.picking_ids.mapped(
|
||||
"move_lines.stock_valuation_layer_ids"
|
||||
"move_ids.stock_valuation_layer_ids"
|
||||
)[-1].value
|
||||
self.assertEqual(rma_move_value, -so_move_value)
|
||||
# Test the accounts used
|
||||
account_move = picking.move_lines.stock_valuation_layer_ids.account_move_id
|
||||
account_move = picking.move_ids.stock_valuation_layer_ids.account_move_id
|
||||
self.check_accounts_used(
|
||||
account_move, debit_account="inventory", credit_account="gdni"
|
||||
)
|
||||
|
||||
@@ -71,13 +71,13 @@
|
||||
name="%(action_rma_order_line_make_sale_order)d"
|
||||
string="Create Sales Quotation"
|
||||
class="oe_highlight"
|
||||
attrs="{'invisible':['|', '|', ('qty_to_sell', '=', 0), ('state', '!=', 'approved'), ('sale_policy', '=', 'no')]}"
|
||||
attrs="{'invisible':['|', '|', '|', ('qty_to_sell', '=', 0), ('qty_to_sell', '<', 0), ('state', '!=', 'approved'), ('sale_policy', '=', 'no')]}"
|
||||
type="action"
|
||||
/>
|
||||
<button
|
||||
name="%(action_rma_order_line_make_sale_order)d"
|
||||
string="Create Sales Quotation"
|
||||
attrs="{'invisible':['|', '|', ('qty_to_sell', '!=', 0), ('state', '!=', 'approved'), ('sale_policy', '=', 'no')]}"
|
||||
attrs="{'invisible':['|', '|', ('qty_to_sell', '>', 0), ('state', '!=', 'approved'), ('sale_policy', '=', 'no')]}"
|
||||
type="action"
|
||||
/>
|
||||
</header>
|
||||
|
||||
@@ -46,7 +46,7 @@ class RmaAddSale(models.TransientModel):
|
||||
compute="_compute_lot_domain",
|
||||
)
|
||||
lot_domain_ids = fields.Many2many(
|
||||
comodel_name="stock.production.lot",
|
||||
comodel_name="stock.lot",
|
||||
string="Lots Domain",
|
||||
compute="_compute_lot_domain",
|
||||
)
|
||||
@@ -64,7 +64,7 @@ class RmaAddSale(models.TransientModel):
|
||||
)
|
||||
rec.show_lot_filter = bool(rec.lot_domain_ids)
|
||||
|
||||
lot_ids = fields.Many2many(comodel_name="stock.production.lot", string="Lots/Serials selected")
|
||||
lot_ids = fields.Many2many(comodel_name="stock.lot", string="Lots/Serials selected")
|
||||
|
||||
def select_all(self):
|
||||
self.ensure_one()
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
<group>
|
||||
<field
|
||||
name="sale_order_id"
|
||||
domain="[('partner_id','=', partner_id)]"
|
||||
domain="[('partner_id','=', partner_id), ('state', '=', 'draft')]"
|
||||
context="{'partner_id': partner_id}"
|
||||
/>
|
||||
</group>
|
||||
|
||||
Reference in New Issue
Block a user