mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[FIX]some code only valid for v9 was added when cherry-picking
This commit is contained in:
@@ -13,19 +13,20 @@ class ProcurementOrder(models.Model):
|
||||
ondelete="set null",
|
||||
)
|
||||
|
||||
@api.model
|
||||
@api.multi
|
||||
def _get_stock_move_values(self):
|
||||
res = super(ProcurementOrder, self)._get_stock_move_values()
|
||||
if self.rma_line_id:
|
||||
line = self.rma_line_id
|
||||
res['rma_line_id'] = line.id
|
||||
# Propagate partner_dest_id for proper drop-shipment reports.
|
||||
if procurement.partner_dest_id:
|
||||
res['partner_id'] = procurement.partner_dest_id.id
|
||||
dest_loc = self.env["stock.location"].browse([
|
||||
res["location_dest_id"]])[0]
|
||||
if dest_loc.usage == "internal":
|
||||
res["price_unit"] = line.price_unit
|
||||
for procurement in self:
|
||||
if self.rma_line_id:
|
||||
line = self.rma_line_id
|
||||
res['rma_line_id'] = line.id
|
||||
# Propagate partner_dest_id for proper drop-shipment reports.
|
||||
if procurement.partner_dest_id:
|
||||
res['partner_id'] = procurement.partner_dest_id.id
|
||||
dest_loc = self.env["stock.location"].browse([
|
||||
res["location_dest_id"]])[0]
|
||||
if dest_loc.usage == "internal":
|
||||
res["price_unit"] = line.price_unit
|
||||
return res
|
||||
|
||||
|
||||
|
||||
@@ -72,9 +72,8 @@ class RmaOrderLine(models.Model):
|
||||
for move in rec.move_ids.filtered(
|
||||
lambda m: m.state in states and op(m.location_id.usage,
|
||||
rec.type)):
|
||||
qty += product_obj._compute_qty_obj(
|
||||
move.product_uom, move.product_uom_qty,
|
||||
rec.uom_id)
|
||||
qty += product_obj._compute_quantity(
|
||||
move.product_uom_qty, rec.uom_id)
|
||||
return qty
|
||||
|
||||
@api.multi
|
||||
@@ -636,7 +635,7 @@ class RmaOrderLine(models.Model):
|
||||
res = self.env.ref('rma.view_rma_line_form', False)
|
||||
result = action.read()[0]
|
||||
# choose the view_mode accordingly
|
||||
if len(rma_lines) != 1:
|
||||
if rma_lines and len(rma_lines) != 1:
|
||||
result['domain'] = rma_lines.ids
|
||||
elif len(rma_lines) == 1:
|
||||
result['views'] = [(res and res.id or False, 'form')]
|
||||
|
||||
@@ -148,23 +148,21 @@
|
||||
</page>
|
||||
<page name="route" string="Routes">
|
||||
<group>
|
||||
<group>
|
||||
<group name="inbound" string="Inbound">
|
||||
<field name="in_warehouse_id"/>
|
||||
<field name="location_id"
|
||||
domain="[('usage', '=', 'internal')]"/>
|
||||
<field name="in_route_id" groups="stock.group_adv_location"/>
|
||||
</group>
|
||||
<group name="outbound" string="Outbound">
|
||||
<field name="out_warehouse_id"/>
|
||||
<field name="delivery_address_id"
|
||||
groups='rma.group_rma_delivery_invoice_address'/>
|
||||
<field name="out_route_id" groups="stock.group_adv_location"/>
|
||||
<field name="supplier_to_customer"/>
|
||||
<field name="customer_address_id"
|
||||
attrs="{'required':[('supplier_to_customer', '=', True)],
|
||||
'invisible':[('supplier_to_customer', '=', False)]}"/>
|
||||
</group>
|
||||
<group name="inbound" string="Inbound">
|
||||
<field name="in_warehouse_id"/>
|
||||
<field name="location_id"
|
||||
domain="[('usage', '=', 'internal')]"/>
|
||||
<field name="in_route_id" groups="stock.group_adv_location"/>
|
||||
</group>
|
||||
<group name="outbound" string="Outbound">
|
||||
<field name="out_warehouse_id"/>
|
||||
<field name="delivery_address_id"
|
||||
groups='rma.group_rma_delivery_invoice_address'/>
|
||||
<field name="out_route_id" groups="stock.group_adv_location"/>
|
||||
<field name="supplier_to_customer"/>
|
||||
<field name="customer_address_id"
|
||||
attrs="{'required':[('supplier_to_customer', '=', True)],
|
||||
'invisible':[('supplier_to_customer', '=', False)]}"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
@@ -317,48 +315,42 @@
|
||||
</group>
|
||||
<notebook>
|
||||
<page name="route" string="Routes">
|
||||
<group>
|
||||
<group>
|
||||
<group name="inbound" string="Inbound">
|
||||
<field name="in_warehouse_id"/>
|
||||
<field name="location_id"
|
||||
domain="[('usage', '=', 'internal')]"/>
|
||||
<field name="in_route_id" groups="stock.group_adv_location"/>
|
||||
<field name="customer_to_supplier"/>
|
||||
<field name="supplier_address_id"
|
||||
attrs="{'required':[('customer_to_supplier', '=', True)],
|
||||
'invisible':[('customer_to_supplier', '=', False)]}"/>
|
||||
</group>
|
||||
<group name="outbound" string="Outbound">
|
||||
<field name="out_warehouse_id"/>
|
||||
<field name="delivery_address_id"
|
||||
groups='rma.group_rma_delivery_invoice_address'/>
|
||||
<field name="out_route_id" groups="stock.group_adv_location"/>
|
||||
</group>
|
||||
</group>
|
||||
<group name="inbound" string="Inbound">
|
||||
<field name="in_warehouse_id"/>
|
||||
<field name="location_id"
|
||||
domain="[('usage', '=', 'internal')]"/>
|
||||
<field name="in_route_id" groups="stock.group_adv_location"/>
|
||||
<field name="customer_to_supplier"/>
|
||||
<field name="supplier_address_id"
|
||||
attrs="{'required':[('customer_to_supplier', '=', True)],
|
||||
'invisible':[('customer_to_supplier', '=', False)]}"/>
|
||||
</group>
|
||||
<group name="outbound" string="Outbound">
|
||||
<field name="out_warehouse_id"/>
|
||||
<field name="delivery_address_id"
|
||||
groups='rma.group_rma_delivery_invoice_address'/>
|
||||
<field name="out_route_id" groups="stock.group_adv_location"/>
|
||||
</group>
|
||||
</page>
|
||||
<page name="stock" string="Stock Moves">
|
||||
<field name="move_ids" nolabel="1" readonly="1"/>
|
||||
</page>
|
||||
<page name="quantities" string="Quantities">
|
||||
<group>
|
||||
<group name="quantities" col="4" string="Quantities">
|
||||
<group name="receive">
|
||||
<field name="qty_to_receive"/>
|
||||
<field name="qty_incoming"/>
|
||||
<field name="qty_received"/>
|
||||
</group>
|
||||
<group name="deliver">
|
||||
<field name="qty_to_deliver"/>
|
||||
<field name="qty_outgoing"/>
|
||||
<field name="qty_delivered"/>
|
||||
</group>
|
||||
<group name="supplier_rma"
|
||||
attrs="{'invisible':[('customer_to_supplier','=',False)]}">
|
||||
<field name="qty_to_supplier_rma"/>
|
||||
<field name="qty_in_supplier_rma"/>
|
||||
</group>
|
||||
<group name="quantities" col="4" string="Quantities">
|
||||
<group name="receive">
|
||||
<field name="qty_to_receive"/>
|
||||
<field name="qty_incoming"/>
|
||||
<field name="qty_received"/>
|
||||
</group>
|
||||
<group name="deliver">
|
||||
<field name="qty_to_deliver"/>
|
||||
<field name="qty_outgoing"/>
|
||||
<field name="qty_delivered"/>
|
||||
</group>
|
||||
<group name="supplier_rma"
|
||||
attrs="{'invisible':[('customer_to_supplier','=',False)]}">
|
||||
<field name="qty_to_supplier_rma"/>
|
||||
<field name="qty_in_supplier_rma"/>
|
||||
</group>
|
||||
</group>
|
||||
</page>
|
||||
|
||||
Reference in New Issue
Block a user