Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
1
Reply
1378
Views
I made a simple custom module to mimic:
class StockMove(models.Model):
_inherit = "stock.move"
auto_validate = fields.Boolean(
'Auto Validate',
old_name="openupgrade_legacy_8_0_auto_validate",
help="Also validate linked moves when this move is validated.",
copy=False,
)
def _action_done(self):
res = super()._action_done()
auto_validated_moves = res.\
mapped('move_dest_ids').\
filtered(lambda m: m.auto_validate and m.state == 'assigned')
for move in auto_validated_moves:
# Apply logic from addons/stock/wizard/stock_immediate_transfer.py
# and process every move lines
for move_line in move.move_line_ids:
move_line.qty_done = move_line.product_uom_qty
# Finally call action_done
if auto_validated_moves:
auto_validated_moves._action_done()
return res
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up
In OpenERP/Odoo 6.1 and 7.0, an
auto_validate
field was used by a move to automatically executeaction_done
on itsmove_dest_id
ifmove_dest_id.auto_validate
wasTrue
.Is there a way to do the same thing with Odoo 12.0 ?