[IMP] Add payment upload state tracking on payment orders

account_ebics_payment_order:
Add EBICS notebook page with upload info to payment order form
This commit is contained in:
Luc De Meyer committed 2026-10-19 21:40:02 +02:00
1 parent 05ef1e46ec
commit a39bfa883e
7 files changed
+47 -28

No files matched your search

+1 -1
View File
@@ -20,7 +20,7 @@ addon | version | maintainers | summary
[account_ebics_batch_payment](account_ebics_batch_payment/) | 17.0.1.2.0 | | Send an Odoo Enterprise batch payment to the bank over EBICS [account_ebics_batch_payment](account_ebics_batch_payment/) | 17.0.1.2.0 | | Send an Odoo Enterprise batch payment to the bank over EBICS
[account_ebics_oca_statement_import](account_ebics_oca_statement_import/) | 17.0.1.0.1 | | Process EBICS statement files with the OCA bank statement import [account_ebics_oca_statement_import](account_ebics_oca_statement_import/) | 17.0.1.0.1 | | Process EBICS statement files with the OCA bank statement import
[account_ebics_oe](account_ebics_oe/) | 17.0.1.0.0 | | Place the EBICS menus in the Odoo Enterprise accounting application [account_ebics_oe](account_ebics_oe/) | 17.0.1.0.0 | | Place the EBICS menus in the Odoo Enterprise accounting application
[account_ebics_payment_order](account_ebics_payment_order/) | 17.0.1.2.1 | | Send an OCA payment order to the bank over EBICS [account_ebics_payment_order](account_ebics_payment_order/) | 17.0.1.3.0 | | Send an OCA payment order to the bank over EBICS
[//]: # (end addons) [//]: # (end addons)
+5 -17
View File
@@ -71,7 +71,7 @@
<field name="model">ebics.file</field> <field name="model">ebics.file</field>
<field name="priority">1</field> <field name="priority">1</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
< string="EBICS File" create="false"> <form string="EBICS File" create="false">
<header> <header>
<field name="download_process_method" invisible="1" /> <field name="download_process_method" invisible="1" />
<button <button
@@ -144,26 +144,14 @@
/> />
</group> </group>
</group> </group>
<group name="main-left">
<field name="date" string="Download Date" />
<field name="user_id" />
<field name="ebics_userid_id" />
</group>
<group name="main-right">
<field name="date_from" />
<field name="date_to" />
<field
name="company_ids"
widget="many2many_tags"
groups="base.group_multi_company"
/>
</group>
</group>
<notebook> <notebook>
<page string="Additional Information"> <page string="Additional Information">
<field name="note" nolabel="1" /> <field name="note" nolabel="1" />
</page> </page>
<page string="Bank Statements" invisible="not bank_statement_ids"> <page
string="Bank Statements"
invisible="not bank_statement_ids"
>
<field name="bank_statement_ids" nolabel="1" /> <field name="bank_statement_ids" nolabel="1" />
</page> </page>
</notebook> </notebook>
+6 -7
View File
@@ -408,7 +408,7 @@ class EbicsXfer(models.TransientModel):
) )
ef_note = "" ef_note = ""
if self.env.context.get("origin"): if self.env.context.get("origin"):
ef_note = self.env._("Origin: %s", self.env.context["origin"]) ef_note = _("Origin: %s") % self.env.context["origin"]
suffix = self.format_id.suffix suffix = self.format_id.suffix
fn = self.upload_fname fn = self.upload_fname
if suffix and not fn.endswith(suffix): if suffix and not fn.endswith(suffix):
@@ -478,12 +478,11 @@ class EbicsXfer(models.TransientModel):
def _payment_upload_chatter_message(self, payment_doc, ebics_file): def _payment_upload_chatter_message(self, payment_doc, ebics_file):
payment_doc.message_post( payment_doc.message_post(
body=self.env._( body=_("'%(fn)s' has been uploaded via EBICS (OrderID: %(order_number)s).")
"'%(filename)s' has been uploaded via EBICS" % {
" (OrderID: %(order_number)s).", "fn": ebics_file.name,
filename=ebics_file.name, "order_number": ebics_file.ebics_order_number,
order_number=ebics_file.ebics_order_number, }
)
) )
def _setup_client(self): def _setup_client(self):
@@ -8,6 +8,7 @@
<field name="arch" type="xml"> <field name="arch" type="xml">
<button name="validate_batch_button" position="after"> <button name="validate_batch_button" position="after">
<field name="hide_ebics_upload" invisible="1" /> <field name="hide_ebics_upload" invisible="1" />
<field name="ebics_config_id" invisible="1" />
<button <button
name="ebics_upload" name="ebics_upload"
type="object" type="object"
+1 -1
View File
@@ -4,7 +4,7 @@
{ {
"name": "EBICS - Payment Orders (OCA)", "name": "EBICS - Payment Orders (OCA)",
"summary": "Send an OCA payment order to the bank over EBICS", "summary": "Send an OCA payment order to the bank over EBICS",
"version": "17.0.1.2.1", "version": "17.0.1.3.0",
"license": "LGPL-3", "license": "LGPL-3",
"author": "Noviat", "author": "Noviat",
"website": "https://www.noviat.com/", "website": "https://www.noviat.com/",
@@ -8,6 +8,19 @@ from odoo.exceptions import UserError
class AccountPaymentOrder(models.Model): class AccountPaymentOrder(models.Model):
_inherit = "account.payment.order" _inherit = "account.payment.order"
ebics_config_id = fields.Many2one(
comodel_name="ebics.config",
related="journal_id.ebics_config_id",
)
ebics_file_id = fields.Many2one(
comodel_name="ebics.file",
string="EBICS Upload File",
readonly=True,
)
ebics_order_number = fields.Char(
related="ebics_file_id.ebics_order_number",
string="EBICS OrderID",
)
hide_ebics_upload = fields.Boolean( hide_ebics_upload = fields.Boolean(
compute="_compute_hide_ebics_upload", default=True compute="_compute_hide_ebics_upload", default=True
) )
@@ -16,7 +29,9 @@ class AccountPaymentOrder(models.Model):
def _compute_hide_ebics_upload(self): def _compute_hide_ebics_upload(self):
for rec in self: for rec in self:
rec.hide_ebics_upload = ( rec.hide_ebics_upload = (
not rec.journal_id.ebics_config_id or rec.state != "generated" self.env.neutralized
or not rec.journal_id.ebics_config_id
or rec.state != "generated"
) )
def ebics_upload(self): def ebics_upload(self):
@@ -4,10 +4,14 @@
<record id="account_payment_order_form" model="ir.ui.view"> <record id="account_payment_order_form" model="ir.ui.view">
<field name="name">account.payment.order.form</field> <field name="name">account.payment.order.form</field>
<field name="model">account.payment.order</field> <field name="model">account.payment.order</field>
<field name="inherit_id" ref="account_payment_order.account_payment_order_form" /> <field
name="inherit_id"
ref="account_payment_order.account_payment_order_form"
/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<button name="open2generated" position="after"> <button name="open2generated" position="after">
<field name="hide_ebics_upload" invisible="1" /> <field name="hide_ebics_upload" invisible="1" />
<field name="ebics_config_id" invisible="1" />
<button <button
name="ebics_upload" name="ebics_upload"
type="object" type="object"
@@ -16,6 +20,18 @@
class="oe_highlight" class="oe_highlight"
/> />
</button> </button>
<notebook position="inside">
<page
string="EBICS upload info"
name="ebics"
invisible="not ebics_config_id"
>
<group name="ebics_info">
<field name="ebics_file_id" string="Upload File" />
<field name="ebics_order_number" />
</group>
</page>
</notebook>
</field> </field>
</record> </record>