Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[16.0][MIG] l10n_br_sale_stock #3532

Open
wants to merge 243 commits into
base: 16.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
243 commits
Select commit Hold shift + click to select a range
0ecd813
[MIGR][l10n_br_sale_stock] extracted product_packaging module in new …
rvalyi Jan 3, 2013
ce692e3
[MIGR] finalização do módulo l10n_br_sale_stock e correções do l10n_b…
renatonlima Jan 16, 2013
1668350
Formatação do código dos modulos l10n_br_account, l10n_br_base, l10n_…
renatonlima Jan 19, 2013
5d102c6
[MIGR] l10n_br_sale, l10n_br_sale_stock e l10n_br_account: migração d…
renatonlima Jan 23, 2013
c910f81
formatação do código PEP8
renatonlima Jan 29, 2013
08032f6
[MIGR] Formatação do código PEP8, corrigida visões do modulo l10n_br_…
renatonlima Feb 4, 2013
fa7bef0
[MIGR] trocadas chaves update_xml, init_xml por data e demo_xml por d…
renatonlima Feb 11, 2013
715b493
[MERGE] migração do módulo l10n_br_sale_stock para versão 7.0
renatonlima Apr 16, 2013
b2f8903
[FIX] Incluído módulo l10n_br_stock na dependência do módulo l10n_br_…
renatonlima May 25, 2013
4bdaf8d
Corrigido relatório de análise de vendas
renatonlima Jun 10, 2013
e84d318
Incluido recurso para permitir incluir observações nas classificações…
renatonlima Jun 27, 2013
0424e80
Alterado o nome de alguns módulos para deixar mais legível
renatonlima Aug 30, 2013
92f2a2c
l10n_br_stock, l10n_br_sale_stock, l10n_br_purchase: Geração de docum…
renatonlima Sep 5, 2013
503b7c0
Adicionado arquivos de tradução vazios pt_BR.po para evitar mensagens…
renatonlima Dec 12, 2013
e32466e
Atualização das versões dos módulos
renatonlima Dec 12, 2013
3a53a1a
[REF] Refatorado objetos e visões no módulo l10n_br_sale_stock
renatonlima Dec 13, 2013
dc11641
[FIX] Calculo dos impostos e dados de demostração
renatonlima Dec 19, 2013
a42dd50
default sale operation should be set in sale, not sale_stock
rvalyi Dec 22, 2013
aceb0da
moved data arround to get sale on_change tests passing but in the l10…
rvalyi Dec 24, 2013
dc33172
converting l10n_br_sale and l10n_br_sale_stock to web_context_tunnel …
rvalyi Dec 25, 2013
c1e2493
pick a product with taxes and ensure sale order lines get the taxes
rvalyi Dec 25, 2013
0eaca0f
manually complete the context before on_change is played in YAML test…
rvalyi Dec 25, 2013
f1e795f
l10n_br_sale_stock: creating delivery from test sale order, and creat…
rvalyi Jan 22, 2014
1079605
[FIX] Corrigido testes do módulo l10n_br_sale_stock para não tentar f…
renatonlima Jan 24, 2014
e808033
[FIX] Corrigido testes do módulo l10n_br_sale_stock
renatonlima Jan 24, 2014
e6c9831
minor optimization
rvalyi Feb 9, 2014
e7aade9
[REF] moved and refactored _make_invoice so it can now stays in l10n_…
rvalyi Feb 10, 2014
715e0fe
[REF] WARNING moved default 'Venda' fiscal category to l10n_br_accoun…
rvalyi Feb 10, 2014
8795ea6
Revert "[REF] WARNING moved default 'Venda' fiscal category to l10n_b…
renatonlima Feb 12, 2014
cc116d8
Movido o arquivo de teste do demo para o test no __openerp__.py
renatonlima Feb 12, 2014
5fd68d0
re-activated tests for Travis-CI
rvalyi Mar 9, 2014
4599acb
updated tests for new demo data
rvalyi Mar 9, 2014
5f1cdae
Corrigido erros de digitação e adicionado traduções aos módulos
danimaribeiro Mar 12, 2014
ba43b04
[FIX] formatação das visões no l10n_br_sale_stock
renatonlima Mar 14, 2014
103600f
Iniciado copiar métodos dos módulos l10n_br_sale e l10n_br_sale_stock…
renatonlima Mar 14, 2014
4c1f5a5
Inicio da extração dos campos e métodos do módulo l10n_br_sale para o…
renatonlima Mar 15, 2014
3c6f736
Extraido métodos do módulo l10n_br_delivery para o novo módulo l10n_b…
renatonlima Mar 15, 2014
9c42418
[NEW][FIX] Criação dos campos fiscal position e fiscal category na cl…
mileo Apr 2, 2014
203bc0f
[NEW] Incluindo posições fiscais das linhas das vendas nas linhas do …
mileo May 3, 2014
22734f7
[REF][NEW][DEL] Criação dos on changes no stock.move dos pickings, re…
mileo May 13, 2014
b16e957
Adicionados arquivos README.md para descrição dos módulos
renatonlima Oct 22, 2014
da87d04
[MIGRATION] initial commit to new branch 8.0 before migration
renatonlima Oct 22, 2014
db02ccb
[MOV] move addons out of __unported__ (they remain not installable)
sbidoul Oct 13, 2015
81f8e2a
[FIX] sale_analysis_report
ananiasfilho Nov 16, 2015
d993f25
set l10n_br_sale_stock module as installable
renatonlima Oct 25, 2014
a91f282
update metadata
renatonlima Oct 25, 2014
6996dc1
change dependency
renatonlima Oct 25, 2014
08f8d6e
comment data file
renatonlima Oct 25, 2014
5b0ccde
migrate sale.order object to new API
renatonlima Oct 27, 2014
7dd7b59
migrate stock objects and view to new API
renatonlima Oct 27, 2014
48e5f6e
update yml test file
renatonlima Oct 27, 2014
da85d9f
added new inherit class procurement.order to copy fiscal info in stoc…
renatonlima Oct 30, 2014
0bd2f04
copy incoterm
renatonlima Jan 14, 2015
a0f057e
migration to 8.0
renatonlima Mar 11, 2015
6c53db7
moved models and views to a folder as new pattern and replace uncodin…
renatonlima Mar 11, 2015
f04fea1
pep8 hopefully cleared
rvalyi Oct 21, 2015
6412e57
changed version, add README.rst and README.md
renatonlima Nov 23, 2015
90473ef
remove empty file
renatonlima Nov 23, 2015
81a45b0
remove ir.model.access record to unused model
renatonlima Nov 23, 2015
b782b79
set l10n_br_sale_stock module as installable
renatonlima Oct 25, 2014
fd6db6c
update metadata
renatonlima Oct 25, 2014
8ec7869
comment data file
renatonlima Oct 25, 2014
496e6e4
migrate stock objects and view to new API
renatonlima Oct 27, 2014
f84eae7
added new inherit class procurement.order to copy fiscal info in stoc…
renatonlima Oct 30, 2014
056ee84
copy incoterm
renatonlima Jan 14, 2015
85b5e6b
migration to 8.0
renatonlima Mar 11, 2015
ed191ca
moved models and views to a folder as new pattern and replace uncodin…
renatonlima Mar 11, 2015
aa28ad7
pep8 hopefully cleared
rvalyi Oct 21, 2015
b0ad0a0
set l10n_br_sale_stock module as installable
renatonlima Oct 25, 2014
66096a5
update metadata
renatonlima Oct 25, 2014
e42b5d9
migrate stock objects and view to new API
renatonlima Oct 27, 2014
5bd1d2c
added new inherit class procurement.order to copy fiscal info in stoc…
renatonlima Oct 30, 2014
b0ea8af
copy incoterm
renatonlima Jan 14, 2015
c72d8ca
migration to 8.0
renatonlima Mar 11, 2015
f32857b
moved models and views to a folder as new pattern and replace uncodin…
renatonlima Mar 11, 2015
e5d09e5
pep8 hopefully cleared
rvalyi Oct 21, 2015
e07eab5
remove empty file
renatonlima Nov 23, 2015
9484706
remove ir.model.access record to unused model
renatonlima Nov 23, 2015
01a6399
fix tests and refactoring methods in stock.picking
renatonlima Dec 1, 2015
1c1bf89
fix test
renatonlima Jan 22, 2016
6a0cb23
pep8
renatonlima Jan 22, 2016
bd8854f
changed version, add README.rst and README.md
renatonlima Nov 23, 2015
d888220
[REF] Replace tabs with spaces
mileo Jul 19, 2016
7e7a494
lighter new style OCA license headers
rvalyi Aug 15, 2016
b996f0f
[MIG] Make modules uninstallable
renatonlima Dec 2, 2016
a03df11
[MIG] Rename manifest files
renatonlima Dec 6, 2016
1ac20f6
Update l10n_br_sale_stock
renatonlima May 29, 2020
292733a
[ADD] readme files
renatonlima May 29, 2020
cc9228d
[MIGR] manifest
renatonlima May 29, 2020
b1b2540
[MIGR] models
renatonlima May 29, 2020
b05c9dd
Rename file
renatonlima May 29, 2020
6852e09
[MIGR] l10n_br_stock_account sale order
renatonlima Jun 1, 2020
70fa880
[MIGR] l10n_br_sale_stock cleanup
renatonlima Jun 14, 2020
fd855ec
[MIGR] demo data
renatonlima Aug 24, 2020
ac00fc7
[FIX] Deprecated yml
DiegoParadeda Sep 23, 2020
1056227
[FIX] Typo
DiegoParadeda Sep 23, 2020
e68334d
[ADD] Freight value from sale order line to stock move
DiegoParadeda Sep 24, 2020
8774440
[ADD] Tax fields, insurance and other_costs from sale order line to s…
DiegoParadeda Sep 24, 2020
fa79332
[ADD] ALL fields from sale order line to stock move
DiegoParadeda Sep 24, 2020
c184e07
[ADD] Tests
DiegoParadeda Sep 25, 2020
8cf0797
[ADD] Author + remove coding utf-8
DiegoParadeda Sep 29, 2020
e202095
[RMV] Unused view
DiegoParadeda Sep 29, 2020
a35bcaf
[FIX] Flake 8
DiegoParadeda Sep 29, 2020
816274d
[ADD] Creation of stock_picking with correct fiscal settings
gabrielcardoso21 Nov 4, 2020
e16a9b6
[ADD] Link invoices from stock.picking to sale.order
gabrielcardoso21 Nov 5, 2020
d08ddb8
[ADD] Get price from sale_order_line
gabrielcardoso21 Nov 11, 2020
2626eac
[FIX] Flake8
gabrielcardoso21 Nov 13, 2020
eaa0431
[FIX] Test
gabrielcardoso21 Nov 13, 2020
3ce834c
[REM] File procurement.py
gabrielcardoso21 Nov 16, 2020
b403cfc
[ADD] Contributor
gabrielcardoso21 Nov 16, 2020
a7cd2aa
[FIX] Readme
marcelsavegnago Nov 16, 2020
6cfb69e
[IMP] Load invoice_state in new backorder
gabrielcardoso21 Nov 26, 2020
7fa887f
[IMP] Invoice pickings to be invoiced before invoice sale order
gabrielcardoso21 Nov 26, 2020
70239c2
[FIX] invoice.ids
mileo Nov 26, 2020
5af6392
[FIX] Error 'There is no invoiceable line'
gabrielcardoso21 Nov 27, 2020
1abee4b
[FIX] Fiscal values in picking with backorder
gabrielcardoso21 Nov 27, 2020
38dafdb
[ADD] Maintainer
gabrielcardoso21 Nov 27, 2020
6ac9d91
[NEW] Tradução
mileo Nov 27, 2020
262f7d6
[UPD] Update l10n_br_sale_stock.pot
oca-travis Nov 27, 2020
46bcf32
[ADD] icon.png
OCA-git-bot Nov 27, 2020
ff6eaea
Update translation files
oca-transbot Dec 1, 2020
ad1977e
[FIX] _simulate_invoice_line_onchange method
renatonlima Feb 12, 2021
7fcae90
l10n_br_sale_stock 12.0.1.0.1
OCA-git-bot Feb 12, 2021
2aa906e
[WIP] Commented code to avoid error in travis, refactor are done in s…
mbcosta Feb 12, 2021
a7d6328
l10n_br_sale_stock 12.0.2.0.0
OCA-git-bot Feb 19, 2021
68bd5df
[REF] Included a parameter to define Sale Create Invoice Policy.
mbcosta Feb 2, 2021
b8d6ab0
[REM] Method in l10n_br_stock_account to be useful for Sale and Purch…
mbcosta Feb 2, 2021
7efb767
[REF+FIX] Creation of stock move with Fiscal Data.
mbcosta Feb 2, 2021
7cdafd8
[FIX+REF] Name class, remove field with copy=True because it already …
mbcosta Feb 2, 2021
cf664be
[REM] Method in l10n_br_stock_account to be useful for Sale and Purch…
mbcosta Feb 2, 2021
0419a19
[REM] Field sale_line_id it is informed in stock_picking_invocing met…
mbcosta Feb 2, 2021
1f77d84
[REF] When Sale Order check if Payment Term is different from default…
mbcosta Feb 2, 2021
f151212
[IMP] Demo data with case of Partner Shipping different from Invoice.
mbcosta Feb 2, 2021
c962249
[FIX] PEP8.
mbcosta Feb 8, 2021
1f336d9
[REF] Method to get Sale Price.
mbcosta Feb 12, 2021
a9dff77
[REM] Unnecessary method.
mbcosta Feb 12, 2021
56d61c4
[REF] Ungrouped stock.move with sale_line_id and update dictionary us…
mbcosta Feb 12, 2021
907b4e5
[IMP] Demo data, different Fiscal Operation that should not be grouping.
mbcosta Feb 12, 2021
30e0753
[IMP] Demo data, test grouping pickings.
mbcosta Feb 19, 2021
ce05a37
[IMP] Tests grouping pickings and fields should be using from Sale Or…
mbcosta Feb 19, 2021
317b4f5
[FIX] Check if move has sale_line_id field.
mbcosta Feb 22, 2021
4164e6a
[FIX] Update header copyright
renatonlima Feb 22, 2021
1738f9a
[FIX] Update module maintainers
renatonlima Feb 22, 2021
2975eee
[UPD] Update l10n_br_sale_stock.pot
oca-travis Mar 1, 2021
78ef2c2
[UPD] README.rst
OCA-git-bot Mar 1, 2021
5c8e564
l10n_br_sale_stock 12.0.3.0.0
OCA-git-bot Mar 1, 2021
761963b
[REF] Created compute field to make invisible button Create Invoice, …
mbcosta Mar 5, 2021
b1614a2
[FIX] If Sale Create Invoice Policy are stock_picking should be not p…
mbcosta Mar 5, 2021
22ffaa1
[REF] Changed product used for test Service because invoice_policy ar…
mbcosta Mar 5, 2021
ffd242c
[IMP] Test create invoice from sale order with product and service.
mbcosta Mar 5, 2021
608c533
[FIX] l10n_br_sale: flake8
marcelsavegnago Mar 7, 2021
30833d9
l10n_br_sale_stock: faster CI with SavepointCase
rvalyi Mar 10, 2021
b5fb00d
[UPD] Update l10n_br_sale_stock.pot
oca-travis Mar 10, 2021
32593ce
l10n_br_sale_stock 12.0.4.0.0
OCA-git-bot Mar 10, 2021
c869a01
[FIX] Check fields used to mapping Fiscal values in the tests.
mbcosta Mar 11, 2021
214e2a6
Remove dict key
renatonlima Mar 2, 2021
502ed1f
l10n_br_sale_stock 12.0.5.0.0
OCA-git-bot Mar 12, 2021
f193c2e
[IMP] Test devolution picking process.
mbcosta Mar 15, 2021
406f60c
[FIX+REF] Make possible translation and better widget
mbcosta Mar 15, 2021
a30c464
[FIX] Import order.
mbcosta Mar 16, 2021
9abc27d
[UPD] Update l10n_br_sale_stock.pot
oca-travis Mar 16, 2021
639f7d4
l10n_br_sale_stock 12.0.5.1.0
OCA-git-bot Mar 16, 2021
a08c584
[FIX] There are two buttons 'Create Invoice' in Sale Order and both s…
mbcosta Mar 17, 2021
4aabff5
[FIX] Specific module order installation to run the tests.
mbcosta Mar 18, 2021
907bef3
[FIX] Tests, after devolution picking the qty_invoiced should be zero.
mbcosta Mar 24, 2021
985b2c1
l10n_br_sale_stock 12.0.5.2.0
OCA-git-bot Mar 24, 2021
82ac895
[FIX] Sale Order create invoice button attr
renatonlima Mar 30, 2021
cbe5cf6
l10n_br_sale_stock 12.0.5.2.1
OCA-git-bot Apr 1, 2021
bfa7252
l10n_br_sale_stock 12.0.5.2.2
OCA-git-bot Apr 8, 2021
d487e2a
remove useless default @api.multi
rvalyi May 16, 2021
e4466bd
[REF] l10n_br_sale_stock lint compute method name
mileo May 24, 2021
dc92318
l10n_br_sale_stock 12.0.5.3.0
OCA-git-bot May 25, 2021
73568af
lint: sed -i 's/assertEquals/assertEqual/g'
rvalyi May 25, 2021
189eceb
[REF] Standard OCA website l10n_br_sale_stock
mileo May 30, 2021
04a13ca
[IMP] l10n_br_sale_stock: black, isort, prettier
rvalyi Jun 7, 2021
b4f07f1
E741 ambiguous variable name 'l'
rvalyi Jun 9, 2021
aa208ed
B902 Invalid 1st arg 'self' used for class method
rvalyi Jun 9, 2021
816823d
[FIX] check if sale_id.note is false
renatonlima Jun 30, 2021
bf6a6e3
l10n_br_sale_stock 12.0.5.3.1
OCA-git-bot Jul 1, 2021
af08307
[FIX] Test, field price_unit can be changed after Confimed stock.pick…
mbcosta Jul 15, 2021
058b952
[fix] manual additional data in views and demo
antoniospneto Jul 27, 2021
9eace33
l10n_br_sale_stock 12.0.5.4.0
OCA-git-bot Jul 27, 2021
2f33ccf
fix tests
antoniospneto Sep 28, 2021
1e266ee
[FIX] l10n_br_sale_stock: Concatenation of Sale Note and Customer Add…
mbcosta Feb 22, 2022
cbaa633
l10n_br_sale_stock 12.0.5.4.1
OCA-git-bot Feb 23, 2022
aa136b3
[REF] Synchronize Sale Partner Shipping in Stock Picking.
mbcosta Mar 24, 2022
795dffa
l10n_br_sale_stock 12.0.5.4.2
OCA-git-bot Mar 24, 2022
f9a5a7d
[MIG] l10n_br_sale_stock: Migration to 13.0
renatonlima Jun 5, 2022
df7ac8c
[MIG] l10n_br_sale_stock: Migration to 14.0
renatonlima Jun 5, 2022
1fe1438
[MIG] Object account.invoice and account.invoice.line become account.…
mbcosta Jan 20, 2022
90e1a52
[MIG] Because of the changed in method _get_new_picking_values are ne…
mbcosta Jan 20, 2022
547235d
[MIG] l10n_br_sale_stock: since v14 the inherit method always return …
mbcosta Sep 13, 2022
33db1d1
[MIG+IMP] l10n_br_sale_stock: Demo data and Tests the case of Lucro P…
mbcosta Sep 13, 2022
eb1caa0
[UPD] Update l10n_br_sale_stock.pot
Sep 16, 2022
569f620
[UPD] README.rst
OCA-git-bot Sep 16, 2022
5b5ccab
[REF] Context better using kwargs l10n_br_sale_stock
mileo Oct 21, 2022
3508522
[REF] attribute-string-redundant l10n_br_sale_stock
mileo Oct 21, 2022
255d918
l10n_br_sale_stock 14.0.1.0.1
OCA-git-bot Oct 22, 2022
fae4761
[REF] missing-return l10n_br_sale_stock
mileo Oct 22, 2022
12b19b4
l10n_br_sale_stock 14.0.1.0.2
OCA-git-bot Oct 22, 2022
be7c07b
[UPD] README.rst
OCA-git-bot Sep 3, 2023
bc8e94d
[FIX] l10n_br_sale_stock: Get fields Incoterm and Payment Mode from S…
mbcosta Sep 4, 2023
18edef9
l10n_br_sale_stock 14.0.1.1.0
OCA-git-bot Sep 5, 2023
275b784
[UPD] README.rst
OCA-git-bot Sep 5, 2023
0280d77
[REF] l10n_br_sale_stock: Demo Data avoid error when MRP module are i…
mbcosta Sep 9, 2023
06c1b5a
l10n_br_sale_stock 14.0.1.1.1
OCA-git-bot Sep 9, 2023
862d27c
[UPD] README.rst
OCA-git-bot Sep 9, 2023
06b51a0
Update translation files
weblate Oct 9, 2023
ada682d
[REF] l10n_br_sale_stock: Remove empty Lines, necessary for the new v…
mbcosta Oct 25, 2023
79fe669
[REF] l10n_br_sale_stock: Avoid error Flake8 E741 ambiguous variable …
mbcosta Oct 25, 2023
f80adfa
[BOT] post-merge updates
OCA-git-bot Oct 27, 2023
db4d36c
[BOT] post-merge updates
OCA-git-bot Oct 27, 2023
edb0f45
[IMP] l10n_br_sale_stock: get analytic account and analytic tags from…
marcelsavegnago Nov 23, 2023
0cb8383
[BOT] post-merge updates
OCA-git-bot Nov 25, 2023
1069387
[FIX] l10n_br_sale_stock: There no more field uom_id in account.move.…
mbcosta Oct 19, 2023
8330217
[BOT] post-merge updates
OCA-git-bot Nov 30, 2023
392af51
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Jan 2, 2024
f5bef56
[FIX] commission tests
DiegoParadeda Sep 19, 2023
0767f9a
[REF] l10n_br_sale_stock: Removed unnecessary onchanges in Demo Data.
mbcosta Jan 17, 2024
5891916
[BOT] post-merge updates
OCA-git-bot Jan 19, 2024
59ac8fe
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 6, 2024
aec43b4
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 6, 2024
6a7d95e
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 6, 2024
440fa00
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 9, 2024
c2f4f3a
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 22, 2024
b92d188
Translated using Weblate (Portuguese (Brazil))
May 20, 2024
d769168
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Jul 29, 2024
435aec7
[REF] l10n_br_sale_stock: Reduced duplicate Tests
mbcosta Aug 23, 2024
5b4d071
[BOT] post-merge updates
OCA-git-bot Aug 25, 2024
dedb9a7
[FIX] l10n_br_sale_stock: Case without Fiscal OP
mbcosta Aug 29, 2024
d928480
[BOT] post-merge updates
OCA-git-bot Aug 30, 2024
e1d06af
[FIX] l10n_br_sale_stock: proper partner_id
mbcosta Jan 9, 2024
8e4f289
[FIX] l10n_br_sale_stock: partner_invoice_id fix
mbcosta Jan 9, 2024
3ce07b5
[BOT] post-merge updates
OCA-git-bot Sep 26, 2024
c99da49
[FIX] l10n_br_sale_stock: Get Default OP Fiscal
mbcosta Aug 29, 2024
ddc6ff3
[IMP] l10n_br_sale_stock: Tests
mbcosta Aug 29, 2024
70edb6b
[FIX] l10n_br_sale_stock: _get_fiscal_partner method return integer i…
WesleyOliveira98 Oct 2, 2024
a9f8c0f
[BOT] post-merge updates
OCA-git-bot Oct 2, 2024
a4de61e
[BOT] post-merge updates
OCA-git-bot Oct 4, 2024
985dd3b
[MIG] l10n_br_sale_stock: Migration to 15.0
antoniospneto Sep 18, 2024
43a895c
[IMP] l10n_br_sale_stock: pre-commit stuff
antoniospneto Dec 7, 2024
703b7e5
[MIG] l10n_br_sale_stock: Migration to 16.0
antoniospneto Sep 18, 2024
62d1148
trabalho em andamento
antoniospneto Sep 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 19 additions & 24 deletions l10n_br_account/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -282,6 +282,7 @@ def _get_view(self, view_id=None, view_type="form", **options):
"line_ids.full_reconcile_id",
"state",
"ind_final",
"fiscal_operation_id",
)
def _compute_amount(self):
for move in self.filtered(lambda m: m.fiscal_operation_id):
Expand All @@ -301,6 +302,7 @@ def _compute_amount(self):
sign = 1
inv_line_ids = move.line_ids.filtered(
lambda line: line.display_type == "product"
and (not line.cfop_id or line.cfop_id.finance_move)
)
move.amount_untaxed = sum(inv_line_ids.mapped("amount_untaxed"))
move.amount_tax = sum(inv_line_ids.mapped("amount_tax"))
Expand All @@ -322,9 +324,14 @@ def _compute_needed_terms(self):
"""
Similar to the _compute_needed_terms super method in the account module,
but ensure moves are balanced in Brazil when there is a fiscal_operation_id.
WARNING: it seems we might not be able to call the super method here....
"""
for invoice in self:
res = None
invoices_with_fiscal_op = self.filtered(lambda inv: inv.fiscal_operation_id)
invoices_without_fiscal_op = self - invoices_with_fiscal_op
if invoices_without_fiscal_op:
res = super(AccountMove, invoices_without_fiscal_op)._compute_needed_terms()

for invoice in invoices_with_fiscal_op:
is_draft = invoice.id != invoice._origin.id
invoice.needed_terms = {}
invoice.needed_terms_dirty = True
Expand All @@ -339,31 +346,18 @@ def _compute_needed_terms(self):
pass
else:
untaxed_amount_currency += line.price_subtotal
for tax_result in (line.compute_all_tax or {}).values():
tax_amount_currency += -sign * tax_result.get(
"amount_currency", 0.0
)
for tax_result in (line.compute_all_tax or {}).values():
tax_amount_currency += -sign * tax_result.get(
"amount_currency", 0.0
)
untaxed_amount = untaxed_amount_currency
tax_amount = tax_amount_currency
else:
tax_amount_currency = invoice.amount_tax * sign
tax_amount = invoice.amount_tax_signed
if invoice.fiscal_operation_id:
if invoice.fiscal_operation_id.deductible_taxes:
amount_currency = (
invoice.amount_total
+ invoice.amount_tax_withholding
)
else:
amount_currency = (
invoice.amount_total - invoice.amount_ipi_value
) * sign
untaxed_amount_currency = amount_currency * sign
untaxed_amount = amount_currency * sign

else:
untaxed_amount_currency = invoice.amount_untaxed * sign
untaxed_amount = invoice.amount_untaxed_signed
tax_amount_currency = tax_amount = 0.0
# TODO forçando o compute
# invoice._compute_amount()
untaxed_amount_currency = invoice.amount_financial_total * sign
untaxed_amount = invoice.amount_financial_total * sign
invoice_payment_terms = (
invoice.invoice_payment_term_id._compute_terms(
date_ref=invoice.invoice_date
Expand Down Expand Up @@ -419,6 +413,7 @@ def _compute_needed_terms(self):
"balance": invoice.amount_total_signed,
"amount_currency": invoice.amount_total_in_currency_signed,
}
return res

@contextmanager
def _sync_dynamic_lines(self, container):
Expand Down
74 changes: 56 additions & 18 deletions l10n_br_account/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,20 @@ def changed(fname):
else: # BRAZIL CASE:
if line.cfop_id and not line.cfop_id.finance_move:
unsigned_amount_currency = 0
if not line.move_id.fiscal_operation_id.deductible_taxes:
# Quando não há financeiro, mas há imposto, e não há
# dedutíveis, é necessário registrar a contrapartida dos
# impostos para equilibrar o balanço. Na versão 14, essa
# diferença era automaticamente alocada às contas dos
# termos de pagamento.
# TODO:
# o correto mesmo seria não lançar os impostos nesse caso,
# resolver depois.
unsigned_amount_currency = -(
line.amount_tax_included
+ line.amount_tax_not_included
- line.amount_tax_withholding
)
else:
if line.move_id.fiscal_operation_id.deductible_taxes:
unsigned_amount_currency = (
Expand All @@ -312,19 +326,30 @@ def changed(fname):
)
unsigned_amount_currency = line.currency_id.round(
amount_total
- (
line.amount_tax_included
- line.amount_tax_withholding
)
- line.amount_tax_included
- line.amount_tax_not_included
- line.icms_relief_value
if line.tax_ids
else amount_total
)
amount_currency = unsigned_amount_currency * line.move_id.direction_sign
if line.amount_currency != amount_currency or line not in before:
line.amount_currency = amount_currency
if line.currency_id == line.company_id.currency_id:
line.balance = amount_currency

# Os totais nas linhas foram atualizadas, mas o total da fatura
# não foi recalculado automaticamente, já que o método compute_amount
# não foi acionado após as alterações nas linhas.
# Por esse motivo, estou adicionando manualmente os campos no
# add_to_compute do account_move.
# Questão: Por que o compute_amount não foi acionado automaticamente?
# Isso ocorre apenas quando os valores são diretamente informados
# no create? Realizar um teste isolado para confirmar esse
# comportamento.
move_id = line.move_id
self.env.add_to_compute(move_id._fields["amount_total"], move_id)
self.env.add_to_compute(move_id._fields["amount_untaxed"], move_id)

after = existing()
for line in after:
if (
Expand Down Expand Up @@ -394,7 +419,6 @@ def _compute_totals(self):

line.price_subtotal = taxes_res["total_excluded"]
line.price_total = taxes_res["total_included"]
line._compute_balance()

line.price_total += (
line.insurance_value
Expand Down Expand Up @@ -521,19 +545,33 @@ def _onchange_fiscal_document_line_id(self):
# override the default product uom (set by the onchange):
self.product_uom_id = self.fiscal_document_line_id.uom_id.id

@api.onchange("fiscal_tax_ids")
def _onchange_fiscal_tax_ids(self):
"""Ao alterar o campo fiscal_tax_ids que contém os impostos fiscais,
são atualizados os impostos contábeis relacionados"""
result = super()._onchange_fiscal_tax_ids()
@api.depends("product_id", "product_uom_id", "fiscal_tax_ids")
def _compute_tax_ids(self):
# Adding 'fiscal_tax_ids' as a dependency to ensure that the taxes
# are recalculated when this field changes.
return super()._compute_tax_ids()

def _get_computed_taxes(self):
"""
Override the native method to load taxes from the fiscal module.
"""
self.ensure_one()

# Atualiza os impostos contábeis relacionados aos impostos fiscais
user_type = "sale"
if self.move_id.move_type in ("in_invoice", "in_refund"):
# If no fiscal operation is defined, fallback to the default implementation.
if not self.fiscal_operation_id:
return super()._get_computed_taxes()

# Determine the user type based on the document type.
user_type = None
if self.move_id.is_sale_document(include_receipts=True):
user_type = "sale"
elif self.move_id.is_purchase_document(include_receipts=True):
user_type = "purchase"

self.tax_ids = self.fiscal_tax_ids.account_taxes(
user_type=user_type, fiscal_operation=self.fiscal_operation_id
)
# Retrieve taxes based on user type and fiscal operation.
if user_type:
tax_ids = self.fiscal_tax_ids.account_taxes(
user_type=user_type, fiscal_operation=self.fiscal_operation_id
)

return result
return tax_ids
30 changes: 16 additions & 14 deletions l10n_br_account/tests/test_account_move_lc.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,8 +666,8 @@ def test_simples_remessa(self):
"price_total": 1050.0,
"tax_line_id": False,
"currency_id": self.company_data["currency"].id,
"amount_currency": 0.0,
"debit": 0.0,
"amount_currency": 206.5,
"debit": 206.5,
"credit": 0.0,
"date_maturity": False,
}
Expand Down Expand Up @@ -775,6 +775,8 @@ def test_simples_remessa(self):
"date_maturity": False,
}

# Remessa não gera financeiro, as linhas das condições de pagamento
# devem estar zeradas!
term_line_vals_1 = {
"name": "",
"product_id": False,
Expand All @@ -789,8 +791,8 @@ def test_simples_remessa(self):
"tax_ids": [],
"tax_line_id": False,
"currency_id": self.company_data["currency"].id,
"amount_currency": 206.5,
"debit": 206.5,
"amount_currency": 0,
"debit": 0,
"credit": 0.0,
"date_maturity": fields.Date.from_string("2019-01-01"),
}
Expand All @@ -803,9 +805,9 @@ def test_simples_remessa(self):
"fiscal_position_id": False,
"payment_reference": "",
"invoice_payment_term_id": self.pay_terms_a.id,
"amount_untaxed": 1000,
"amount_tax": 50,
"amount_total": 206.5,
"amount_untaxed": 0.0,
"amount_tax": 0.0,
"amount_total": 0.0,
}

self.assertInvoiceValues(
Expand Down Expand Up @@ -1271,8 +1273,8 @@ def test_simples_remessa_tax_withholding(self):
"price_total": 1050.0,
"tax_line_id": False,
"currency_id": self.company_data["currency"].id,
"amount_currency": 0.0,
"debit": 0.0,
"amount_currency": 133.5,
"debit": 133.5,
"credit": 0.0,
"date_maturity": False,
}
Expand Down Expand Up @@ -1390,8 +1392,8 @@ def test_simples_remessa_tax_withholding(self):
"tax_ids": [],
"tax_line_id": False,
"currency_id": self.company_data["currency"].id,
"amount_currency": 133.5,
"debit": 133.5,
"amount_currency": 0.0,
"debit": 0.0,
"credit": 0.0,
"date_maturity": fields.Date.from_string("2019-01-01"),
}
Expand All @@ -1404,9 +1406,9 @@ def test_simples_remessa_tax_withholding(self):
"fiscal_position_id": False,
"payment_reference": "",
"invoice_payment_term_id": self.pay_terms_a.id,
"amount_untaxed": 1000.0, # FIXME is this correct for a simples remessa??
"amount_tax": 50.0,
"amount_total": 133.5,
"amount_untaxed": 0.0,
"amount_tax": 0.0,
"amount_total": 0.0,
}

self.assertInvoiceValues(
Expand Down
35 changes: 18 additions & 17 deletions l10n_br_account/tests/test_invoice_refund.py
Original file line number Diff line number Diff line change
Expand Up @@ -109,18 +109,19 @@ def test_refund(self):
with self.assertRaises(UserError):
move_reversal.reverse_moves()

invoice["fiscal_operation_id"] = (self.env.ref("l10n_br_fiscal.fo_venda").id,)
invoice.fiscal_operation_id = self.env.ref("l10n_br_fiscal.fo_venda")

with self.assertRaises(UserError):
move_reversal.reverse_moves()

for line_id in invoice.invoice_line_ids:
line_id["fiscal_operation_id"] = (
self.env.ref("l10n_br_fiscal.fo_venda").id,
)
line_id["fiscal_operation_line_id"] = self.env.ref(
"l10n_br_fiscal.fo_venda_venda"
).id
invoice.invoice_line_ids.write(
{
"fiscal_operation_id": self.env.ref("l10n_br_fiscal.fo_venda").id,
"fiscal_operation_line_id": (
self.env.ref("l10n_br_fiscal.fo_venda_venda").id,
),
}
)

reversal = move_reversal.reverse_moves()
reverse_move = self.env["account.move"].browse(reversal["res_id"])
Expand All @@ -137,15 +138,15 @@ def test_refund_force_fiscal_operation(self):
reverse_vals = self.reverse_vals
invoice = self.invoice

invoice["fiscal_operation_id"] = (self.env.ref("l10n_br_fiscal.fo_venda").id,)

for line_id in invoice.invoice_line_ids:
line_id["fiscal_operation_id"] = (
self.env.ref("l10n_br_fiscal.fo_venda").id,
)
line_id["fiscal_operation_line_id"] = self.env.ref(
"l10n_br_fiscal.fo_venda_venda"
).id
invoice.fiscal_operation_id = self.env.ref("l10n_br_fiscal.fo_venda")
invoice.invoice_line_ids.write(
{
"fiscal_operation_id": self.env.ref("l10n_br_fiscal.fo_venda").id,
"fiscal_operation_line_id": self.env.ref(
"l10n_br_fiscal.fo_venda_venda"
).id,
}
)

invoice.action_post()
self.assertEqual(
Expand Down
1 change: 1 addition & 0 deletions l10n_br_fiscal/models/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -337,6 +337,7 @@ def _compute_name(self):
r.name = r._compute_document_name()

@api.depends(
"fiscal_line_ids",
"fiscal_line_ids.estimate_tax",
"fiscal_line_ids.price_gross",
"fiscal_line_ids.amount_untaxed",
Expand Down
16 changes: 9 additions & 7 deletions l10n_br_fiscal/models/document_line_mixin_methods.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,27 +127,29 @@ def _get_view(self, view_id=None, view_type="form", **options):
"company_id",
"price_unit",
"quantity",
"icms_relief_id",
"fiscal_operation_line_id",
)
def _compute_fiscal_amounts(self):
for record in self:
round_curr = record.currency_id or self.env.ref("base.BRL")

# Total value of products or services
record.price_gross = round_curr.round(record.price_unit * record.quantity)

record.amount_untaxed = record.price_gross - record.discount_value

record.amount_fiscal = record.price_gross - record.discount_value

record.amount_tax = record.amount_tax_not_included

add_to_amount = sum(record[a] for a in record._add_fields_to_amount())
rm_to_amount = sum(record[r] for r in record._rm_fields_to_amount())
record.amount_untaxed = (
record.price_gross
- record.discount_value
+ add_to_amount
- rm_to_amount
)

# Valor do documento (NF)
record.amount_total = (
record.amount_untaxed + record.amount_tax + add_to_amount - rm_to_amount
)
record.amount_total = record.amount_untaxed + record.amount_tax

# Valor Liquido (TOTAL + IMPOSTOS - RETENÇÕES)
record.amount_taxed = record.amount_total - record.amount_tax_withholding
Expand Down
20 changes: 8 additions & 12 deletions l10n_br_fiscal/models/tax.py
Original file line number Diff line number Diff line change
Expand Up @@ -699,19 +699,15 @@ def compute_taxes(self, **kwargs):
except AttributeError:
taxes[tax.tax_domain].update(tax._compute_tax(tax, taxes, **kwargs))

if taxes[tax.tax_domain]["tax_include"]:
result_amounts["amount_included"] += taxes[tax.tax_domain].get(
"tax_value", 0.00
)
tax_domain = taxes[tax.tax_domain]
tax_value = tax_domain.get("tax_value", 0.00)
if tax_domain["tax_withholding"]:
result_amounts["amount_withholding"] += tax_value
else:
result_amounts["amount_not_included"] += taxes[tax.tax_domain].get(
"tax_value", 0.00
)

if taxes[tax.tax_domain]["tax_withholding"]:
result_amounts["amount_withholding"] += taxes[tax.tax_domain].get(
"tax_value", 0.00
)
if tax_domain["tax_include"]:
result_amounts["amount_included"] += tax_value
else:
result_amounts["amount_not_included"] += tax_value

# Estimate taxes
result_amounts["estimate_tax"] = self._compute_estimate_taxes(**kwargs)
Expand Down
Loading
Loading