Name: [ADD] viin_ai_approval(+account,+sale,+ops_brain): P-OPS-2 approval governance + AI advisory on human approvals

State: Killed

PR State: merged

PR Author: David Tran

PR Author Email:

PR: #47

Committer: David Tran

Committer Email: davidtran.hp@gmail.com

Commit: ddd4acdd1b181b46807162b439a6e065c95a65e8

Description:

                                            [REF] viin_ai_approval: advisory cron uses savepoint isolation, not manual commit

Replaces the dangerous manual self.env.cr.commit() in the advisory cron (and the
pylint disable that hid it) with the idiomatic Odoo pattern:
- The ir.cron row lock (FOR NO KEY UPDATE SKIP LOCKED, ir_cron.py) already
  prevents the cron from running concurrently with itself, so the manual 'claim'
  commit was never needed.
- Per-record isolation now uses 'with self.env.cr.savepoint()'; the ir.cron
  wrapper commits once on clean return (the pattern viin_account_auto_transfer /
  viin_zalo use). At-least-once retry on the next tick; no transaction breakage.
- Tests no longer patch cr.commit (that patch was a symptom of the bad design).
Also resolves R8180 without a disable: Concern A + Concern B are now one
viin.approval.request model class (one class per model per module), the two
concerns kept in clearly-marked sections; advisory_runner.py merged in + removed.
Fixed the SALE-6 fixture to map partner/currency/user (the OmniApproval origin
sync would otherwise null the sale.order partner_id). 36/36 tests pass; flake8 +
full pylint_odoo enable-list both exit 0 with NO disables.
                                            

Branch: 17.0

Instance ID: 0

Age:

Up-time: Not finished