feat(invoicing): module scaffold + strategy defaults + account hold
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2026 Nexa Systems Inc.
|
||||
# License OPL-1 (Odoo Proprietary License v1.0)
|
||||
# Part of the Fusion Plating product family.
|
||||
|
||||
from . import fp_invoice_strategy_default
|
||||
from . import res_partner
|
||||
from . import sale_order
|
||||
from . import account_move
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2026 Nexa Systems Inc.
|
||||
# License OPL-1 (Odoo Proprietary License v1.0)
|
||||
# Part of the Fusion Plating product family.
|
||||
# Placeholder — implemented in a later task.
|
||||
@@ -0,0 +1,39 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2026 Nexa Systems Inc.
|
||||
# License OPL-1 (Odoo Proprietary License v1.0)
|
||||
# Part of the Fusion Plating product family.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class FpInvoiceStrategyDefault(models.Model):
|
||||
"""Customer-level default invoice strategy.
|
||||
|
||||
When a new sale order is created for this customer, the invoice
|
||||
strategy and deposit percentage auto-fill from this record.
|
||||
"""
|
||||
_name = 'fp.invoice.strategy.default'
|
||||
_description = 'Fusion Plating — Invoice Strategy Default'
|
||||
_order = 'partner_id'
|
||||
|
||||
partner_id = fields.Many2one(
|
||||
'res.partner', string='Customer', required=True, ondelete='cascade',
|
||||
domain="[('customer_rank', '>', 0)]",
|
||||
)
|
||||
default_strategy = fields.Selection(
|
||||
[('deposit', 'Deposit'), ('progress', 'Progress Billing'),
|
||||
('net_terms', 'Net Terms'), ('cod_prepay', 'COD / Prepay')],
|
||||
string='Default Strategy', required=True,
|
||||
)
|
||||
default_deposit_percent = fields.Float(
|
||||
string='Deposit %', help='Deposit percentage if strategy is Deposit (e.g. 50.0).',
|
||||
)
|
||||
payment_term_id = fields.Many2one(
|
||||
'account.payment.term', string='Payment Terms',
|
||||
)
|
||||
notes = fields.Text(string='Notes')
|
||||
|
||||
_sql_constraints = [
|
||||
('fp_invoice_strategy_partner_uniq', 'unique(partner_id)',
|
||||
'Only one invoice strategy default per customer.'),
|
||||
]
|
||||
@@ -0,0 +1,22 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2026 Nexa Systems Inc.
|
||||
# License OPL-1 (Odoo Proprietary License v1.0)
|
||||
# Part of the Fusion Plating product family.
|
||||
|
||||
from odoo import fields, models
|
||||
|
||||
|
||||
class ResPartner(models.Model):
|
||||
_inherit = 'res.partner'
|
||||
|
||||
x_fc_account_hold = fields.Boolean(
|
||||
string='Account Hold', tracking=True,
|
||||
help='When active, blocks SO confirmation, invoicing, and shipping.',
|
||||
)
|
||||
x_fc_account_hold_reason = fields.Text(string='Hold Reason')
|
||||
x_fc_account_hold_date = fields.Datetime(
|
||||
string='Hold Date', help='When the hold was placed.',
|
||||
)
|
||||
x_fc_account_hold_by_id = fields.Many2one(
|
||||
'res.users', string='Hold Placed By',
|
||||
)
|
||||
@@ -0,0 +1,5 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
# Copyright 2026 Nexa Systems Inc.
|
||||
# License OPL-1 (Odoo Proprietary License v1.0)
|
||||
# Part of the Fusion Plating product family.
|
||||
# Placeholder — implemented in a later task.
|
||||
Reference in New Issue
Block a user