Skip to content

Commit

Permalink
Merge branch '15.0' into 16.0-imp-002-jl
Browse files Browse the repository at this point in the history
  • Loading branch information
jose-pcg committed Aug 14, 2023
2 parents 848958d + 6018211 commit 71284c8
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion l10n_do_accounting/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"category": "Localization",
"license": "LGPL-3",
"website": "https://github.com/odoo-dominicana",
"version": "16.0.1.1.2",
"version": "16.0.1.1.3",
# any module necessary for this one to work correctly
"depends": ["l10n_latam_invoice_document", "l10n_do"],
# always loaded
Expand Down
6 changes: 6 additions & 0 deletions l10n_do_accounting/i18n/es_DO.po
Original file line number Diff line number Diff line change
Expand Up @@ -1334,3 +1334,9 @@ msgstr ""
#, python-format
msgid "special from Tax Paying"
msgstr "Exento"

#. module: l10n_do_accounting
#: code:addons/l10n_do_accounting/models/account_move.py:0
#, python-format
msgid "You cannot cancel a fiscal document that has not been posted before."
msgstr "No puede cancelar un documento fiscal que no haya sido posteado anteriormente."
4 changes: 3 additions & 1 deletion l10n_do_accounting/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,6 @@ def button_cancel(self):
lambda inv: inv.country_code == "DO"
and self.move_type[-6:] in ("nvoice", "refund")
and inv.l10n_latam_use_documents
and not inv.is_ecf_invoice
)

if len(fiscal_invoice) > 1:
Expand All @@ -370,6 +369,9 @@ def button_cancel(self):
):
raise AccessError(_("You are not allowed to cancel Fiscal Invoices"))

if fiscal_invoice and not fiscal_invoice.posted_before:
raise ValidationError(_("You cannot cancel a fiscal document that has not been posted before."))

if fiscal_invoice and not self.env.context.get("skip_cancel_wizard", False):
action = self.env.ref(
"l10n_do_accounting.action_account_move_cancel"
Expand Down
10 changes: 0 additions & 10 deletions l10n_do_accounting/views/account_move_views.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,16 +21,6 @@
Notice. This company is in a transient state of contingency for Electronic Invoice issuing. NCF issuing has been enabled.
</div>
</xpath>
<xpath expr="//button[@name='button_cancel']" position="attributes">
<attribute name="attrs">{
'invisible': ['|', '|',
('id', '=', False),
'&amp;', ('state', '!=', 'draft'),
('country_code', '!=', 'DO'),
'&amp;', ('state', 'in', ('draft', 'cancel')),
('country_code', '=', 'DO')]
}</attribute>
</xpath>
<xpath expr="//button[@name='button_draft']" position="attributes">
<attribute name="attrs">{
'invisible': ['|', '|',
Expand Down

0 comments on commit 71284c8

Please sign in to comment.