odoo14-addon-l10n-br-purchase 14.0.3.10.1.dev3__py3-none-any.whl → 14.0.3.11.1.dev2__py3-none-any.whl
Sign up to get free protection for your applications and to get access to all the features.
- odoo/addons/l10n_br_purchase/README.rst +1 -1
- odoo/addons/l10n_br_purchase/__manifest__.py +1 -1
- odoo/addons/l10n_br_purchase/demo/l10n_br_purchase.xml +232 -0
- odoo/addons/l10n_br_purchase/i18n/l10n_br_purchase.pot +15 -0
- odoo/addons/l10n_br_purchase/i18n/pt_BR.po +15 -0
- odoo/addons/l10n_br_purchase/models/purchase_order.py +9 -0
- odoo/addons/l10n_br_purchase/models/purchase_order_line.py +9 -0
- odoo/addons/l10n_br_purchase/reports/purchase_report.py +2 -2
- odoo/addons/l10n_br_purchase/static/description/index.html +1 -1
- odoo/addons/l10n_br_purchase/tests/test_l10n_br_purchase.py +146 -4
- {odoo14_addon_l10n_br_purchase-14.0.3.10.1.dev3.dist-info → odoo14_addon_l10n_br_purchase-14.0.3.11.1.dev2.dist-info}/METADATA +3 -3
- {odoo14_addon_l10n_br_purchase-14.0.3.10.1.dev3.dist-info → odoo14_addon_l10n_br_purchase-14.0.3.11.1.dev2.dist-info}/RECORD +14 -14
- {odoo14_addon_l10n_br_purchase-14.0.3.10.1.dev3.dist-info → odoo14_addon_l10n_br_purchase-14.0.3.11.1.dev2.dist-info}/WHEEL +1 -1
- {odoo14_addon_l10n_br_purchase-14.0.3.10.1.dev3.dist-info → odoo14_addon_l10n_br_purchase-14.0.3.11.1.dev2.dist-info}/top_level.txt +0 -0
@@ -7,7 +7,7 @@ Brazilian Localization Purchase
|
|
7
7
|
!! This file is generated by oca-gen-addon-readme !!
|
8
8
|
!! changes will be overwritten. !!
|
9
9
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
10
|
-
!! source digest: sha256:
|
10
|
+
!! source digest: sha256:4669e2f2ad7e9b04c0a1d9efd13ef55b9c378ef3524710d1178252cf534ba4e7
|
11
11
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
12
12
|
|
13
13
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
@@ -8,7 +8,7 @@
|
|
8
8
|
"author": "Akretion, Odoo Community Association (OCA)",
|
9
9
|
"maintainers": ["renatonlima", "rvalyi"],
|
10
10
|
"website": "https://github.com/OCA/l10n-brazil",
|
11
|
-
"version": "14.0.3.
|
11
|
+
"version": "14.0.3.11.0",
|
12
12
|
"depends": ["purchase", "l10n_br_account"],
|
13
13
|
"data": [
|
14
14
|
# Security
|
@@ -55,6 +55,238 @@
|
|
55
55
|
<value eval="[ref('main_pl_only_products_2_2')]" />
|
56
56
|
</function>
|
57
57
|
|
58
|
+
<!-- Endereço de Cobrança Diferente do Partner,a Fatura criada deverá ter
|
59
|
+
outro partner, o Contato definido como Endereço de Faturamento/Cobrança,
|
60
|
+
TODO: deveria criar a fatura usando Partner do Pedido como o Parceiro
|
61
|
+
para Entrega/partner_shipping_id?
|
62
|
+
No caso l10n_br_purchase_stock isso acontece
|
63
|
+
-->
|
64
|
+
<record id="main_company-purchase_2" model="purchase.order">
|
65
|
+
<field name="name">l10n_br_purchase - Endereço de Cobrança Diferente</field>
|
66
|
+
<field name="partner_id" ref="l10n_br_base.res_partner_cliente7_rs" />
|
67
|
+
<field name="state">draft</field>
|
68
|
+
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_compras" />
|
69
|
+
<field name="user_id" ref="base.user_admin" />
|
70
|
+
<field name="company_id" ref="base.main_company" />
|
71
|
+
</record>
|
72
|
+
|
73
|
+
<function model="purchase.order" name="_onchange_fiscal_operation_id">
|
74
|
+
<value eval="[ref('main_company-purchase_2')]" />
|
75
|
+
</function>
|
76
|
+
|
77
|
+
<record id="main_company-purchase_line_2_1" model="purchase.order.line">
|
78
|
+
<field name="order_id" ref="main_company-purchase_2" />
|
79
|
+
<field name="name">Office Chair Black</field>
|
80
|
+
<field name="product_id" ref="product.product_product_12" />
|
81
|
+
<field name="product_qty">4</field>
|
82
|
+
<field name="product_uom" ref="uom.product_uom_unit" />
|
83
|
+
<!-- Apesar do Preço ser defindo aqui o _onchange_product_id_fiscal altera o valor -->
|
84
|
+
<field name="price_unit">25.0</field>
|
85
|
+
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_compras" />
|
86
|
+
<field
|
87
|
+
name="fiscal_operation_line_id"
|
88
|
+
ref="l10n_br_fiscal.fo_compras_compras"
|
89
|
+
/>
|
90
|
+
<field name="date_planned" eval="time.strftime('%Y-%m-%d')" />
|
91
|
+
</record>
|
92
|
+
|
93
|
+
<function model="purchase.order.line" name="_onchange_product_id_fiscal">
|
94
|
+
<value eval="[ref('main_company-purchase_line_2_1')]" />
|
95
|
+
</function>
|
96
|
+
|
97
|
+
<record id="main_company-purchase_line_2_2" model="purchase.order.line">
|
98
|
+
<field name="order_id" ref="main_company-purchase_2" />
|
99
|
+
<field name="name">Drawer Black</field>
|
100
|
+
<field name="product_id" ref="product.product_product_16" />
|
101
|
+
<field name="product_qty">2</field>
|
102
|
+
<field name="product_uom" ref="uom.product_uom_unit" />
|
103
|
+
<field name="price_unit">50.00</field>
|
104
|
+
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_compras" />
|
105
|
+
<field
|
106
|
+
name="fiscal_operation_line_id"
|
107
|
+
ref="l10n_br_fiscal.fo_compras_compras"
|
108
|
+
/>
|
109
|
+
<field name="date_planned" eval="time.strftime('%Y-%m-%d')" />
|
110
|
+
</record>
|
111
|
+
|
112
|
+
<function model="purchase.order.line" name="_onchange_product_id_fiscal">
|
113
|
+
<value eval="[ref('main_company-purchase_line_2_2')]" />
|
114
|
+
</function>
|
115
|
+
|
116
|
+
<!-- Endereço de Cobrança Diferente do Partner, nesse caso o Endereço já
|
117
|
+
está informado, não deve ter o Parceiro para Entrega
|
118
|
+
-->
|
119
|
+
<record id="main_company-purchase_3" model="purchase.order">
|
120
|
+
<field name="name">l10n_br_purchase - Endereço de Cobrança Informado</field>
|
121
|
+
<field
|
122
|
+
name="partner_id"
|
123
|
+
ref="l10n_br_base.res_partner_cliente7_rs_end_cobranca"
|
124
|
+
/>
|
125
|
+
<field name="state">draft</field>
|
126
|
+
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_compras" />
|
127
|
+
<field name="user_id" ref="base.user_admin" />
|
128
|
+
<field name="company_id" ref="base.main_company" />
|
129
|
+
</record>
|
130
|
+
|
131
|
+
<function model="purchase.order" name="_onchange_fiscal_operation_id">
|
132
|
+
<value eval="[ref('main_company-purchase_3')]" />
|
133
|
+
</function>
|
134
|
+
|
135
|
+
<record id="main_company-purchase_line_3_1" model="purchase.order.line">
|
136
|
+
<field name="order_id" ref="main_company-purchase_3" />
|
137
|
+
<field name="name">Office Chair Black</field>
|
138
|
+
<field name="product_id" ref="product.product_product_12" />
|
139
|
+
<field name="product_qty">4</field>
|
140
|
+
<field name="product_uom" ref="uom.product_uom_unit" />
|
141
|
+
<!-- Apesar do Preço ser defindo aqui o _onchange_product_id_fiscal altera o valor -->
|
142
|
+
<field name="price_unit">25.0</field>
|
143
|
+
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_compras" />
|
144
|
+
<field
|
145
|
+
name="fiscal_operation_line_id"
|
146
|
+
ref="l10n_br_fiscal.fo_compras_compras"
|
147
|
+
/>
|
148
|
+
<field name="date_planned" eval="time.strftime('%Y-%m-%d')" />
|
149
|
+
</record>
|
150
|
+
|
151
|
+
<function model="purchase.order.line" name="_onchange_product_id_fiscal">
|
152
|
+
<value eval="[ref('main_company-purchase_line_3_1')]" />
|
153
|
+
</function>
|
154
|
+
|
155
|
+
<record id="main_company-purchase_line_3_2" model="purchase.order.line">
|
156
|
+
<field name="order_id" ref="main_company-purchase_3" />
|
157
|
+
<field name="name">Drawer Black</field>
|
158
|
+
<field name="product_id" ref="product.product_product_16" />
|
159
|
+
<field name="product_qty">2</field>
|
160
|
+
<field name="product_uom" ref="uom.product_uom_unit" />
|
161
|
+
<field name="price_unit">50.00</field>
|
162
|
+
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_compras" />
|
163
|
+
<field
|
164
|
+
name="fiscal_operation_line_id"
|
165
|
+
ref="l10n_br_fiscal.fo_compras_compras"
|
166
|
+
/>
|
167
|
+
<field name="date_planned" eval="time.strftime('%Y-%m-%d')" />
|
168
|
+
</record>
|
169
|
+
|
170
|
+
<function model="purchase.order.line" name="_onchange_product_id_fiscal">
|
171
|
+
<value eval="[ref('main_company-purchase_line_3_2')]" />
|
172
|
+
</function>
|
173
|
+
|
174
|
+
<!-- Partner usado é o Contato de Entrega, a Fatura é criada com
|
175
|
+
o Partner do Pedido
|
176
|
+
-->
|
177
|
+
<record id="main_company-purchase_4" model="purchase.order">
|
178
|
+
<field
|
179
|
+
name="name"
|
180
|
+
>l10n_br_purchase - Contato do Endereço de Entrega Informado</field>
|
181
|
+
<field
|
182
|
+
name="partner_id"
|
183
|
+
ref="l10n_br_base.res_partner_cliente2_sp_end_entrega"
|
184
|
+
/>
|
185
|
+
<field name="state">draft</field>
|
186
|
+
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_compras" />
|
187
|
+
<field name="user_id" ref="base.user_admin" />
|
188
|
+
<field name="company_id" ref="base.main_company" />
|
189
|
+
</record>
|
190
|
+
|
191
|
+
<function model="purchase.order" name="_onchange_fiscal_operation_id">
|
192
|
+
<value eval="[ref('main_company-purchase_4')]" />
|
193
|
+
</function>
|
194
|
+
|
195
|
+
<record id="main_company-purchase_line_4_1" model="purchase.order.line">
|
196
|
+
<field name="order_id" ref="main_company-purchase_4" />
|
197
|
+
<field name="name">Office Chair Black</field>
|
198
|
+
<field name="product_id" ref="product.product_product_12" />
|
199
|
+
<field name="product_qty">4</field>
|
200
|
+
<field name="product_uom" ref="uom.product_uom_unit" />
|
201
|
+
<!-- Apesar do Preço ser defindo aqui o _onchange_product_id_fiscal altera o valor -->
|
202
|
+
<field name="price_unit">25.0</field>
|
203
|
+
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_compras" />
|
204
|
+
<field
|
205
|
+
name="fiscal_operation_line_id"
|
206
|
+
ref="l10n_br_fiscal.fo_compras_compras"
|
207
|
+
/>
|
208
|
+
<field name="date_planned" eval="time.strftime('%Y-%m-%d')" />
|
209
|
+
</record>
|
210
|
+
|
211
|
+
<function model="purchase.order.line" name="_onchange_product_id_fiscal">
|
212
|
+
<value eval="[ref('main_company-purchase_line_4_1')]" />
|
213
|
+
</function>
|
214
|
+
|
215
|
+
<record id="main_company-purchase_line_4_2" model="purchase.order.line">
|
216
|
+
<field name="order_id" ref="main_company-purchase_4" />
|
217
|
+
<field name="name">Drawer Black</field>
|
218
|
+
<field name="product_id" ref="product.product_product_16" />
|
219
|
+
<field name="product_qty">2</field>
|
220
|
+
<field name="product_uom" ref="uom.product_uom_unit" />
|
221
|
+
<field name="price_unit">50.00</field>
|
222
|
+
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_compras" />
|
223
|
+
<field
|
224
|
+
name="fiscal_operation_line_id"
|
225
|
+
ref="l10n_br_fiscal.fo_compras_compras"
|
226
|
+
/>
|
227
|
+
<field name="date_planned" eval="time.strftime('%Y-%m-%d')" />
|
228
|
+
</record>
|
229
|
+
|
230
|
+
<function model="purchase.order.line" name="_onchange_product_id_fiscal">
|
231
|
+
<value eval="[ref('main_company-purchase_line_4_2')]" />
|
232
|
+
</function>
|
233
|
+
|
234
|
+
<!-- Caso do Pedido com o Partner que tem um Contato com um Endereço de Entrega
|
235
|
+
a Fatura é criada com o Partner do Pedido -->
|
236
|
+
<record id="main_company-purchase_5" model="purchase.order">
|
237
|
+
<field
|
238
|
+
name="name"
|
239
|
+
>l10n_br_purchase - Partner que tem um Endereço de Entrega</field>
|
240
|
+
<field name="partner_id" ref="l10n_br_base.res_partner_cliente2_sp" />
|
241
|
+
<field name="state">draft</field>
|
242
|
+
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_compras" />
|
243
|
+
<field name="user_id" ref="base.user_admin" />
|
244
|
+
<field name="company_id" ref="base.main_company" />
|
245
|
+
</record>
|
246
|
+
|
247
|
+
<function model="purchase.order" name="_onchange_fiscal_operation_id">
|
248
|
+
<value eval="[ref('main_company-purchase_5')]" />
|
249
|
+
</function>
|
250
|
+
|
251
|
+
<record id="main_company-purchase_line_5_1" model="purchase.order.line">
|
252
|
+
<field name="order_id" ref="main_company-purchase_5" />
|
253
|
+
<field name="name">Office Chair Black</field>
|
254
|
+
<field name="product_id" ref="product.product_product_12" />
|
255
|
+
<field name="product_qty">4</field>
|
256
|
+
<field name="product_uom" ref="uom.product_uom_unit" />
|
257
|
+
<!-- Apesar do Preço ser defindo aqui o _onchange_product_id_fiscal altera o valor -->
|
258
|
+
<field name="price_unit">25.0</field>
|
259
|
+
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_compras" />
|
260
|
+
<field
|
261
|
+
name="fiscal_operation_line_id"
|
262
|
+
ref="l10n_br_fiscal.fo_compras_compras"
|
263
|
+
/>
|
264
|
+
<field name="date_planned" eval="time.strftime('%Y-%m-%d')" />
|
265
|
+
</record>
|
266
|
+
|
267
|
+
<function model="purchase.order.line" name="_onchange_product_id_fiscal">
|
268
|
+
<value eval="[ref('main_company-purchase_line_3_1')]" />
|
269
|
+
</function>
|
270
|
+
|
271
|
+
<record id="main_company-purchase_line_5_2" model="purchase.order.line">
|
272
|
+
<field name="order_id" ref="main_company-purchase_5" />
|
273
|
+
<field name="name">Drawer Black</field>
|
274
|
+
<field name="product_id" ref="product.product_product_16" />
|
275
|
+
<field name="product_qty">2</field>
|
276
|
+
<field name="product_uom" ref="uom.product_uom_unit" />
|
277
|
+
<field name="price_unit">50.00</field>
|
278
|
+
<field name="fiscal_operation_id" ref="l10n_br_fiscal.fo_compras" />
|
279
|
+
<field
|
280
|
+
name="fiscal_operation_line_id"
|
281
|
+
ref="l10n_br_fiscal.fo_compras_compras"
|
282
|
+
/>
|
283
|
+
<field name="date_planned" eval="time.strftime('%Y-%m-%d')" />
|
284
|
+
</record>
|
285
|
+
|
286
|
+
<function model="purchase.order.line" name="_onchange_product_id_fiscal">
|
287
|
+
<value eval="[ref('main_company-purchase_line_5_2')]" />
|
288
|
+
</function>
|
289
|
+
|
58
290
|
<!-- Empresa Lucro Presumido -->
|
59
291
|
<!-- Purchase Order with only products test -->
|
60
292
|
<record id="lp_po_only_products" model="purchase.order">
|
@@ -426,6 +426,16 @@ msgstr ""
|
|
426
426
|
msgid "Display Name"
|
427
427
|
msgstr ""
|
428
428
|
|
429
|
+
#. module: l10n_br_purchase
|
430
|
+
#: model:ir.model.fields,field_description:l10n_br_purchase.field_purchase_order__key_check_digit
|
431
|
+
msgid "Document Key Check Digit"
|
432
|
+
msgstr ""
|
433
|
+
|
434
|
+
#. module: l10n_br_purchase
|
435
|
+
#: model:ir.model.fields,field_description:l10n_br_purchase.field_purchase_order__key_random_code
|
436
|
+
msgid "Document Key Random Code"
|
437
|
+
msgstr ""
|
438
|
+
|
429
439
|
#. module: l10n_br_purchase
|
430
440
|
#: model:ir.model.fields,field_description:l10n_br_purchase.field_purchase_order__document_number
|
431
441
|
msgid "Document Number"
|
@@ -1592,6 +1602,11 @@ msgstr ""
|
|
1592
1602
|
msgid "Total"
|
1593
1603
|
msgstr ""
|
1594
1604
|
|
1605
|
+
#. module: l10n_br_purchase
|
1606
|
+
#: model:ir.model.fields,field_description:l10n_br_purchase.field_purchase_order__total_weight
|
1607
|
+
msgid "Total Weight"
|
1608
|
+
msgstr ""
|
1609
|
+
|
1595
1610
|
#. module: l10n_br_purchase
|
1596
1611
|
#: model:ir.model.fields,field_description:l10n_br_purchase.field_purchase_report__total_with_taxes
|
1597
1612
|
msgid "Total With Taxes"
|
@@ -432,6 +432,16 @@ msgstr "Valor do Desconto"
|
|
432
432
|
msgid "Display Name"
|
433
433
|
msgstr "Nome Exibido"
|
434
434
|
|
435
|
+
#. module: l10n_br_purchase
|
436
|
+
#: model:ir.model.fields,field_description:l10n_br_purchase.field_purchase_order__key_check_digit
|
437
|
+
msgid "Document Key Check Digit"
|
438
|
+
msgstr ""
|
439
|
+
|
440
|
+
#. module: l10n_br_purchase
|
441
|
+
#: model:ir.model.fields,field_description:l10n_br_purchase.field_purchase_order__key_random_code
|
442
|
+
msgid "Document Key Random Code"
|
443
|
+
msgstr ""
|
444
|
+
|
435
445
|
#. module: l10n_br_purchase
|
436
446
|
#: model:ir.model.fields,field_description:l10n_br_purchase.field_purchase_order__document_number
|
437
447
|
msgid "Document Number"
|
@@ -1603,6 +1613,11 @@ msgstr ""
|
|
1603
1613
|
msgid "Total"
|
1604
1614
|
msgstr "Total"
|
1605
1615
|
|
1616
|
+
#. module: l10n_br_purchase
|
1617
|
+
#: model:ir.model.fields,field_description:l10n_br_purchase.field_purchase_order__total_weight
|
1618
|
+
msgid "Total Weight"
|
1619
|
+
msgstr ""
|
1620
|
+
|
1606
1621
|
#. module: l10n_br_purchase
|
1607
1622
|
#: model:ir.model.fields,field_description:l10n_br_purchase.field_purchase_report__total_with_taxes
|
1608
1623
|
msgid "Total With Taxes"
|
@@ -116,3 +116,12 @@ class PurchaseOrder(models.Model):
|
|
116
116
|
}
|
117
117
|
)
|
118
118
|
return invoice_vals
|
119
|
+
|
120
|
+
def _get_fiscal_partner(self):
|
121
|
+
self.ensure_one()
|
122
|
+
partner = super()._get_fiscal_partner()
|
123
|
+
if partner.id != partner.address_get(["invoice"]).get("invoice"):
|
124
|
+
partner = self.env["res.partner"].browse(
|
125
|
+
partner.address_get(["invoice"]).get("invoice")
|
126
|
+
)
|
127
|
+
return partner
|
@@ -145,3 +145,12 @@ class PurchaseOrderLine(models.Model):
|
|
145
145
|
values.update(fiscal_values)
|
146
146
|
|
147
147
|
return values
|
148
|
+
|
149
|
+
def _get_fiscal_partner(self):
|
150
|
+
self.ensure_one()
|
151
|
+
partner = super()._get_fiscal_partner()
|
152
|
+
if partner.id != partner.address_get(["invoice"]).get("invoice"):
|
153
|
+
partner = self.env["res.partner"].browse(
|
154
|
+
partner.address_get(["invoice"]).get("invoice")
|
155
|
+
)
|
156
|
+
return partner
|
@@ -103,8 +103,8 @@ class PurchaseReport(models.Model):
|
|
103
103
|
, SUM(l.freight_value) as freight_value
|
104
104
|
, SUM(l.insurance_value) as insurance_value
|
105
105
|
, SUM(l.other_value) as other_value
|
106
|
-
, SUM(l.price_unit / COALESCE(NULLIF(po.currency_rate, 0), 1.0)
|
107
|
-
)::decimal(16,2)
|
106
|
+
, SUM(l.price_unit / COALESCE(NULLIF(po.currency_rate, 0), 1.0)
|
107
|
+
* l.product_qty )::decimal(16,2)
|
108
108
|
+ SUM(CASE WHEN l.ipi_value IS NULL THEN
|
109
109
|
0.00 ELSE l.ipi_value END)
|
110
110
|
+ SUM(CASE WHEN l.icmsst_value IS NULL THEN
|
@@ -367,7 +367,7 @@ ul.auto-toc {
|
|
367
367
|
!! This file is generated by oca-gen-addon-readme !!
|
368
368
|
!! changes will be overwritten. !!
|
369
369
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
370
|
-
!! source digest: sha256:
|
370
|
+
!! source digest: sha256:4669e2f2ad7e9b04c0a1d9efd13ef55b9c378ef3524710d1178252cf534ba4e7
|
371
371
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
|
372
372
|
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-brazil/tree/14.0/l10n_br_purchase"><img alt="OCA/l10n-brazil" src="https://img.shields.io/badge/github-OCA%2Fl10n--brazil-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_purchase"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/l10n-brazil&target_branch=14.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
|
373
373
|
<p>Este módulo integra a parte fiscal do módulo <tt class="docutils literal">l10n_br_fiscal</tt> com o módulo de compra purchase do Odoo. O módulo permite o cálculo dos impostos brasileiros já no pedido de compra e propaga a operação fiscal até a nota fiscal de compra, deixando ela com a tributação mais correta possível para seu financeiro (sendo que vocẽ poderia também importar o XML da nota depois).</p>
|
@@ -262,17 +262,20 @@ class L10nBrPurchaseBaseTest(SavepointCase):
|
|
262
262
|
self.assertEqual(
|
263
263
|
order.amount_freight_value,
|
264
264
|
invoice.amount_freight_value,
|
265
|
-
"Error field Amount Freight in Invoice are different from
|
265
|
+
"Error field Amount Freight in Invoice are different from "
|
266
|
+
"Purchase Order.",
|
266
267
|
)
|
267
268
|
self.assertEqual(
|
268
269
|
order.amount_insurance_value,
|
269
270
|
invoice.amount_insurance_value,
|
270
|
-
"Error field Amount Insurance in Invoice are different from
|
271
|
+
"Error field Amount Insurance in Invoice are different from "
|
272
|
+
"Purchase Order.",
|
271
273
|
)
|
272
274
|
self.assertEqual(
|
273
275
|
order.amount_other_value,
|
274
276
|
invoice.amount_other_value,
|
275
|
-
"Error field Amount Other Values in Invoice are different from
|
277
|
+
"Error field Amount Other Values in Invoice are different from "
|
278
|
+
"Purchase Order.",
|
276
279
|
)
|
277
280
|
|
278
281
|
for line in invoice.invoice_line_ids:
|
@@ -590,7 +593,9 @@ class L10nBrPurchaseBaseTest(SavepointCase):
|
|
590
593
|
)
|
591
594
|
|
592
595
|
def test_compatible_with_international_case(self):
|
593
|
-
"""
|
596
|
+
"""
|
597
|
+
Test of compatible with international case, create Invoice but not for Brazil.
|
598
|
+
"""
|
594
599
|
po_international = self.env.ref("purchase.purchase_order_1")
|
595
600
|
self._run_purchase_order_onchanges(po_international)
|
596
601
|
for line in po_international.order_line:
|
@@ -604,3 +609,140 @@ class L10nBrPurchaseBaseTest(SavepointCase):
|
|
604
609
|
invoice.fiscal_document_id,
|
605
610
|
"International case should not has Fiscal Document.",
|
606
611
|
)
|
612
|
+
|
613
|
+
def test_purchase_with_partner_to_invoice(self):
|
614
|
+
"""
|
615
|
+
Test Purchase Order with different Partner to Invoice.
|
616
|
+
"""
|
617
|
+
# Caso do Pedido criado com um Partner que possui um Partner to Invoice
|
618
|
+
purchase = self.env.ref("l10n_br_purchase.main_company-purchase_2")
|
619
|
+
self._run_purchase_order_onchanges(purchase)
|
620
|
+
for line in purchase.order_line:
|
621
|
+
self._run_purchase_line_onchanges(line)
|
622
|
+
purchase.with_context(tracking_disable=True).button_confirm()
|
623
|
+
self.assertEqual(purchase.state, "purchase", "Error to confirm Purchase Order.")
|
624
|
+
purchase.action_create_invoice()
|
625
|
+
for invoice in purchase.invoice_ids:
|
626
|
+
self.assertTrue(
|
627
|
+
invoice.fiscal_document_id,
|
628
|
+
"Fiscal Document missing for Purchase.",
|
629
|
+
)
|
630
|
+
partner_invoice = self.env["res.partner"].browse(
|
631
|
+
purchase.partner_id.address_get(["invoice"]).get("invoice")
|
632
|
+
)
|
633
|
+
self.assertEqual(
|
634
|
+
invoice.partner_id,
|
635
|
+
partner_invoice,
|
636
|
+
"The Invoice should be created with the Partner to Invoice",
|
637
|
+
)
|
638
|
+
self.assertNotEqual(
|
639
|
+
invoice.partner_id,
|
640
|
+
purchase.partner_id,
|
641
|
+
"The Invoice should not be created with the Partner of Purchase.",
|
642
|
+
)
|
643
|
+
|
644
|
+
# TODO: Deveria criar a Fatura com o Endereço de Entrega
|
645
|
+
# partner_shipping_id preenchido com o Partner do Pedido
|
646
|
+
# de Compra? Quando criado pelo Picking o campo é preenchido.
|
647
|
+
|
648
|
+
# self.assertEqual(
|
649
|
+
# invoice.partner_shipping_id,
|
650
|
+
# purchase.partner_id,
|
651
|
+
# "The Invoice should be created with Partner to Shipping.",
|
652
|
+
# )
|
653
|
+
|
654
|
+
purchase_2 = self.env.ref("l10n_br_purchase.main_company-purchase_3")
|
655
|
+
self._run_purchase_order_onchanges(purchase_2)
|
656
|
+
for line in purchase_2.order_line:
|
657
|
+
self._run_purchase_line_onchanges(line)
|
658
|
+
purchase_2.with_context(tracking_disable=True).button_confirm()
|
659
|
+
self.assertEqual(
|
660
|
+
purchase_2.state, "purchase", "Error to confirm Purchase Order."
|
661
|
+
)
|
662
|
+
purchase_2.action_create_invoice()
|
663
|
+
for invoice in purchase_2.invoice_ids:
|
664
|
+
self.assertTrue(
|
665
|
+
invoice.fiscal_document_id,
|
666
|
+
"Fiscal Document missing for Purchase.",
|
667
|
+
)
|
668
|
+
self.assertEqual(
|
669
|
+
invoice.partner_id,
|
670
|
+
purchase_2.partner_id,
|
671
|
+
"The Partner in Purchase and Invoice should be the same.",
|
672
|
+
)
|
673
|
+
# O partner_shipping_id aqui também é vazio, deveria ser preenchido?
|
674
|
+
# self.assertEqual(
|
675
|
+
# invoice.partner_shipping_id,
|
676
|
+
# purchase_2.partner_id,
|
677
|
+
# "The Invoice should be created with Partner to Shipping.",
|
678
|
+
# )
|
679
|
+
|
680
|
+
def test_purchase_with_partner_to_shipping(self):
|
681
|
+
"""Test brazilian Purchase Order with Partner to Shipping."""
|
682
|
+
|
683
|
+
# Caso do Pedido criado com o Contato de Entrega/Partner to Delivery
|
684
|
+
purchase = self.env.ref("l10n_br_purchase.main_company-purchase_4")
|
685
|
+
self._run_purchase_order_onchanges(purchase)
|
686
|
+
for line in purchase.order_line:
|
687
|
+
self._run_purchase_line_onchanges(line)
|
688
|
+
purchase.with_context(tracking_disable=True).button_confirm()
|
689
|
+
self.assertEqual(purchase.state, "purchase", "Error to confirm Purchase Order.")
|
690
|
+
purchase.action_create_invoice()
|
691
|
+
for invoice in purchase.invoice_ids:
|
692
|
+
self.assertTrue(
|
693
|
+
invoice.fiscal_document_id,
|
694
|
+
"Fiscal Document missing for Purchase.",
|
695
|
+
)
|
696
|
+
# TODO: Campo partner_shipping_id está vazio
|
697
|
+
# deveria estar preenchido?
|
698
|
+
# self.assertEqual(
|
699
|
+
# invoice.partner_shipping_id,
|
700
|
+
# purchase.partner_id,
|
701
|
+
# "The Invoice should be created with the Partner to Shipping",
|
702
|
+
# )
|
703
|
+
self.assertNotEqual(
|
704
|
+
invoice.partner_id,
|
705
|
+
purchase.partner_id,
|
706
|
+
"The Invoice should not be created with the Partner of Purchase.",
|
707
|
+
)
|
708
|
+
# TODO: Deveria criar a Fatura com o Endereço de Entrega
|
709
|
+
# partner_shipping_id preenchido com o Partner do Pedido
|
710
|
+
# de Compra? Quando criado pelo Picking o campo é preenchido.
|
711
|
+
|
712
|
+
# self.assertEqual(
|
713
|
+
# invoice.partner_shipping_id,
|
714
|
+
# purchase.partner_id,
|
715
|
+
# "The Invoice should be created with Partner to Shipping.",
|
716
|
+
# )
|
717
|
+
|
718
|
+
# Caso do Pedido criado com o Partner que tem um Contato de Entrega
|
719
|
+
purchase_2 = self.env.ref("l10n_br_purchase.main_company-purchase_5")
|
720
|
+
self._run_purchase_order_onchanges(purchase_2)
|
721
|
+
for line in purchase_2.order_line:
|
722
|
+
self._run_purchase_line_onchanges(line)
|
723
|
+
purchase_2.with_context(tracking_disable=True).button_confirm()
|
724
|
+
self.assertEqual(
|
725
|
+
purchase_2.state, "purchase", "Error to confirm Purchase Order."
|
726
|
+
)
|
727
|
+
purchase_2.action_create_invoice()
|
728
|
+
|
729
|
+
for invoice in purchase_2.invoice_ids:
|
730
|
+
self.assertTrue(
|
731
|
+
invoice.fiscal_document_id,
|
732
|
+
"Fiscal Document missing for Purchase.",
|
733
|
+
)
|
734
|
+
self.assertEqual(
|
735
|
+
invoice.partner_id,
|
736
|
+
purchase_2.partner_id,
|
737
|
+
"The Partner in Purchase and Invoice should be the same.",
|
738
|
+
)
|
739
|
+
# TODO: O partner_shipping_id aqui também é vazio,
|
740
|
+
# deveria ser preenchido?
|
741
|
+
# partner_delivery = self.env["res.partner"].browse(
|
742
|
+
# purchase.partner_id.address_get(["delivery"]).get("delivery")
|
743
|
+
# )
|
744
|
+
# self.assertEqual(
|
745
|
+
# invoice.partner_shipping_id,
|
746
|
+
# partner_delivery,
|
747
|
+
# "The Invoice should be created with Partner to Shipping.",
|
748
|
+
# )
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: odoo14-addon-l10n_br_purchase
|
3
|
-
Version: 14.0.3.
|
3
|
+
Version: 14.0.3.11.1.dev2
|
4
4
|
Summary: Brazilian Localization Purchase
|
5
5
|
Home-page: https://github.com/OCA/l10n-brazil
|
6
6
|
Author: Akretion, Odoo Community Association (OCA)
|
@@ -12,7 +12,7 @@ Classifier: Framework :: Odoo :: 14.0
|
|
12
12
|
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
|
13
13
|
Requires-Python: >=3.6
|
14
14
|
Requires-Dist: odoo14-addon-l10n-br-account
|
15
|
-
Requires-Dist: odoo
|
15
|
+
Requires-Dist: odoo<14.1dev,>=14.0a
|
16
16
|
|
17
17
|
===============================
|
18
18
|
Brazilian Localization Purchase
|
@@ -23,7 +23,7 @@ Brazilian Localization Purchase
|
|
23
23
|
!! This file is generated by oca-gen-addon-readme !!
|
24
24
|
!! changes will be overwritten. !!
|
25
25
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
26
|
-
!! source digest: sha256:
|
26
|
+
!! source digest: sha256:4669e2f2ad7e9b04c0a1d9efd13ef55b9c378ef3524710d1178252cf534ba4e7
|
27
27
|
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
|
28
28
|
|
29
29
|
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
|
@@ -1,19 +1,19 @@
|
|
1
|
-
odoo/addons/l10n_br_purchase/README.rst,sha256=
|
1
|
+
odoo/addons/l10n_br_purchase/README.rst,sha256=EEmSHN9CpLd1d2n_arfDqa51HaPaj_JAGLSldVT222A,4661
|
2
2
|
odoo/addons/l10n_br_purchase/__init__.py,sha256=otut1R_8C8Cn2BBP2RL7BuAOxh5lmp_IS7y3RRVaB9Q,189
|
3
|
-
odoo/addons/l10n_br_purchase/__manifest__.py,sha256=
|
3
|
+
odoo/addons/l10n_br_purchase/__manifest__.py,sha256=tdhUVZVb3udK96-dgV4rIIEVw_xli0NNZ5FTTU3s-S8,984
|
4
4
|
odoo/addons/l10n_br_purchase/hooks.py,sha256=3GN_Du26GiftKrN2hpHc9qLuaVieZiJ43KBgH4w-52I,2276
|
5
5
|
odoo/addons/l10n_br_purchase/data/company.xml,sha256=VWD3A_MPASRZJDTRmXtEFQhg0_pZvGeSvhMdH4OCDz8,251
|
6
6
|
odoo/addons/l10n_br_purchase/demo/company.xml,sha256=vsl1dse3q_o-T6BOF9xH8PhdAWsRosTvsNg_gPQuyoM,435
|
7
7
|
odoo/addons/l10n_br_purchase/demo/fiscal_operation_generic.xml,sha256=u0wELeMZZhPg5L1mzajJgkC9UrY-zhA-45RusIqj1gA,2353
|
8
8
|
odoo/addons/l10n_br_purchase/demo/fiscal_operation_simple.xml,sha256=_6TWFX2mjGQd-CYLUCJ4ut1yfdxN83Ytj6JRkyOe3yE,4478
|
9
|
-
odoo/addons/l10n_br_purchase/demo/l10n_br_purchase.xml,sha256=
|
9
|
+
odoo/addons/l10n_br_purchase/demo/l10n_br_purchase.xml,sha256=pmK4DdTsudsn2f5OnVzacVzPpl0OTHSZQO-3YL-0plY,22659
|
10
10
|
odoo/addons/l10n_br_purchase/demo/product.xml,sha256=G3zWdPH2nD-T6-XnZs8lKLsxhvYmrEWcPe8eMBWkWcw,533
|
11
|
-
odoo/addons/l10n_br_purchase/i18n/l10n_br_purchase.pot,sha256=
|
12
|
-
odoo/addons/l10n_br_purchase/i18n/pt_BR.po,sha256=
|
11
|
+
odoo/addons/l10n_br_purchase/i18n/l10n_br_purchase.pot,sha256=haUvYNzjBsaXcfqTVkM6GYpzIoBao7_HdW07Oo-Jsxs,58823
|
12
|
+
odoo/addons/l10n_br_purchase/i18n/pt_BR.po,sha256=owjhWOu6jhPRJgLWcal29GVDfhR0majVBUPG5DTceZQ,100534
|
13
13
|
odoo/addons/l10n_br_purchase/models/__init__.py,sha256=85CiHJxY9R005w2ekoNraLzhQ08XZLfQE1LSts09xeU,227
|
14
14
|
odoo/addons/l10n_br_purchase/models/account_move.py,sha256=fYSjUp8X9mMRndBI_BhJ-9b6UJIRG9I_4WFJ3y1Ct5M,853
|
15
|
-
odoo/addons/l10n_br_purchase/models/purchase_order.py,sha256=
|
16
|
-
odoo/addons/l10n_br_purchase/models/purchase_order_line.py,sha256=
|
15
|
+
odoo/addons/l10n_br_purchase/models/purchase_order.py,sha256=fz64_YWWlOvxnL93mWCePJd5p155Na1Lgc24nYHgtlo,3902
|
16
|
+
odoo/addons/l10n_br_purchase/models/purchase_order_line.py,sha256=fx0zHWbjy8ipnk_L3mwJGNjxH_8YiBmb2raQj537FjI,5157
|
17
17
|
odoo/addons/l10n_br_purchase/models/res_company.py,sha256=FrngXbae8RCDyHWakEj5SGcIAizYLt2xDRRoRRfCgT4,446
|
18
18
|
odoo/addons/l10n_br_purchase/readme/CONFIGURE.rst,sha256=WbTbr9WipjAVnsWCwzCAGIbIAv4uYO4GJWKUObG5djo,27
|
19
19
|
odoo/addons/l10n_br_purchase/readme/CONTRIBUTORS.rst,sha256=noSnflerh0x89yVjgKWscvIPmCT_F5jym9l9BfQjseM,223
|
@@ -25,17 +25,17 @@ odoo/addons/l10n_br_purchase/readme/ROADMAP.rst,sha256=47DEQpj8HBSa-_TImW-5JCeuQ
|
|
25
25
|
odoo/addons/l10n_br_purchase/readme/USAGE.rst,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
26
26
|
odoo/addons/l10n_br_purchase/reports/__init__.py,sha256=Vo7RrdNixdgYZP0pDwOai51fKgqjCH7D45WBlWkhRxg,96
|
27
27
|
odoo/addons/l10n_br_purchase/reports/purchase_order_templates.xml,sha256=EPKe7Wpksi29P9YjvR8rk_euENajs5ubNsDZtDHcP2g,2179
|
28
|
-
odoo/addons/l10n_br_purchase/reports/purchase_report.py,sha256=
|
28
|
+
odoo/addons/l10n_br_purchase/reports/purchase_report.py,sha256=8__lndYGggTJ8uhSi9fQUSh837dTmWznlvEX-Hm4wqA,3769
|
29
29
|
odoo/addons/l10n_br_purchase/reports/purchase_report_views.xml,sha256=ZgGZJWRHhKPR4MoGuhnXf1Abtay3QCV-kQygUZjKAjs,1988
|
30
30
|
odoo/addons/l10n_br_purchase/security/ir.model.access.csv,sha256=bQTfw--GEMiRE1M1ix-VIydrBHN8Oz5XTJBezsJP57w,822
|
31
31
|
odoo/addons/l10n_br_purchase/static/description/icon.png,sha256=b1uvDtIAslueuduSrxm6miLy_X1RYXmIayt7E1j8t6I,18092
|
32
|
-
odoo/addons/l10n_br_purchase/static/description/index.html,sha256=
|
32
|
+
odoo/addons/l10n_br_purchase/static/description/index.html,sha256=Fnb7nNDbx-SMyakPZ81b0KHTOgJL5_t2Jj3fUv0dI7A,16056
|
33
33
|
odoo/addons/l10n_br_purchase/tests/__init__.py,sha256=b6lLV1OD86vong8P8jX13fhE0J1vF3uq95qVf6HdT28,145
|
34
|
-
odoo/addons/l10n_br_purchase/tests/test_l10n_br_purchase.py,sha256=
|
34
|
+
odoo/addons/l10n_br_purchase/tests/test_l10n_br_purchase.py,sha256=Rjz_WEln7_4QtUsxuLQ5umxsnLwA_qKzbDur0sbO5Y4,29710
|
35
35
|
odoo/addons/l10n_br_purchase/tests/test_l10n_br_purchase_sn.py,sha256=t4x-A1BHrRmlNIBkPzx6HAmXoPYU0GxC8qjQJ1BzadA,426
|
36
36
|
odoo/addons/l10n_br_purchase/views/purchase_view.xml,sha256=sSvT0Wi16DclmQ-AOmw7I8zpHYqvhBeFdGyFPacPG60,12124
|
37
37
|
odoo/addons/l10n_br_purchase/views/res_company_view.xml,sha256=3wDcVAq5jfYVyEYR8HK2CqTmiKCfcTnaS7ynMINA2NM,789
|
38
|
-
odoo14_addon_l10n_br_purchase-14.0.3.
|
39
|
-
odoo14_addon_l10n_br_purchase-14.0.3.
|
40
|
-
odoo14_addon_l10n_br_purchase-14.0.3.
|
41
|
-
odoo14_addon_l10n_br_purchase-14.0.3.
|
38
|
+
odoo14_addon_l10n_br_purchase-14.0.3.11.1.dev2.dist-info/METADATA,sha256=QsmL_ferpbqR133ueic1Ep-XzxfL3CkJ2mvdGGRv8n8,5231
|
39
|
+
odoo14_addon_l10n_br_purchase-14.0.3.11.1.dev2.dist-info/WHEEL,sha256=eOLhNAGa2EW3wWl_TU484h7q1UNgy0JXjjoqKoxAAQc,92
|
40
|
+
odoo14_addon_l10n_br_purchase-14.0.3.11.1.dev2.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
|
41
|
+
odoo14_addon_l10n_br_purchase-14.0.3.11.1.dev2.dist-info/RECORD,,
|