mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[14.0][ADD] rma_delivery
This commit is contained in:
20
rma_delivery/wizard/rma_make_picking.py
Normal file
20
rma_delivery/wizard/rma_make_picking.py
Normal file
@@ -0,0 +1,20 @@
|
||||
# Copyright (C) 2022 ForgeFlow S.L.
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html)
|
||||
|
||||
from odoo import models
|
||||
|
||||
|
||||
class RmaMakePicking(models.TransientModel):
|
||||
|
||||
_inherit = "rma_make_picking.wizard"
|
||||
|
||||
def _create_picking(self):
|
||||
res = super()._create_picking()
|
||||
for line in self.mapped("item_ids.line_id").filtered(
|
||||
lambda x: x.operation_id.default_carrier_id
|
||||
):
|
||||
pickings = line._get_out_pickings().filtered(
|
||||
lambda x: x.location_dest_id.usage == "customer" and not x.carrier_id
|
||||
)
|
||||
pickings.write({"carrier_id": line.operation_id.default_carrier_id.id})
|
||||
return res
|
||||
Reference in New Issue
Block a user