[MIG] rma_sale: Migration to 16.0

This commit is contained in:
DavidJForgeFlow
2023-02-23 13:01:02 +01:00
committed by JasminSForgeFlow
parent 594b5e49ba
commit 8a758a67ff
6 changed files with 11 additions and 11 deletions

View File

@@ -3,7 +3,7 @@
{ {
"name": "RMA Sale", "name": "RMA Sale",
"version": "15.0.1.0.1", "version": "16.0.1.0.0",
"license": "LGPL-3", "license": "LGPL-3",
"category": "RMA", "category": "RMA",
"summary": "Links RMA with Sales Orders", "summary": "Links RMA with Sales Orders",

View File

@@ -201,7 +201,7 @@ class RmaOrderLine(models.Model):
return result return result
def action_view_origin_sale_order(self): 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] result = action.sudo().read()[0]
order_ids = self.sale_id.ids order_ids = self.sale_id.ids
result["domain"] = [("id", "in", order_ids)] result["domain"] = [("id", "in", order_ids)]

View File

@@ -40,7 +40,7 @@ class TestRmaStockAccountSale(TestRmaStockAccount):
) )
cls.so1.action_confirm() cls.so1.action_confirm()
for ml in cls.so1.picking_ids.move_line_ids: 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() cls.so1.picking_ids.button_validate()
def test_01_cost_from_so_move(self): def test_01_cost_from_so_move(self):
@@ -65,13 +65,13 @@ class TestRmaStockAccountSale(TestRmaStockAccount):
picking = self._receive_rma(rma_line) picking = self._receive_rma(rma_line)
# The price is not the standard price, is the value of the outgoing layer # The price is not the standard price, is the value of the outgoing layer
# of the SO # 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( so_move_value = self.so1.picking_ids.mapped(
"move_lines.stock_valuation_layer_ids" "move_ids.stock_valuation_layer_ids"
)[-1].value )[-1].value
self.assertEqual(rma_move_value, -so_move_value) self.assertEqual(rma_move_value, -so_move_value)
# Test the accounts used # 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( self.check_accounts_used(
account_move, debit_account="inventory", credit_account="gdni" account_move, debit_account="inventory", credit_account="gdni"
) )

View File

@@ -71,13 +71,13 @@
name="%(action_rma_order_line_make_sale_order)d" name="%(action_rma_order_line_make_sale_order)d"
string="Create Sales Quotation" string="Create Sales Quotation"
class="oe_highlight" 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" type="action"
/> />
<button <button
name="%(action_rma_order_line_make_sale_order)d" name="%(action_rma_order_line_make_sale_order)d"
string="Create Sales Quotation" 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" type="action"
/> />
</header> </header>

View File

@@ -46,7 +46,7 @@ class RmaAddSale(models.TransientModel):
compute="_compute_lot_domain", compute="_compute_lot_domain",
) )
lot_domain_ids = fields.Many2many( lot_domain_ids = fields.Many2many(
comodel_name="stock.production.lot", comodel_name="stock.lot",
string="Lots Domain", string="Lots Domain",
compute="_compute_lot_domain", compute="_compute_lot_domain",
) )
@@ -64,7 +64,7 @@ class RmaAddSale(models.TransientModel):
) )
rec.show_lot_filter = bool(rec.lot_domain_ids) 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): def select_all(self):
self.ensure_one() self.ensure_one()

View File

@@ -14,7 +14,7 @@
<group> <group>
<field <field
name="sale_order_id" name="sale_order_id"
domain="[('partner_id','=', partner_id)]" domain="[('partner_id','=', partner_id), ('state', '=', 'draft')]"
context="{'partner_id': partner_id}" context="{'partner_id': partner_id}"
/> />
</group> </group>