27 lines
1001 B
Python
27 lines
1001 B
Python
from odoo import fields, models
|
|
|
|
|
|
class FusionStatementImportLog(models.Model):
|
|
_name = 'fusion.statement.import.log'
|
|
_description = 'Imported Bank Transaction Log'
|
|
_order = 'date desc, id desc'
|
|
_rec_name = 'fitid'
|
|
|
|
journal_id = fields.Many2one(
|
|
'account.journal', required=True, ondelete='cascade', index=True,
|
|
)
|
|
fitid = fields.Char(string='Bank Transaction ID', required=True, index=True)
|
|
date = fields.Date()
|
|
amount = fields.Float(digits=(16, 2))
|
|
payment_ref = fields.Char(string='Description')
|
|
import_date = fields.Datetime(default=fields.Datetime.now, readonly=True)
|
|
statement_line_id = fields.Many2one('account.bank.statement.line', ondelete='set null')
|
|
company_id = fields.Many2one(
|
|
'res.company', required=True, default=lambda self: self.env.company,
|
|
)
|
|
|
|
_sql_constraints = [
|
|
('journal_fitid_unique', 'UNIQUE(journal_id, fitid)',
|
|
'This transaction has already been imported for this journal.'),
|
|
]
|