Coveralls logob
Coveralls logo
  • Home
  • Features
  • Pricing
  • Docs
  • Sign In

OCA / l10n-brazil / 2187

15 Apr 2019 - 18:26 First build on 10.0-migrate_l10n_br_account_product at 78.831%
2187

Pull #602

travis-ci

9181eb84f9c35729a3bad740fb7f9d93?size=18&default=identiconweb-flow
[10.0][MIG][FIX] Requeriments file.
Pull Request #602: [10.0] migrate l10n br account product

896 of 1140 new or added lines in 52 files covered. (78.6%)

2994 of 3798 relevant lines covered (78.83%)

1.58 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

55.0
/l10n_br_account/models/account_fiscal_position_abstract.py
1
# -*- coding: utf-8 -*-
2
# Copyright (C) 2009 - TODAY Renato Lima - Akretion
3
# License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html
4

5
from odoo import fields, api
2×
6

7
from .l10n_br_account import TYPE
2×
8

9

10
class AccountFiscalPositionAbstract(object):
2×
11

12
    fiscal_category_id = fields.Many2one(
2×
13
        comodel_name='l10n_br_account.fiscal.category',
14
        string=u'Categoria Fiscal')
15

16
    type = fields.Selection(
2×
17
        selection=TYPE,
18
        related='fiscal_category_id.type',
19
        readonly=True,
20
        store=True,
21
        string=u'Fiscal Type')
22

23
    inv_copy_note = fields.Boolean(
2×
24
        string=u'Copiar Observação na Nota Fiscal')
25

26
    asset_operation = fields.Boolean(
2×
27
        string=u'Operação de Aquisição de Ativo',
28
        help=u"Caso seja marcada essa opção, será "
29
             "incluido o IPI na base de calculo do ICMS.")
30

31
    state = fields.Selection(
2×
32
        selection=[('draft', u'Rascunho'),
33
                   ('review', u'Revisão'),
34
                   ('approved', u'Aprovada'),
35
                   ('unapproved', u'Não Aprovada')],
36
        string=u'Status',
37
        readonly=True,
38
        track_visibility='onchange',
39
        index=True,
40
        default='draft')
41

42

43
class AccountFiscalPositionTaxAbstract(object):
2×
44

45
    tax_group_id = fields.Many2one(
2×
46
        comodel_name='account.tax.group',
47
        string=u'Grupo de Impostos',
48
    )
49

50
    @api.onchange('tax_src_id',
2×
51
                  'tax_group_id',
52
                  'position_id')
53
    def _onchange_tax_group(self):
54
        type_tax_use = {'input': 'purchase', 'output': 'sale'}
!
NEW
55
        domain = []
!
56

NEW
57
        if self.position_id.type:
!
NEW
58
            domain = [('type_tax_use', '=',
!
59
                      (type_tax_use.get(self.position_id.type)))]
60

61
        if self.tax_group_id:
!
62
            domain.append(('tax_group_id', '=', self.tax_group_id.id))
!
63

64
        if self.tax_src_id:
!
65
            domain.append(('tax_group_id', '=',
!
66
                           self.tax_src_id.tax_group_id.id))
67

68
        return {'domain': {'tax_dest_id': domain, 'tax_src_id': domain}}
!
Troubleshooting · Open an Issue · Sales · Support · ENTERPRISE · CAREERS · STATUS
BLOG · TWITTER · Legal & Privacy · Supported CI Services · What's a CI service? · Automated Testing

© 2021 Coveralls, Inc