refactor(fusion_accounting): move AI module code into fusion_accounting_ai sub-module

git mv preserves history. fusion_accounting/ retains only __manifest__.py,
__init__.py, CLAUDE.md, and docs/ — the meta-module shell. All Python,
data, views, security, services, static, tests, wizards, report move to
fusion_accounting_ai/. Manifest data list updated; security.xml move to
_core deferred to Task 12.

Made-with: Cursor
This commit is contained in:
gsinghpal
2026-04-18 21:45:06 -04:00
parent b7483d5177
commit 6c72f2ab49
74 changed files with 76 additions and 60 deletions

View File

@@ -0,0 +1 @@
from . import rule_wizard

View File

@@ -0,0 +1,42 @@
from odoo import models, fields, api
class FusionRuleWizard(models.TransientModel):
_name = 'fusion.accounting.rule.wizard'
_description = 'Create Fusion Rule from AI Suggestion'
name = fields.Char(string='Rule Name', required=True)
rule_type = fields.Selection(
selection=[
('match', 'Match'), ('classify', 'Classify'),
('audit', 'Audit'), ('fee', 'Fee'),
('routing', 'Routing'), ('followup', 'Follow-Up'),
],
string='Type', required=True, default='match',
)
description = fields.Text(string='Description')
match_logic = fields.Text(string='Match Logic')
fee_account_id = fields.Many2one('account.account', string='Fee Account')
write_off_account_id = fields.Many2one('account.account', string='Write-Off Account')
journal_ids = fields.Many2many('account.journal', string='Journals')
def action_create_rule(self):
self.ensure_one()
rule = self.env['fusion.accounting.rule'].create({
'name': self.name,
'rule_type': self.rule_type,
'description': self.description,
'match_logic': self.match_logic,
'fee_account_id': self.fee_account_id.id,
'write_off_account_id': self.write_off_account_id.id,
'journal_ids': [(6, 0, self.journal_ids.ids)],
'created_by': 'admin',
'approval_tier': 'needs_approval',
})
return {
'type': 'ir.actions.act_window',
'res_model': 'fusion.accounting.rule',
'res_id': rule.id,
'view_mode': 'form',
'target': 'current',
}

View File

@@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_fusion_rule_wizard_form" model="ir.ui.view">
<field name="name">fusion.accounting.rule.wizard.form</field>
<field name="model">fusion.accounting.rule.wizard</field>
<field name="arch" type="xml">
<form string="Create Fusion Rule">
<group>
<field name="name"/>
<field name="rule_type"/>
</group>
<group>
<field name="description"/>
<field name="match_logic"/>
</group>
<group>
<field name="fee_account_id"/>
<field name="write_off_account_id"/>
<field name="journal_ids" widget="many2many_tags"/>
</group>
<footer>
<button name="action_create_rule" string="Create Rule" type="object" class="btn-primary"/>
<button string="Cancel" class="btn-secondary" special="cancel"/>
</footer>
</form>
</field>
</record>
<record id="action_fusion_rule_wizard" model="ir.actions.act_window">
<field name="name">Create Fusion Rule</field>
<field name="res_model">fusion.accounting.rule.wizard</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
</odoo>