diff --git a/base_transaction_id/models/invoice.py b/base_transaction_id/models/invoice.py index d7aae172..e22f5634 100644 --- a/base_transaction_id/models/invoice.py +++ b/base_transaction_id/models/invoice.py @@ -2,17 +2,18 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) -from odoo import models, fields, api +from odoo import api, fields, models class AccountInvoice(models.Model): - _inherit = 'account.invoice' + _inherit = "account.invoice" - transaction_id = fields.Char(string='Transaction ID', - index=True, - copy=False, - help="Transaction ID from the " - "financial institute") + transaction_id = fields.Char( + string="Transaction ID", + index=True, + copy=False, + help="Transaction ID from the " "financial institute", + ) @api.multi def action_move_create(self): diff --git a/base_transaction_id/models/sale.py b/base_transaction_id/models/sale.py index d89615a0..3506e82e 100644 --- a/base_transaction_id/models/sale.py +++ b/base_transaction_id/models/sale.py @@ -2,22 +2,22 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl) -from odoo import models, fields, api +from odoo import api, fields, models class SaleOrder(models.Model): - _inherit = 'sale.order' + _inherit = "sale.order" transaction_id = fields.Char( - 'Transaction ID', + "Transaction ID", required=False, copy=False, - help="Transaction id from the financial institute" + help="Transaction id from the financial institute", ) @api.multi def _prepare_invoice(self): """Propagate the transaction_id from the sale order to the invoice.""" invoice_vals = super()._prepare_invoice() - invoice_vals['transaction_id'] = self.transaction_id + invoice_vals["transaction_id"] = self.transaction_id return invoice_vals diff --git a/base_transaction_id/readme/DESCRIPTION.rst b/base_transaction_id/readme/DESCRIPTION.rst index c8f3edd9..d5325e6c 100644 --- a/base_transaction_id/readme/DESCRIPTION.rst +++ b/base_transaction_id/readme/DESCRIPTION.rst @@ -9,4 +9,4 @@ You can then add a mapping on that SO field to save the e-commerce financial Transaction ID into the Odoo sale order field. The main purpose is to ease the reconciliation process and be able to find the partner -when importing the bank statement. \ No newline at end of file +when importing the bank statement. diff --git a/base_transaction_id/views/invoice.xml b/base_transaction_id/views/invoice.xml index 7c07a52e..09f4c4a4 100644 --- a/base_transaction_id/views/invoice.xml +++ b/base_transaction_id/views/invoice.xml @@ -1,15 +1,15 @@ - + customer.invoice.transaction.inherit account.invoice - + - + @@ -17,10 +17,10 @@ account.invoice.tree_inherit account.invoice - + - + diff --git a/base_transaction_id/views/sale.xml b/base_transaction_id/views/sale.xml index e390ee86..3c0b8b30 100644 --- a/base_transaction_id/views/sale.xml +++ b/base_transaction_id/views/sale.xml @@ -1,13 +1,13 @@ - + base_transaction_id.sale.order.form sale.order - + - +