from odoo import models, fields

class StockPicking(models.Model):
    _name = 'stock.picking'
    _inherit = ["stock.picking", "directive.mixin"]

    def _directive_generation_spec(self):
        return [
            {
                "event": "on_callback",
                "callback": "button_validate",
                "mode": "create_once",
                "when": "after",
                "if_result": True,
                "use_record_template_group": True,
                "key": "picking_done_check_finance",
            }
        ]

    def action_agv_callback(self, payload: dict):
        for picking in self:
            picking.message_post(
                body=f"AGV Unit 01: Доставка в зону производства выполнена."
                     f"Батарея: 84%."
            )
        return True