New models (12): - account.asset: depreciation (linear/degressive), journal entry generation - account.edi.format + account.edi.document: UBL 2.1 XML e-invoicing - account.followup.line: payment follow-up escalation levels - account.reconcile.model + lines: automatic bank reconciliation rules - crossovered.budget + lines + account.budget.post: budgeting system - account.cash.rounding: invoice rounding (UP/DOWN/HALF-UP) - account.payment.method + lines: payment method definitions - account.invoice.send: invoice sending wizard Enhanced existing: - account.move: action_reverse (credit notes), access_url, invoice_has_outstanding - account.move.line: tax_tag_ids, analytic_distribution, date_maturity, matching_number - Entry hash chain integrity (SHA-256, secure_sequence_number) - Report HTML rendering for all 6 report types - res.partner extended with followup status + overdue tracking Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
59 lines
2.3 KiB
Go
59 lines
2.3 KiB
Go
package models
|
|
|
|
import "odoo-go/pkg/orm"
|
|
|
|
// initAccountPaymentMethod registers account.payment.method and account.payment.method.line.
|
|
// Mirrors: odoo/addons/account/models/account_payment_method.py
|
|
//
|
|
// account.payment.method defines how payments are processed (e.g. manual, check, electronic).
|
|
// account.payment.method.line links a payment method to a journal with a specific sequence.
|
|
func initAccountPaymentMethod() {
|
|
m := orm.NewModel("account.payment.method", orm.ModelOpts{
|
|
Description: "Payment Method",
|
|
})
|
|
|
|
m.AddFields(
|
|
orm.Char("name", orm.FieldOpts{String: "Name", Required: true, Translate: true}),
|
|
orm.Char("code", orm.FieldOpts{String: "Code", Required: true}),
|
|
orm.Selection("payment_type", []orm.SelectionItem{
|
|
{Value: "inbound", Label: "Inbound"},
|
|
{Value: "outbound", Label: "Outbound"},
|
|
}, orm.FieldOpts{String: "Payment Type", Required: true}),
|
|
)
|
|
|
|
// -- Payment Method Line --
|
|
// Links a payment method to a journal, controlling which methods are available per journal.
|
|
// Mirrors: odoo/addons/account/models/account_payment_method.py AccountPaymentMethodLine
|
|
pml := orm.NewModel("account.payment.method.line", orm.ModelOpts{
|
|
Description: "Payment Method Line",
|
|
Order: "sequence, id",
|
|
})
|
|
|
|
pml.AddFields(
|
|
orm.Many2one("payment_method_id", "account.payment.method", orm.FieldOpts{
|
|
String: "Payment Method", Required: true, OnDelete: orm.OnDeleteCascade,
|
|
}),
|
|
orm.Many2one("journal_id", "account.journal", orm.FieldOpts{
|
|
String: "Journal", Required: true, OnDelete: orm.OnDeleteCascade,
|
|
}),
|
|
orm.Integer("sequence", orm.FieldOpts{String: "Sequence", Default: 10}),
|
|
orm.Char("name", orm.FieldOpts{
|
|
String: "Name", Related: "payment_method_id.name",
|
|
}),
|
|
orm.Char("code", orm.FieldOpts{
|
|
String: "Code", Related: "payment_method_id.code",
|
|
}),
|
|
orm.Selection("payment_type", []orm.SelectionItem{
|
|
{Value: "inbound", Label: "Inbound"},
|
|
{Value: "outbound", Label: "Outbound"},
|
|
}, orm.FieldOpts{String: "Payment Type", Related: "payment_method_id.payment_type"}),
|
|
orm.Many2one("payment_account_id", "account.account", orm.FieldOpts{
|
|
String: "Outstanding Receipts/Payments Account",
|
|
Help: "Account used for outstanding payments/receipts with this method",
|
|
}),
|
|
orm.Many2one("company_id", "res.company", orm.FieldOpts{
|
|
String: "Company", Related: "journal_id.company_id",
|
|
}),
|
|
)
|
|
}
|