summaryrefslogtreecommitdiff
path: root/addons
diff options
context:
space:
mode:
authorJosse Colpaert <jco@odoo.com>2021-03-02 16:53:45 +0000
committerNicolas Lempereur <nle@odoo.com>2021-03-03 12:32:28 +0000
commit8cd0264d6dc8d8df19d1be4d504fb230b6eea3c7 (patch)
treedf8160035e4ef5418aff505ce5f184965b6aaebf /addons
parent744effb47117df01cbb47cb36668762b9f80312a (diff)
[FIX] l10n_id_efaktur: filter invoice lines on display_type
opw-2451571 closes odoo/odoo#67119 X-original-commit: 24c3260714083934a02ae349954136ec8839d1c8 Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Diffstat (limited to 'addons')
-rw-r--r--addons/l10n_id_efaktur/models/account_move.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/addons/l10n_id_efaktur/models/account_move.py b/addons/l10n_id_efaktur/models/account_move.py
index 481235b6209..0937bbe2ade 100644
--- a/addons/l10n_id_efaktur/models/account_move.py
+++ b/addons/l10n_id_efaktur/models/account_move.py
@@ -62,7 +62,8 @@ class AccountMove(models.Model):
def _constraint_kode_ppn(self):
ppn_tag = self.env.ref('l10n_id.ppn_tag')
for move in self.filtered(lambda m: m.l10n_id_kode_transaksi != '08'):
- if any(ppn_tag.id in line.tax_tag_ids.ids for line in move.line_ids if line.exclude_from_invoice_tab is False) and any(ppn_tag.id not in line.tax_tag_ids.ids for line in move.line_ids if line.exclude_from_invoice_tab is False):
+ if any(ppn_tag.id in line.tax_tag_ids.ids for line in move.line_ids if line.exclude_from_invoice_tab is False and not line.display_type) \
+ and any(ppn_tag.id not in line.tax_tag_ids.ids for line in move.line_ids if line.exclude_from_invoice_tab is False and not line.display_type):
raise UserError(_('Cannot mix VAT subject and Non-VAT subject items in the same invoice with this kode transaksi.'))
for move in self.filtered(lambda m: m.l10n_id_kode_transaksi == '08'):
if any(ppn_tag.id in line.tax_tag_ids.ids for line in move.line_ids if line.exclude_from_invoice_tab is False):
@@ -176,7 +177,7 @@ class AccountMove(models.Model):
eTax['ID_KETERANGAN_TAMBAHAN'] = '1' if move.l10n_id_kode_transaksi == '07' else ''
eTax['REFERENSI'] = number_ref
- lines = move.line_ids.filtered(lambda x: x.product_id.id == int(dp_product_id) and x.price_unit < 0)
+ lines = move.line_ids.filtered(lambda x: x.product_id.id == int(dp_product_id) and x.price_unit < 0 and not x.display_type)
eTax['FG_UANG_MUKA'] = 0
eTax['UANG_MUKA_DPP'] = int(abs(sum(lines.mapped('price_subtotal'))))
eTax['UANG_MUKA_PPN'] = int(abs(sum(lines.mapped(lambda l: l.price_total - l.price_subtotal))))
@@ -192,7 +193,7 @@ class AccountMove(models.Model):
# HOW TO ADD 2 line to 1 line for free product
free, sales = [], []
- for line in move.line_ids.filtered(lambda l: not l.exclude_from_invoice_tab):
+ for line in move.line_ids.filtered(lambda l: not l.exclude_from_invoice_tab and not l.display_type):
# *invoice_line_unit_price is price unit use for harga_satuan's column
# *invoice_line_quantity is quantity use for jumlah_barang's column
# *invoice_line_total_price is bruto price use for harga_total's column