[IMP] : black, isort

This commit is contained in:
ahenriquez
2020-01-14 16:36:03 +01:00
parent efd131b334
commit 1ae40ec4d3
19 changed files with 1508 additions and 1358 deletions

View File

@@ -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):