Public release from ruodoo-project: 19.0 - 2026-07-26 21:17:35 UTC

This commit is contained in:
CI Publish Bot
2026-07-26 21:17:45 +00:00
commit 4f7b594ec8
1335 changed files with 191620 additions and 0 deletions

View File

@ -0,0 +1,32 @@
from odoo import models, fields
class AccountMove(models.Model):
_name = "account.move"
_inherit = ["account.move", "directive.mixin"]
def _directive_generation_spec(self):
return [
{
"event": "on_write",
"key": "am_audit_trigger",
"field": "state",
"from": "draft",
"to": "posted",
"use_record_template_group": True,
"mode": "create_once",
# Генерируем только для входящих инвойсов от поставщиков
"domain": [("move_type", "=", "in_invoice")],
}
]
def action_audit_response(self, payload: dict):
"""
Вызывается агентом-аудитором.
"""
for move in self:
move.message_post(
body=f"Audit Bot: Обнаружен риск, 30/100."
f"Директива #{payload.get('directive_id')} завершена с предупреждением."
)