mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[MIG] rma_purchase: Migration to 16.0
This commit is contained in:
committed by
JasminSForgeFlow
parent
550c245ece
commit
51f302dac3
@@ -2,7 +2,7 @@
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
{
|
||||
"name": "RMA Purchase",
|
||||
"version": "15.0.1.0.1",
|
||||
"version": "16.0.1.0.0",
|
||||
"category": "RMA",
|
||||
"summary": "RMA from PO",
|
||||
"license": "LGPL-3",
|
||||
|
||||
@@ -24,6 +24,7 @@ class RmaOrderLine(models.Model):
|
||||
purchase_list.append(line.id)
|
||||
rec.purchase_order_line_ids = [(6, 0, purchase_list)]
|
||||
|
||||
@api.depends("operation_id", "purchase_policy")
|
||||
def _compute_qty_purchase(self):
|
||||
for rec in self:
|
||||
rec.qty_purchased = rec._get_rma_purchased_qty()
|
||||
|
||||
@@ -57,13 +57,15 @@ class TestRmaStockAccountPurchase(TestRmaStockAccount):
|
||||
picking = self._deliver_rma(rma_line)
|
||||
# The price is not the standard price, is the value of the incoming layer
|
||||
# of the PO
|
||||
rma_move_value = picking.move_lines.stock_valuation_layer_ids.value
|
||||
po_move_value = po.picking_ids.mapped("move_lines.stock_valuation_layer_ids")[
|
||||
-1
|
||||
].value
|
||||
rma_move_value = picking.move_line_ids.move_id.stock_valuation_layer_ids.value
|
||||
po_move_value = po.picking_ids.mapped(
|
||||
"move_line_ids.move_id.stock_valuation_layer_ids"
|
||||
)[-1].value
|
||||
self.assertEqual(-rma_move_value, po_move_value)
|
||||
# Test the accounts used
|
||||
account_move = picking.move_lines.stock_valuation_layer_ids.account_move_id
|
||||
account_move = (
|
||||
picking.move_line_ids.move_id.stock_valuation_layer_ids.account_move_id
|
||||
)
|
||||
self.check_accounts_used(account_move, "grni", "inventory")
|
||||
# Now forcing a refund to check the stock journals
|
||||
rma_line.refund_policy = "ordered"
|
||||
|
||||
@@ -37,6 +37,7 @@
|
||||
class="oe_stat_button"
|
||||
icon="fa-shopping-cart"
|
||||
groups="purchase.group_purchase_user"
|
||||
attrs="{'invisible':[('purchase_count','=',0)]}"
|
||||
>
|
||||
<field
|
||||
name="purchase_count"
|
||||
@@ -56,7 +57,7 @@
|
||||
/>
|
||||
</group>
|
||||
<group name="quantities" position="inside">
|
||||
<group>
|
||||
<group attrs="{'invisible': [('purchase_policy', '=', 'no')]}">
|
||||
<field name="qty_to_purchase" />
|
||||
<field name="qty_purchased" />
|
||||
</group>
|
||||
|
||||
Reference in New Issue
Block a user