Public release from ruodoo-project: 19.0 - 2026-11-01 22:52:25 UTC
This commit is contained in:
24
directive_common/models/stock_picking.py
Normal file
24
directive_common/models/stock_picking.py
Normal file
@@ -0,0 +1,24 @@
|
||||
from odoo import models
|
||||
|
||||
|
||||
class StockPicking(models.Model):
|
||||
_name = 'stock.picking'
|
||||
_inherit = ["stock.picking", "directive.mixin"]
|
||||
|
||||
def button_validate(self):
|
||||
res = super().button_validate()
|
||||
# Сохраняем семантику старого monkey-patch wrapper: политика срабатывала
|
||||
# ТОЛЬКО если метод не вернул False, и НЕ должна срабатывать на промежуточном
|
||||
# возврате экшена-визарда (backorder / immediate transfer), т.к. в этот момент
|
||||
# перемещение ещё не проведено.
|
||||
if res is not False and not (isinstance(res, dict) and res.get("type") == "ir.actions.act_window"):
|
||||
self._directive_run_callback_policies("button_validate")
|
||||
return res
|
||||
|
||||
def action_agv_callback(self, payload: dict):
|
||||
for picking in self:
|
||||
picking.message_post(
|
||||
body="AGV Unit 01: Доставка в зону производства выполнена.<br/>"
|
||||
"Батарея: 84%."
|
||||
)
|
||||
return True
|
||||
Reference in New Issue
Block a user