Skip to content

Commit

Permalink
Fix _compute_is_invoice_basis()
Browse files Browse the repository at this point in the history
  • Loading branch information
astirpe committed Sep 13, 2019
1 parent 89db8fa commit 8bc7c47
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions l10n_nl_tax_statement/models/l10n_nl_vat_statement.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,15 +130,17 @@ def _get_unreported_move_domain(self):
)
unreported_move_from_date = fields.Date()

@api.multi
def _compute_is_invoice_basis(self):
self.is_invoice_basis = False
has_invoice_basis = self.env['ir.model.fields'].sudo().search_count([
('model', '=', 'res.company'),
('name', '=', 'l10n_nl_tax_invoice_basis')
])
if has_invoice_basis:
self.is_invoice_basis = self.company_id.l10n_nl_tax_invoice_basis
for statement in self:
if has_invoice_basis:
invoice_basis = statement.company_id.l10n_nl_tax_invoice_basis
statement.is_invoice_basis = invoice_basis
else:
statement.is_invoice_basis = False

is_invoice_basis = fields.Boolean(
string='NL Tax Invoice Basis',
Expand Down

0 comments on commit 8bc7c47

Please sign in to comment.