feat(fusion_accounting_core): shared-field-ownership for deferred fields, signing_user, created_automatically
Made-with: Cursor
This commit is contained in:
@@ -1 +1,3 @@
|
||||
from . import ir_module_module
|
||||
from . import account_move
|
||||
from . import account_reconcile_model
|
||||
|
||||
56
fusion_accounting_core/models/account_move.py
Normal file
56
fusion_accounting_core/models/account_move.py
Normal file
@@ -0,0 +1,56 @@
|
||||
"""Shared-field-ownership declarations for account.move.
|
||||
|
||||
Per the roadmap (Section 3.3), these fields exist in Odoo Enterprise's
|
||||
account_accountant module. By declaring them here with identical schemas
|
||||
and identical relation tables, fusion_accounting_core becomes a co-owner.
|
||||
When Enterprise uninstalls, Odoo's module registry sees fusion still owns
|
||||
the fields and preserves the columns / relation tables, so the data
|
||||
(deferred revenue links, signing user, etc.) survives uninstall.
|
||||
|
||||
The fields here have NO compute methods, NO defaults beyond what Enterprise
|
||||
provides, NO views. They're pure schema-preservation declarations. Any
|
||||
business logic that operates on these fields lives in Enterprise (when
|
||||
present) or in a future fusion sub-module that opts to own that behavior.
|
||||
"""
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = "account.move"
|
||||
|
||||
deferred_move_ids = fields.Many2many(
|
||||
comodel_name='account.move',
|
||||
relation='account_move_deferred_rel',
|
||||
column1='original_move_id',
|
||||
column2='deferred_move_id',
|
||||
copy=False,
|
||||
string="Deferred Entries",
|
||||
)
|
||||
deferred_original_move_ids = fields.Many2many(
|
||||
comodel_name='account.move',
|
||||
relation='account_move_deferred_rel',
|
||||
column1='deferred_move_id',
|
||||
column2='original_move_id',
|
||||
copy=False,
|
||||
string="Original Invoices",
|
||||
)
|
||||
deferred_entry_type = fields.Selection(
|
||||
selection=[
|
||||
('expense', 'Deferred Expense'),
|
||||
('revenue', 'Deferred Revenue'),
|
||||
],
|
||||
copy=False,
|
||||
string="Deferred Entry Type",
|
||||
)
|
||||
|
||||
signing_user = fields.Many2one(
|
||||
comodel_name='res.users',
|
||||
copy=False,
|
||||
string="Signing User",
|
||||
)
|
||||
|
||||
payment_state_before_switch = fields.Char(
|
||||
copy=False,
|
||||
string="Payment State Before Switch",
|
||||
)
|
||||
17
fusion_accounting_core/models/account_reconcile_model.py
Normal file
17
fusion_accounting_core/models/account_reconcile_model.py
Normal file
@@ -0,0 +1,17 @@
|
||||
"""Shared-field-ownership for account.reconcile.model.
|
||||
|
||||
Mirrors the single field Enterprise's account_accountant adds to the
|
||||
Community account.reconcile.model: created_automatically.
|
||||
"""
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class AccountReconcileModel(models.Model):
|
||||
_inherit = "account.reconcile.model"
|
||||
|
||||
created_automatically = fields.Boolean(
|
||||
default=False,
|
||||
copy=False,
|
||||
string="Created Automatically",
|
||||
)
|
||||
Reference in New Issue
Block a user