mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[IMP] account_payment_order: Display a message with the archived bank accounts
TT47789
This commit is contained in:
@@ -6,6 +6,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 14.0\n"
|
"Project-Id-Version: Odoo Server 14.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2024-02-19 07:23+0000\n"
|
||||||
|
"PO-Revision-Date: 2024-02-19 07:23+0000\n"
|
||||||
"Last-Translator: \n"
|
"Last-Translator: \n"
|
||||||
"Language-Team: \n"
|
"Language-Team: \n"
|
||||||
"MIME-Version: 1.0\n"
|
"MIME-Version: 1.0\n"
|
||||||
@@ -30,6 +32,12 @@ msgid ""
|
|||||||
"automatically created."
|
"automatically created."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: account_payment_order
|
||||||
|
#: code:addons/account_payment_order/models/account_payment_order.py:0
|
||||||
|
#, python-format
|
||||||
|
msgid "<b>Account Number</b>: %s - <b>Partner</b>: %s"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: account_payment_order
|
#. module: account_payment_order
|
||||||
#: model_terms:ir.ui.view,arch_db:account_payment_order.print_account_payment_order_document
|
#: model_terms:ir.ui.view,arch_db:account_payment_order.print_account_payment_order_document
|
||||||
msgid "<strong>Company Currency:</strong>"
|
msgid "<strong>Company Currency:</strong>"
|
||||||
@@ -851,6 +859,11 @@ msgstr ""
|
|||||||
msgid "Partner Bank Account"
|
msgid "Partner Bank Account"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: account_payment_order
|
||||||
|
#: model:ir.model.fields,field_description:account_payment_order.field_account_payment_order__partner_banks_archive_msg
|
||||||
|
msgid "Partner Banks Archive Msg"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: account_payment_order
|
#. module: account_payment_order
|
||||||
#: model:ir.model.fields,field_description:account_payment_order.field_account_payment_line_create__partner_ids
|
#: model:ir.model.fields,field_description:account_payment_order.field_account_payment_line_create__partner_ids
|
||||||
msgid "Partners"
|
msgid "Partners"
|
||||||
@@ -1081,6 +1094,11 @@ msgstr ""
|
|||||||
msgid "The amount for Partner '%s' is negative or null (%.2f) !"
|
msgid "The amount for Partner '%s' is negative or null (%.2f) !"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#. module: account_payment_order
|
||||||
|
#: model_terms:ir.ui.view,arch_db:account_payment_order.account_payment_order_form
|
||||||
|
msgid "The following bank accounts are archived:"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: account_payment_order
|
#. module: account_payment_order
|
||||||
#: code:addons/account_payment_order/models/account_move.py:0
|
#: code:addons/account_payment_order/models/account_move.py:0
|
||||||
#, python-format
|
#, python-format
|
||||||
|
|||||||
@@ -8,8 +8,8 @@ msgid ""
|
|||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: Odoo Server 11.0\n"
|
"Project-Id-Version: Odoo Server 11.0\n"
|
||||||
"Report-Msgid-Bugs-To: \n"
|
"Report-Msgid-Bugs-To: \n"
|
||||||
"POT-Creation-Date: 2021-01-05 10:20+0000\n"
|
"POT-Creation-Date: 2024-02-19 07:23+0000\n"
|
||||||
"PO-Revision-Date: 2023-12-17 23:41+0000\n"
|
"PO-Revision-Date: 2024-02-19 08:25+0100\n"
|
||||||
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
|
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\n"
|
||||||
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
|
"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n"
|
||||||
"Language: es\n"
|
"Language: es\n"
|
||||||
@@ -17,7 +17,7 @@ msgstr ""
|
|||||||
"Content-Type: text/plain; charset=UTF-8\n"
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
"Content-Transfer-Encoding: 8bit\n"
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
"Plural-Forms: nplurals=2; plural=n != 1;\n"
|
||||||
"X-Generator: Weblate 4.17\n"
|
"X-Generator: Poedit 3.0.1\n"
|
||||||
|
|
||||||
#. module: account_payment_order
|
#. module: account_payment_order
|
||||||
#: code:addons/account_payment_order/models/account_move.py:0
|
#: code:addons/account_payment_order/models/account_move.py:0
|
||||||
@@ -41,6 +41,12 @@ msgstr ""
|
|||||||
"data-oe-model=account.payment.order data-oe-id=%d>%s</a> que se creó "
|
"data-oe-model=account.payment.order data-oe-id=%d>%s</a> que se creó "
|
||||||
"automáticamente."
|
"automáticamente."
|
||||||
|
|
||||||
|
#. module: account_payment_order
|
||||||
|
#: code:addons/account_payment_order/models/account_payment_order.py:0
|
||||||
|
#, python-format
|
||||||
|
msgid "<b>Account Number</b>: %s - <b>Partner</b>: %s"
|
||||||
|
msgstr "<b>Número de cuenta</b>: %s - <b>Empresa</b>: %s"
|
||||||
|
|
||||||
#. module: account_payment_order
|
#. module: account_payment_order
|
||||||
#: model_terms:ir.ui.view,arch_db:account_payment_order.print_account_payment_order_document
|
#: model_terms:ir.ui.view,arch_db:account_payment_order.print_account_payment_order_document
|
||||||
msgid "<strong>Company Currency:</strong>"
|
msgid "<strong>Company Currency:</strong>"
|
||||||
@@ -896,6 +902,11 @@ msgstr "Empresa"
|
|||||||
msgid "Partner Bank Account"
|
msgid "Partner Bank Account"
|
||||||
msgstr "Cuenta bancaria"
|
msgstr "Cuenta bancaria"
|
||||||
|
|
||||||
|
#. module: account_payment_order
|
||||||
|
#: model:ir.model.fields,field_description:account_payment_order.field_account_payment_order__partner_banks_archive_msg
|
||||||
|
msgid "Partner Banks Archive Msg"
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#. module: account_payment_order
|
#. module: account_payment_order
|
||||||
#: model:ir.model.fields,field_description:account_payment_order.field_account_payment_line_create__partner_ids
|
#: model:ir.model.fields,field_description:account_payment_order.field_account_payment_line_create__partner_ids
|
||||||
msgid "Partners"
|
msgid "Partners"
|
||||||
@@ -1132,6 +1143,11 @@ msgstr "Modelo técnico para imprimir orden de pago"
|
|||||||
msgid "The amount for Partner '%s' is negative or null (%.2f) !"
|
msgid "The amount for Partner '%s' is negative or null (%.2f) !"
|
||||||
msgstr "El importe para el empresa '%s' es negativo o nulo (%.2f) !"
|
msgstr "El importe para el empresa '%s' es negativo o nulo (%.2f) !"
|
||||||
|
|
||||||
|
#. module: account_payment_order
|
||||||
|
#: model_terms:ir.ui.view,arch_db:account_payment_order.account_payment_order_form
|
||||||
|
msgid "The following bank accounts are archived:"
|
||||||
|
msgstr "Las siguientes cuentas bancarias están archivadas:"
|
||||||
|
|
||||||
#. module: account_payment_order
|
#. module: account_payment_order
|
||||||
#: code:addons/account_payment_order/models/account_move.py:0
|
#: code:addons/account_payment_order/models/account_move.py:0
|
||||||
#, python-format
|
#, python-format
|
||||||
|
|||||||
@@ -28,6 +28,9 @@ class AccountPaymentOrder(models.Model):
|
|||||||
states={"draft": [("readonly", False)]},
|
states={"draft": [("readonly", False)]},
|
||||||
check_company=True,
|
check_company=True,
|
||||||
)
|
)
|
||||||
|
partner_banks_archive_msg = fields.Html(
|
||||||
|
compute="_compute_partner_banks_archive_msg",
|
||||||
|
)
|
||||||
payment_type = fields.Selection(
|
payment_type = fields.Selection(
|
||||||
selection=[("inbound", "Inbound"), ("outbound", "Outbound")],
|
selection=[("inbound", "Inbound"), ("outbound", "Outbound")],
|
||||||
string="Payment Type",
|
string="Payment Type",
|
||||||
@@ -155,6 +158,26 @@ class AccountPaymentOrder(models.Model):
|
|||||||
states={"draft": [("readonly", False)]},
|
states={"draft": [("readonly", False)]},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@api.depends(
|
||||||
|
"payment_line_ids.partner_bank_id", "payment_line_ids.partner_bank_id.active"
|
||||||
|
)
|
||||||
|
def _compute_partner_banks_archive_msg(self):
|
||||||
|
"""Information message to show archived bank accounts and to be able
|
||||||
|
to act on them before confirmation."""
|
||||||
|
for item in self:
|
||||||
|
msg_lines = []
|
||||||
|
for line in item.payment_line_ids.filtered(
|
||||||
|
lambda x: x.partner_bank_id and not x.partner_bank_id.active
|
||||||
|
):
|
||||||
|
msg_line = _("<b>Account Number</b>: %s - <b>Partner</b>: %s") % (
|
||||||
|
line.partner_bank_id.acc_number,
|
||||||
|
line.partner_bank_id.partner_id.display_name,
|
||||||
|
)
|
||||||
|
msg_lines.append(msg_line)
|
||||||
|
item.partner_banks_archive_msg = (
|
||||||
|
"<br/>".join(msg_lines) if len(msg_lines) > 0 else False
|
||||||
|
)
|
||||||
|
|
||||||
@api.depends("payment_mode_id")
|
@api.depends("payment_mode_id")
|
||||||
def _compute_allowed_journal_ids(self):
|
def _compute_allowed_journal_ids(self):
|
||||||
for record in self:
|
for record in self:
|
||||||
|
|||||||
@@ -21,6 +21,15 @@ class TestPaymentOrderOutboundBase(AccountTestInvoicingCommon):
|
|||||||
cls.partner = cls.env["res.partner"].create(
|
cls.partner = cls.env["res.partner"].create(
|
||||||
{
|
{
|
||||||
"name": "Test Partner",
|
"name": "Test Partner",
|
||||||
|
"bank_ids": [
|
||||||
|
(
|
||||||
|
0,
|
||||||
|
0,
|
||||||
|
{
|
||||||
|
"acc_number": "TEST-NUMBER",
|
||||||
|
},
|
||||||
|
)
|
||||||
|
],
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
cls.invoice_line_account = cls.env["account.account"].create(
|
cls.invoice_line_account = cls.env["account.account"].create(
|
||||||
@@ -201,6 +210,11 @@ class TestPaymentOrderOutbound(TestPaymentOrderOutboundBase):
|
|||||||
line_created_due.populate()
|
line_created_due.populate()
|
||||||
line_created_due.create_payment_lines()
|
line_created_due.create_payment_lines()
|
||||||
self.assertGreater(len(order.payment_line_ids), 0)
|
self.assertGreater(len(order.payment_line_ids), 0)
|
||||||
|
self.assertFalse(order.partner_banks_archive_msg)
|
||||||
|
order.payment_line_ids.partner_bank_id.action_archive()
|
||||||
|
self.assertTrue(order.partner_banks_archive_msg)
|
||||||
|
order.payment_line_ids.partner_bank_id.action_unarchive()
|
||||||
|
self.assertFalse(order.partner_banks_archive_msg)
|
||||||
order.draft2open()
|
order.draft2open()
|
||||||
order.open2generated()
|
order.open2generated()
|
||||||
order.generated2uploaded()
|
order.generated2uploaded()
|
||||||
|
|||||||
@@ -58,6 +58,16 @@
|
|||||||
statusbar_visible="draft,open,generated,uploaded"
|
statusbar_visible="draft,open,generated,uploaded"
|
||||||
/>
|
/>
|
||||||
</header>
|
</header>
|
||||||
|
<div
|
||||||
|
class="alert alert-warning"
|
||||||
|
role="alert"
|
||||||
|
attrs="{'invisible': [('partner_banks_archive_msg', '=', False)]}"
|
||||||
|
>
|
||||||
|
The following bank accounts are archived: <field
|
||||||
|
name="partner_banks_archive_msg"
|
||||||
|
readonly="1"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
<sheet>
|
<sheet>
|
||||||
<div class="oe_button_box" name="button_box">
|
<div class="oe_button_box" name="button_box">
|
||||||
<button
|
<button
|
||||||
|
|||||||
Reference in New Issue
Block a user