mirror of
https://github.com/brain-tec/account_ebics.git
synced 2026-11-06 10:00:39 +00:00
[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:
1 parent
05ef1e46ec
commit
a39bfa883e
7 files changed
+70
-51
No files matched your search
@@ -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_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_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)
|
||||
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
<field name="model">ebics.file</field>
|
||||
<field name="priority">1</field>
|
||||
<field name="arch" type="xml">
|
||||
< string="EBICS File" create="false">
|
||||
<form string="EBICS File" create="false">
|
||||
<header>
|
||||
<field name="download_process_method" invisible="1" />
|
||||
<button
|
||||
@@ -144,30 +144,18 @@
|
||||
/>
|
||||
</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>
|
||||
<page string="Additional Information">
|
||||
<field name="note" nolabel="1" />
|
||||
</page>
|
||||
<page string="Bank Statements" invisible="not bank_statement_ids">
|
||||
<field name="bank_statement_ids" nolabel="1" />
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
<notebook>
|
||||
<page string="Additional Information">
|
||||
<field name="note" nolabel="1" />
|
||||
</page>
|
||||
<page
|
||||
string="Bank Statements"
|
||||
invisible="not bank_statement_ids"
|
||||
>
|
||||
<field name="bank_statement_ids" nolabel="1" />
|
||||
</page>
|
||||
</notebook>
|
||||
</sheet>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -408,7 +408,7 @@ class EbicsXfer(models.TransientModel):
|
||||
)
|
||||
ef_note = ""
|
||||
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
|
||||
fn = self.upload_fname
|
||||
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):
|
||||
payment_doc.message_post(
|
||||
body=self.env._(
|
||||
"'%(filename)s' has been uploaded via EBICS"
|
||||
" (OrderID: %(order_number)s).",
|
||||
filename=ebics_file.name,
|
||||
order_number=ebics_file.ebics_order_number,
|
||||
)
|
||||
body=_("'%(fn)s' has been uploaded via EBICS (OrderID: %(order_number)s).")
|
||||
% {
|
||||
"fn": ebics_file.name,
|
||||
"order_number": ebics_file.ebics_order_number,
|
||||
}
|
||||
)
|
||||
|
||||
def _setup_client(self):
|
||||
|
||||
@@ -2,13 +2,14 @@
|
||||
<odoo>
|
||||
|
||||
<record id="view_batch_payment_form" model="ir.ui.view">
|
||||
<field name="name">account.batch.payment.form</field>
|
||||
<field name="model">account.batch.payment</field>
|
||||
<field name="inherit_id" ref="account_batch_payment.view_batch_payment_form" />
|
||||
<field name="arch" type="xml">
|
||||
<button name="validate_batch_button" position="after">
|
||||
<field name="hide_ebics_upload" invisible="1" />
|
||||
<button
|
||||
<field name="name">account.batch.payment.form</field>
|
||||
<field name="model">account.batch.payment</field>
|
||||
<field name="inherit_id" ref="account_batch_payment.view_batch_payment_form" />
|
||||
<field name="arch" type="xml">
|
||||
<button name="validate_batch_button" position="after">
|
||||
<field name="hide_ebics_upload" invisible="1" />
|
||||
<field name="ebics_config_id" invisible="1" />
|
||||
<button
|
||||
name="ebics_upload"
|
||||
type="object"
|
||||
invisible="hide_ebics_upload"
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
{
|
||||
"name": "EBICS - Payment Orders (OCA)",
|
||||
"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",
|
||||
"author": "Noviat",
|
||||
"website": "https://www.noviat.com/",
|
||||
|
||||
@@ -8,6 +8,19 @@ from odoo.exceptions import UserError
|
||||
class AccountPaymentOrder(models.Model):
|
||||
_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(
|
||||
compute="_compute_hide_ebics_upload", default=True
|
||||
)
|
||||
@@ -16,7 +29,9 @@ class AccountPaymentOrder(models.Model):
|
||||
def _compute_hide_ebics_upload(self):
|
||||
for rec in self:
|
||||
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):
|
||||
|
||||
@@ -2,21 +2,37 @@
|
||||
<odoo>
|
||||
|
||||
<record id="account_payment_order_form" model="ir.ui.view">
|
||||
<field name="name">account.payment.order.form</field>
|
||||
<field name="model">account.payment.order</field>
|
||||
<field name="inherit_id" ref="account_payment_order.account_payment_order_form" />
|
||||
<field name="arch" type="xml">
|
||||
<button name="open2generated" position="after">
|
||||
<field name="hide_ebics_upload" invisible="1" />
|
||||
<button
|
||||
<field name="name">account.payment.order.form</field>
|
||||
<field name="model">account.payment.order</field>
|
||||
<field
|
||||
name="inherit_id"
|
||||
ref="account_payment_order.account_payment_order_form"
|
||||
/>
|
||||
<field name="arch" type="xml">
|
||||
<button name="open2generated" position="after">
|
||||
<field name="hide_ebics_upload" invisible="1" />
|
||||
<field name="ebics_config_id" invisible="1" />
|
||||
<button
|
||||
name="ebics_upload"
|
||||
type="object"
|
||||
invisible="hide_ebics_upload"
|
||||
string="EBICS Upload"
|
||||
class="oe_highlight"
|
||||
/>
|
||||
</button>
|
||||
</field>
|
||||
</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>
|
||||
</record>
|
||||
|
||||
</odoo>
|
||||
Reference in new issue
Block a user