summaryrefslogtreecommitdiff
path: root/addons/l10n_ch/models/account_invoice.py
diff options
context:
space:
mode:
authorYannick Vaucher <yannick.vaucher@camptocamp.com>2020-05-20 20:09:51 +0000
committeroco-odoo <oco@odoo.com>2020-06-23 10:17:26 +0000
commit2e9aac765536f30748d69cdd06eee2164983f853 (patch)
tree5a78af2b8e1fc3f7f17ddb60a265b19d854f2c4a /addons/l10n_ch/models/account_invoice.py
parent8a1e1c0c4cac3034bf6caada0004680942b04703 (diff)
[FIX] l10n_ch - print ISR tests
resolves the following error: E psycopg2.IntegrityError: null value in column "partner_id" violates not-null constraint E DETAIL: Failing row contains (193, 010391391, null, null, null, null, 10, null, 1, 1, 2020-05-20 20:05:28.431208, 1, 2020-05-20 20:05:28.431208, null, null, null, null). To generate an ISR payment slip you need: * a type == out_invoice * a partner bank account with a ISR issuer number (field l10n_ch_isr_subscription_[chf|eur]) * a currency either in EUR or CHF Remarks: * l10n_ch_postal is not necessary and must be used for Vendors only. * human readable subscription number is xx-yyyyyy-c validation of such format is done with the following PR: https://github.com/odoo/odoo/pull/51544/files It does: - Removes unexisting field from tests - Adds required field on partner_id - Fix test with an actual case that case generate ISR payment slips closes odoo/odoo#53498 X-original-commit: 776fd59909d12c981585fac82cfa9f3603d96ccf Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Diffstat (limited to 'addons/l10n_ch/models/account_invoice.py')
-rw-r--r--addons/l10n_ch/models/account_invoice.py2
1 files changed, 0 insertions, 2 deletions
diff --git a/addons/l10n_ch/models/account_invoice.py b/addons/l10n_ch/models/account_invoice.py
index b0ff383c01a..5799f41384f 100644
--- a/addons/l10n_ch/models/account_invoice.py
+++ b/addons/l10n_ch/models/account_invoice.py
@@ -142,7 +142,6 @@ class AccountMove(models.Model):
@api.depends(
'move_type', 'name', 'currency_id.name',
- 'partner_bank_id.l10n_ch_postal',
'partner_bank_id.l10n_ch_isr_subscription_eur',
'partner_bank_id.l10n_ch_isr_subscription_chf')
def _compute_l10n_ch_isr_valid(self):
@@ -151,7 +150,6 @@ class AccountMove(models.Model):
record.l10n_ch_isr_valid = record.move_type == 'out_invoice' and\
record.name and \
record.l10n_ch_isr_subscription and \
- record.partner_bank_id.l10n_ch_postal and \
record.l10n_ch_currency_name in ['EUR', 'CHF']
def split_total_amount(self):