Files
Odoo-Modules/fusion_accounting_core/models/account_move.py

57 lines
1.8 KiB
Python

"""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",
)