Skip to content

Commit 3ba31bb

Browse files
[MIG] l10n_br_fiscal: Migration to 17.0
1 parent 7fb9736 commit 3ba31bb

23 files changed

+96
-121
lines changed

l10n_br_fiscal/__manifest__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
"maintainers": ["renatonlima"],
1111
"website": "https://github.com/OCA/l10n-brazil",
1212
"development_status": "Production/Stable",
13-
"version": "16.0.3.0.0",
13+
"version": "17.0.1.0.0",
1414
"depends": [
1515
"product",
1616
"l10n_br_base",

l10n_br_fiscal/migrations/16.0.2.0.0/pre-migration.py

Lines changed: 0 additions & 25 deletions
This file was deleted.

l10n_br_fiscal/migrations/16.0.2.15.0/pre-migration.py

Lines changed: 0 additions & 19 deletions
This file was deleted.

l10n_br_fiscal/views/cest_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
icon="fa-bars"
5050
name="%(product.product_template_action_all)d"
5151
context="{'search_default_cest_id': active_id}"
52-
attrs="{'invisible': [('product_tmpl_qty', '=', 0)]}"
52+
invisible="product_tmpl_qty == 0"
5353
>
5454
<field
5555
string="Products"

l10n_br_fiscal/views/document_email_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
name="web_ribbon"
3030
title="Archived"
3131
bg_color="bg-danger"
32-
attrs="{'invisible': [('active', '=', True)]}"
32+
invisible="active == True"
3333
/>
3434

3535
</div>

l10n_br_fiscal/views/document_line_view.xml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,15 @@
3737
<field name="force_compute_delivery_costs_by_total" invisible="1" />
3838
<field
3939
name="insurance_value"
40-
attrs="{'readonly': ['|', ('delivery_costs', '=', 'total'), ('force_compute_delivery_costs_by_total', '=', True)]}"
40+
readonly="delivery_costs == 'total' or force_compute_delivery_costs_by_total == True"
4141
/>
4242
<field
4343
name="other_value"
44-
attrs="{'readonly': ['|', ('delivery_costs', '=', 'total'), ('force_compute_delivery_costs_by_total', '=', True)]}"
44+
readonly="delivery_costs == 'total' or force_compute_delivery_costs_by_total == True"
4545
/>
4646
<field
4747
name="freight_value"
48-
attrs="{'readonly': ['|', ('delivery_costs', '=', 'total'), ('force_compute_delivery_costs_by_total', '=', True)]}"
48+
readonly="delivery_costs == 'total' or force_compute_delivery_costs_by_total == True"
4949
/>
5050
</group>
5151
<group name="fiscal_info" string="Fiscal">
@@ -62,15 +62,15 @@
6262
<field name="nbs_id" />
6363
<field
6464
name="service_type_id"
65-
attrs="{'invisible': [('fiscal_genre_code', '!=', '00'), ('cfop_id', '!=', False)]}"
65+
readonly="fiscal_genre_code != '00' and cfop_id != False"
6666
/>
6767
<field
6868
name="city_taxation_code_id"
69-
attrs="{'invisible': [('fiscal_genre_code', '!=', '00'), ('cfop_id', '!=', False)]}"
69+
readonly="fiscal_genre_code != '00' and cfop_id != False"
7070
/>
7171
<field
7272
name="cnae_id"
73-
attrs="{'invisible': [('fiscal_genre_code', '!=', '00'), ('cfop_id', '!=', False)]}"
73+
readonly="fiscal_genre_code != '00' and cfop_id != False"
7474
/>
7575
</group>
7676
<group name="l10n_br_fiscal" string="Operation">
@@ -79,7 +79,7 @@
7979
<field name="fiscal_operation_line_id" required="1" />
8080
<field
8181
name="cfop_id"
82-
attrs="{'invisible': [('fiscal_type', '=', '00'), ('cfop_id', '=', False)]}"
82+
readonly="fiscal_type == '00' and cfop_id == False"
8383
/>
8484
</group>
8585
</group>

l10n_br_fiscal/views/document_related_view.xml

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -31,51 +31,55 @@
3131
</group>
3232
<group
3333
string="NF-e/CT-e"
34-
attrs="{'invisible': [('document_type_code','not in', ('55', '57'))]}"
34+
invisible="document_type_code not in ('55', '57')"
3535
>
3636
<field name="document_key" />
3737
</group>
3838
<group
3939
string="Nota Fiscal/Produtor/Cupom Fiscal"
40-
attrs="{'invisible': [('document_type_code', 'not in', ('01', '04'))]}"
40+
invisible="document_type_code not in ('01', '04')"
4141
>
4242
<field
4343
name="document_serie"
44-
attrs="{'required': [('document_type_code', 'in', ('01', '04', '07'))]}"
44+
required="document_type_code in ('01', '04', '07')"
4545
/>
4646
<field
4747
name="document_number"
48-
attrs="{'required': [('document_type_code', 'in', ('01', '04', '07'))]}"
48+
required="document_type_code in ('01', '04', '07')"
4949
/>
5050
<field
5151
name="state_id"
52-
attrs="{'required': [('document_type_code', 'in', ('01', '04'))], 'invisible': [('document_type_code', '=', '07')]}"
52+
required="document_type_code in ('01', '04')"
53+
invisible="document_type_code == '07'"
5354
/>
5455
<field
5556
name="document_date"
56-
attrs="{'required': [('document_type_code', 'in', ('01', '04'))], 'invisible': [('document_type_code', '=', '07')]}"
57+
required="document_type_code in ('01', '04')"
58+
invisible="document_type_code == '07'"
5759
/>
5860
<field
5961
name="cpfcnpj_type"
60-
attrs="{'required': [('document_type_code', 'in', ('04'))], 'invisible': [('document_type_code', '!=', '04')]}"
62+
required="document_type_code in ('04')"
63+
invisible="document_type_code != '04'"
6164
/>
6265
<field
6366
name="cnpj_cpf"
64-
attrs="{'required': [('document_type_code', 'in', ('01', '04'))], 'invisible': [('document_type_code', '=', '07')]}"
67+
required="document_type_code in ('01', '04')"
68+
invisible="document_type_code == '07'"
6569
/>
6670
<field
6771
name="inscr_est"
68-
attrs="{'invisible': [('document_type_code', '!=', '04')]}"
72+
invisible="document_type_code != '04'"
6973
/>
7074
</group>
7175
<group
7276
string="Totais"
73-
attrs="{'invisible': [('document_type_code', 'not in', ('55', '57', '58'))]}"
77+
invisible="document_type_code not in ('55', '57', '58')"
7478
>
7579
<field name="document_total_weight" />
7680
<field
7781
name="document_total_amount"
78-
attrs="{'invisible': [('document_related_id', '!=', False)]}"
82+
invisible="document_related_id != False"
7983
/>
8084
</group>
8185
</form>

l10n_br_fiscal/views/document_serie_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
name="web_ribbon"
2929
title="Archived"
3030
bg_color="bg-danger"
31-
attrs="{'invisible': [('active', '=', True)]}"
31+
invisible="active == True"
3232
/>
3333

3434
</div>

l10n_br_fiscal/views/invalidate_number_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838
name="action_invalidate"
3939
type="object"
4040
string="Confirmar"
41-
states="draft"
41+
readonly="state != 'draft'"
4242
class="oe_highlight"
4343
/>
4444
</header>

l10n_br_fiscal/views/nbs_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@
8080
name="%(product.product_template_action_all)d"
8181
domain="['|', ('fiscal_type', '=', '09'), ('fiscal_type', '=', False), ('type', '=', 'service')]"
8282
context="{'search_default_nbs_id': active_id, 'default_fiscal_type': '09', 'default_type': 'service'}"
83-
attrs="{'invisible': [('product_tmpl_qty', '=', 0)]}"
83+
invisible="product_tmpl_qty == 0"
8484
>
8585
<field
8686
string="Products"

l10n_br_fiscal/views/ncm_view.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@
102102
name="web_ribbon"
103103
title="Archived"
104104
bg_color="bg-danger"
105-
attrs="{'invisible': [('active', '=', True)]}"
105+
invisible="active == True"
106106
/>
107107
<div class="oe_button_box" name="button_box">
108108
<button
@@ -120,7 +120,7 @@
120120
icon="fa-bars"
121121
name="%(product.product_template_action_all)d"
122122
context="{'search_default_ncm_id': active_id}"
123-
attrs="{'invisible': [('product_tmpl_qty', '=', 0)]}"
123+
invisible="product_tmpl_qty == 0"
124124
>
125125
<field
126126
string="Products"

l10n_br_fiscal/views/operation_line_view.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
<button
2828
name="action_review"
2929
type="object"
30-
states="draft"
30+
readonly="state != 'draft'"
3131
string="Review"
3232
class="oe_highlight"
3333
groups="l10n_br_fiscal.group_manager"
@@ -59,7 +59,7 @@
5959
</group>
6060
<group
6161
name="general_cfop"
62-
attrs="{'invisible': [('fiscal_operation_type', '=', 'all')]}"
62+
invisible="fiscal_operation_type == 'all'"
6363
>
6464
<field
6565
name="cfop_internal_id"

l10n_br_fiscal/views/operation_view.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,23 +45,23 @@
4545
<button
4646
name="action_review"
4747
type="object"
48-
states="draft"
48+
readonly="state != 'draft'"
4949
string="Review"
5050
class="oe_highlight"
5151
groups="l10n_br_fiscal.group_manager"
5252
/>
5353
<button
5454
name="action_approve"
5555
type="object"
56-
states="review,expired"
56+
readonly="state not in ('review', 'expired')"
5757
string="Approve"
5858
class="oe_highlight"
5959
groups="l10n_br_fiscal.group_manager"
6060
/>
6161
<button
6262
name="action_draft"
6363
type="object"
64-
states="review,approved"
64+
readonly="state not in ('review', 'approved')"
6565
string="Reset To Draft"
6666
class="oe_highlight"
6767
groups="l10n_br_fiscal.group_manager"

l10n_br_fiscal/views/partner_profile_view.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
icon="fa-bars"
5151
name="action_view_partners"
5252
context="{'default_fiscal_profile_id': active_id}"
53-
attrs="{'invisible': [('partner_qty', '=', 0)]}"
53+
invisible="partner_qty == 0"
5454
>
5555
<field
5656
string="Partners"
@@ -68,7 +68,7 @@
6868
<field name="ind_ie_dest" />
6969
<field
7070
name="tax_framework"
71-
attrs="{'invisible': [('is_company', '=', False)]}"
71+
invisible="is_company == False"
7272
/>
7373
</group>
7474
<notebook>

l10n_br_fiscal/views/product_genre_view.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
icon="fa-bars"
3838
name="%(product.product_template_action_all)d"
3939
context="{'search_default_product_genre_id': active_id}"
40-
attrs="{'invisible': [('product_tmpl_qty', '=', 0)]}"
40+
invisible="product_tmpl_qty == 0"
4141
>
4242
<field
4343
string="Products"

l10n_br_fiscal/views/product_product_view.xml

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,20 @@
6262
<field name="fiscal_type" required="1" />
6363
<field
6464
name="icms_origin"
65-
attrs="{'required': [('fiscal_type', '!=', '09')], 'invisible': [('fiscal_type', '=', '09')]}"
65+
required="fiscal_type != '09'"
66+
invisible="fiscal_type == '09'"
6667
/>
6768
<field name="ncm_id" required="1" />
6869
<field name="tax_icms_or_issqn" required="1" />
6970
<field
7071
name="service_type_id"
71-
attrs="{'invisible': [('fiscal_type', '!=', '09')]}"
72+
required="fiscal_type != '09'"
73+
invisible="fiscal_type == '09'"
7274
/>
7375
<field
7476
name="city_taxation_code_id"
75-
attrs="{'invisible': [('fiscal_type', '!=', '09')]}"
77+
required="fiscal_type != '09'"
78+
invisible="fiscal_type == '09'"
7679
context="{'default_service_type_id': service_type_id}"
7780
>
7881
<tree editable="bottom">
@@ -88,31 +91,37 @@
8891
<field name="fiscal_genre_id" required="1" />
8992
<field
9093
name="cest_id"
91-
attrs="{'invisible': [('fiscal_type', '=', '09')]}"
94+
required="fiscal_type == '09'"
95+
invisible="fiscal_type != '09'"
9296
/>
9397
<field
9498
name="nbs_id"
95-
attrs="{'invisible': [('fiscal_type', '!=', '09')]}"
99+
required="fiscal_type != '09'"
100+
invisible="fiscal_type == '09'"
96101
/>
97102
<field
98103
name="ipi_guideline_class_id"
99-
attrs="{'invisible': [('fiscal_type', '=', '09')]}"
104+
required="fiscal_type == '09'"
105+
invisible="fiscal_type != '09'"
100106
/>
101107
<field
102108
name="ipi_control_seal_id"
103-
attrs="{'invisible': [('fiscal_type', '=', '09')]}"
109+
required="fiscal_type == '09'"
110+
invisible="fiscal_type != '09'"
104111
/>
105112
</group>
106113
<group string="Tax UOM">
107114
<field name="uoe_id" />
108115
<field
109116
name="uoe_factor"
110-
attrs="{'invisible': [('fiscal_type', '=', False)], 'required': [('uot_id', '!=', False)]}"
117+
required="fiscal_type == False"
118+
invisible="fiscal_type != False"
111119
/>
112120
<field name="uot_id" />
113121
<field
114122
name="uot_factor"
115-
attrs="{'invisible': [('uot_id', '=', False)], 'required': [('uot_id', '!=', False)]}"
123+
required="uot_id != False"
124+
invisible="uot_id == False"
116125
/>
117126
</group>
118127
</group>

0 commit comments

Comments
 (0)