mirror of
https://github.com/ForgeFlow/stock-rma.git
synced 2025-01-21 12:57:49 +02:00
[IMP] : black, isort
This commit is contained in:
@@ -15,8 +15,11 @@ class StockPicking(models.Model):
|
||||
res = super(StockPicking, self).action_assign()
|
||||
for picking in self:
|
||||
for move in picking.move_lines:
|
||||
if (move.rma_line_id and move.state == 'confirmed' and
|
||||
move.location_id.usage == 'customer'):
|
||||
if (
|
||||
move.rma_line_id
|
||||
and move.state == "confirmed"
|
||||
and move.location_id.usage == "customer"
|
||||
):
|
||||
move.force_assign()
|
||||
return res
|
||||
|
||||
@@ -24,15 +27,16 @@ class StockPicking(models.Model):
|
||||
class StockMove(models.Model):
|
||||
_inherit = "stock.move"
|
||||
|
||||
rma_line_id = fields.Many2one('rma.order.line', string='RMA line',
|
||||
ondelete='restrict')
|
||||
rma_line_id = fields.Many2one(
|
||||
"rma.order.line", string="RMA line", ondelete="restrict"
|
||||
)
|
||||
|
||||
@api.model
|
||||
def create(self, vals):
|
||||
if vals.get('group_id'):
|
||||
group = self.env['procurement.group'].browse(vals['group_id'])
|
||||
if vals.get("group_id"):
|
||||
group = self.env["procurement.group"].browse(vals["group_id"])
|
||||
if group.rma_line_id:
|
||||
vals['rma_line_id'] = group.rma_line_id.id
|
||||
vals["rma_line_id"] = group.rma_line_id.id
|
||||
return super(StockMove, self).create(vals)
|
||||
|
||||
def _action_assign(self):
|
||||
|
||||
Reference in New Issue
Block a user