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

Draft
wants to merge 243 commits into
base: 16.0
Choose a base branch
from
Draft
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
0abc69d
[MIGR][l10n_br_sale_stock] extracted product_packaging module in new …
rvalyi Jan 3, 2013
cf4e97b
[MIGR] finalização do módulo l10n_br_sale_stock e correções do l10n_b…
renatonlima Jan 16, 2013
7e511ce
Formatação do código dos modulos l10n_br_account, l10n_br_base, l10n_…
renatonlima Jan 19, 2013
6e906c2
[MIGR] l10n_br_sale, l10n_br_sale_stock e l10n_br_account: migração d…
renatonlima Jan 23, 2013
3ac07af
formatação do código PEP8
renatonlima Jan 29, 2013
d45a4d2
[MIGR] Formatação do código PEP8, corrigida visões do modulo l10n_br_…
renatonlima Feb 4, 2013
a9bb82b
[MIGR] trocadas chaves update_xml, init_xml por data e demo_xml por d…
renatonlima Feb 11, 2013
7087d61
[MERGE] migração do módulo l10n_br_sale_stock para versão 7.0
renatonlima Apr 16, 2013
ed72420
[FIX] Incluído módulo l10n_br_stock na dependência do módulo l10n_br_…
renatonlima May 25, 2013
d3a9957
Corrigido relatório de análise de vendas
renatonlima Jun 10, 2013
400c11e
Incluido recurso para permitir incluir observações nas classificações…
renatonlima Jun 27, 2013
76eb743
Alterado o nome de alguns módulos para deixar mais legível
renatonlima Aug 30, 2013
dcd100d
l10n_br_stock, l10n_br_sale_stock, l10n_br_purchase: Geração de docum…
renatonlima Sep 5, 2013
8799c33
Adicionado arquivos de tradução vazios pt_BR.po para evitar mensagens…
renatonlima Dec 12, 2013
0693fec
Atualização das versões dos módulos
renatonlima Dec 12, 2013
92c8cad
[REF] Refatorado objetos e visões no módulo l10n_br_sale_stock
renatonlima Dec 13, 2013
641c006
[FIX] Calculo dos impostos e dados de demostração
renatonlima Dec 19, 2013
54fe901
default sale operation should be set in sale, not sale_stock
rvalyi Dec 22, 2013
14e398d
moved data arround to get sale on_change tests passing but in the l10…
rvalyi Dec 24, 2013
70eeaaf
converting l10n_br_sale and l10n_br_sale_stock to web_context_tunnel …
rvalyi Dec 25, 2013
34a010e
pick a product with taxes and ensure sale order lines get the taxes
rvalyi Dec 25, 2013
3b3c87b
manually complete the context before on_change is played in YAML test…
rvalyi Dec 25, 2013
988f59d
l10n_br_sale_stock: creating delivery from test sale order, and creat…
rvalyi Jan 22, 2014
2bce5c9
[FIX] Corrigido testes do módulo l10n_br_sale_stock para não tentar f…
renatonlima Jan 24, 2014
b94e016
[FIX] Corrigido testes do módulo l10n_br_sale_stock
renatonlima Jan 24, 2014
d07bd1b
minor optimization
rvalyi Feb 9, 2014
2f80778
[REF] moved and refactored _make_invoice so it can now stays in l10n_…
rvalyi Feb 10, 2014
ea6ebae
[REF] WARNING moved default 'Venda' fiscal category to l10n_br_accoun…
rvalyi Feb 10, 2014
71fa302
Revert "[REF] WARNING moved default 'Venda' fiscal category to l10n_b…
renatonlima Feb 12, 2014
37adbac
Movido o arquivo de teste do demo para o test no __openerp__.py
renatonlima Feb 12, 2014
65313b4
re-activated tests for Travis-CI
rvalyi Mar 9, 2014
a376548
updated tests for new demo data
rvalyi Mar 9, 2014
c6ffb12
Corrigido erros de digitação e adicionado traduções aos módulos
danimaribeiro Mar 12, 2014
f2696af
[FIX] formatação das visões no l10n_br_sale_stock
renatonlima Mar 14, 2014
69eab41
Iniciado copiar métodos dos módulos l10n_br_sale e l10n_br_sale_stock…
renatonlima Mar 14, 2014
88c9e8d
Inicio da extração dos campos e métodos do módulo l10n_br_sale para o…
renatonlima Mar 15, 2014
c212a0e
Extraido métodos do módulo l10n_br_delivery para o novo módulo l10n_b…
renatonlima Mar 15, 2014
07887c2
[NEW][FIX] Criação dos campos fiscal position e fiscal category na cl…
mileo Apr 2, 2014
ec7e20d
[NEW] Incluindo posições fiscais das linhas das vendas nas linhas do …
mileo May 3, 2014
2f140dc
[REF][NEW][DEL] Criação dos on changes no stock.move dos pickings, re…
mileo May 13, 2014
9d52dd5
Adicionados arquivos README.md para descrição dos módulos
renatonlima Oct 22, 2014
cf742ea
[MIGRATION] initial commit to new branch 8.0 before migration
renatonlima Oct 22, 2014
0d2d43c
[MOV] move addons out of __unported__ (they remain not installable)
sbidoul Oct 13, 2015
630fc41
[FIX] sale_analysis_report
ananiasfilho Nov 16, 2015
1b82dfe
set l10n_br_sale_stock module as installable
renatonlima Oct 25, 2014
a7601cc
update metadata
renatonlima Oct 25, 2014
87a26a9
change dependency
renatonlima Oct 25, 2014
b32b7e2
comment data file
renatonlima Oct 25, 2014
d9aa1fa
migrate sale.order object to new API
renatonlima Oct 27, 2014
e1d97ad
migrate stock objects and view to new API
renatonlima Oct 27, 2014
ecb50fc
update yml test file
renatonlima Oct 27, 2014
0c5e309
added new inherit class procurement.order to copy fiscal info in stoc…
renatonlima Oct 30, 2014
13a38b2
copy incoterm
renatonlima Jan 14, 2015
4be8e7c
migration to 8.0
renatonlima Mar 11, 2015
09773ab
moved models and views to a folder as new pattern and replace uncodin…
renatonlima Mar 11, 2015
6019ea4
pep8 hopefully cleared
rvalyi Oct 21, 2015
9921a61
changed version, add README.rst and README.md
renatonlima Nov 23, 2015
cc7c971
remove empty file
renatonlima Nov 23, 2015
7db843c
remove ir.model.access record to unused model
renatonlima Nov 23, 2015
a3f07c3
set l10n_br_sale_stock module as installable
renatonlima Oct 25, 2014
849ad03
update metadata
renatonlima Oct 25, 2014
61241fe
comment data file
renatonlima Oct 25, 2014
4c502f0
migrate stock objects and view to new API
renatonlima Oct 27, 2014
ba0d007
added new inherit class procurement.order to copy fiscal info in stoc…
renatonlima Oct 30, 2014
614cfee
copy incoterm
renatonlima Jan 14, 2015
c70746d
migration to 8.0
renatonlima Mar 11, 2015
629d884
moved models and views to a folder as new pattern and replace uncodin…
renatonlima Mar 11, 2015
e91337c
pep8 hopefully cleared
rvalyi Oct 21, 2015
3302e14
set l10n_br_sale_stock module as installable
renatonlima Oct 25, 2014
2609cda
update metadata
renatonlima Oct 25, 2014
a6a6ecb
migrate stock objects and view to new API
renatonlima Oct 27, 2014
45ba399
added new inherit class procurement.order to copy fiscal info in stoc…
renatonlima Oct 30, 2014
1cb4173
copy incoterm
renatonlima Jan 14, 2015
c0a705a
migration to 8.0
renatonlima Mar 11, 2015
85bdcd6
moved models and views to a folder as new pattern and replace uncodin…
renatonlima Mar 11, 2015
3355343
pep8 hopefully cleared
rvalyi Oct 21, 2015
fcc7884
remove empty file
renatonlima Nov 23, 2015
ab97859
remove ir.model.access record to unused model
renatonlima Nov 23, 2015
dae31ef
fix tests and refactoring methods in stock.picking
renatonlima Dec 1, 2015
b8f86c8
fix test
renatonlima Jan 22, 2016
b9d7030
pep8
renatonlima Jan 22, 2016
c311bf3
changed version, add README.rst and README.md
renatonlima Nov 23, 2015
ac9b8e8
[REF] Replace tabs with spaces
mileo Jul 19, 2016
7f635ce
lighter new style OCA license headers
rvalyi Aug 15, 2016
e1a857a
[MIG] Make modules uninstallable
renatonlima Dec 2, 2016
6abfd31
[MIG] Rename manifest files
renatonlima Dec 6, 2016
71bb9d0
Update l10n_br_sale_stock
renatonlima May 29, 2020
7cff156
[ADD] readme files
renatonlima May 29, 2020
432d96a
[MIGR] manifest
renatonlima May 29, 2020
f7dc39b
[MIGR] models
renatonlima May 29, 2020
ab77ed1
Rename file
renatonlima May 29, 2020
b4b6330
[MIGR] l10n_br_stock_account sale order
renatonlima Jun 1, 2020
c84e16c
[MIGR] l10n_br_sale_stock cleanup
renatonlima Jun 14, 2020
27e9328
[MIGR] demo data
renatonlima Aug 24, 2020
048e3a7
[FIX] Deprecated yml
DiegoParadeda Sep 23, 2020
ab4d789
[FIX] Typo
DiegoParadeda Sep 23, 2020
d113e8d
[ADD] Freight value from sale order line to stock move
DiegoParadeda Sep 24, 2020
d4cd755
[ADD] Tax fields, insurance and other_costs from sale order line to s…
DiegoParadeda Sep 24, 2020
7e074f9
[ADD] ALL fields from sale order line to stock move
DiegoParadeda Sep 24, 2020
b34988f
[ADD] Tests
DiegoParadeda Sep 25, 2020
3e9952e
[ADD] Author + remove coding utf-8
DiegoParadeda Sep 29, 2020
b760542
[RMV] Unused view
DiegoParadeda Sep 29, 2020
bde4117
[FIX] Flake 8
DiegoParadeda Sep 29, 2020
c2ad7e1
[ADD] Creation of stock_picking with correct fiscal settings
gabrielcardoso21 Nov 4, 2020
e5dda73
[ADD] Link invoices from stock.picking to sale.order
gabrielcardoso21 Nov 5, 2020
6ccc475
[ADD] Get price from sale_order_line
gabrielcardoso21 Nov 11, 2020
c3d3cd7
[FIX] Flake8
gabrielcardoso21 Nov 13, 2020
c58a182
[FIX] Test
gabrielcardoso21 Nov 13, 2020
f1848c9
[REM] File procurement.py
gabrielcardoso21 Nov 16, 2020
8726a72
[ADD] Contributor
gabrielcardoso21 Nov 16, 2020
acc5eff
[FIX] Readme
marcelsavegnago Nov 16, 2020
4849ba1
[IMP] Load invoice_state in new backorder
gabrielcardoso21 Nov 26, 2020
c9ae119
[IMP] Invoice pickings to be invoiced before invoice sale order
gabrielcardoso21 Nov 26, 2020
6b6a91c
[FIX] invoice.ids
mileo Nov 26, 2020
4c7e871
[FIX] Error 'There is no invoiceable line'
gabrielcardoso21 Nov 27, 2020
38245fc
[FIX] Fiscal values in picking with backorder
gabrielcardoso21 Nov 27, 2020
18558eb
[ADD] Maintainer
gabrielcardoso21 Nov 27, 2020
cf23cd3
[NEW] Tradução
mileo Nov 27, 2020
8d12a13
[UPD] Update l10n_br_sale_stock.pot
oca-travis Nov 27, 2020
9ed6760
[ADD] icon.png
OCA-git-bot Nov 27, 2020
99e956d
Update translation files
oca-transbot Dec 1, 2020
decdc5f
[FIX] _simulate_invoice_line_onchange method
renatonlima Feb 12, 2021
14aa9df
l10n_br_sale_stock 12.0.1.0.1
OCA-git-bot Feb 12, 2021
75ce2b1
[WIP] Commented code to avoid error in travis, refactor are done in s…
mbcosta Feb 12, 2021
0d7a80c
l10n_br_sale_stock 12.0.2.0.0
OCA-git-bot Feb 19, 2021
e97b1f9
[REF] Included a parameter to define Sale Create Invoice Policy.
mbcosta Feb 2, 2021
24cc2c5
[REM] Method in l10n_br_stock_account to be useful for Sale and Purch…
mbcosta Feb 2, 2021
0f7bd0e
[REF+FIX] Creation of stock move with Fiscal Data.
mbcosta Feb 2, 2021
c69dfe8
[FIX+REF] Name class, remove field with copy=True because it already …
mbcosta Feb 2, 2021
1fb1ee1
[REM] Method in l10n_br_stock_account to be useful for Sale and Purch…
mbcosta Feb 2, 2021
de84e7a
[REM] Field sale_line_id it is informed in stock_picking_invocing met…
mbcosta Feb 2, 2021
ad9d996
[REF] When Sale Order check if Payment Term is different from default…
mbcosta Feb 2, 2021
d659334
[IMP] Demo data with case of Partner Shipping different from Invoice.
mbcosta Feb 2, 2021
c34e040
[FIX] PEP8.
mbcosta Feb 8, 2021
1c9b8b6
[REF] Method to get Sale Price.
mbcosta Feb 12, 2021
0fb494b
[REM] Unnecessary method.
mbcosta Feb 12, 2021
fe8648e
[REF] Ungrouped stock.move with sale_line_id and update dictionary us…
mbcosta Feb 12, 2021
306f0e4
[IMP] Demo data, different Fiscal Operation that should not be grouping.
mbcosta Feb 12, 2021
67c6f0e
[IMP] Demo data, test grouping pickings.
mbcosta Feb 19, 2021
00c1456
[IMP] Tests grouping pickings and fields should be using from Sale Or…
mbcosta Feb 19, 2021
d0f0a25
[FIX] Check if move has sale_line_id field.
mbcosta Feb 22, 2021
08e4804
[FIX] Update header copyright
renatonlima Feb 22, 2021
dccebc6
[FIX] Update module maintainers
renatonlima Feb 22, 2021
b896e8b
[UPD] Update l10n_br_sale_stock.pot
oca-travis Mar 1, 2021
8e40c38
[UPD] README.rst
OCA-git-bot Mar 1, 2021
dceff3a
l10n_br_sale_stock 12.0.3.0.0
OCA-git-bot Mar 1, 2021
5260b89
[REF] Created compute field to make invisible button Create Invoice, …
mbcosta Mar 5, 2021
70e4233
[FIX] If Sale Create Invoice Policy are stock_picking should be not p…
mbcosta Mar 5, 2021
95daa66
[REF] Changed product used for test Service because invoice_policy ar…
mbcosta Mar 5, 2021
28008ff
[IMP] Test create invoice from sale order with product and service.
mbcosta Mar 5, 2021
d01f7d7
[FIX] l10n_br_sale: flake8
marcelsavegnago Mar 7, 2021
5ceac72
l10n_br_sale_stock: faster CI with SavepointCase
rvalyi Mar 10, 2021
c2c7681
[UPD] Update l10n_br_sale_stock.pot
oca-travis Mar 10, 2021
ad3777f
l10n_br_sale_stock 12.0.4.0.0
OCA-git-bot Mar 10, 2021
7e6064a
[FIX] Check fields used to mapping Fiscal values in the tests.
mbcosta Mar 11, 2021
198db48
Remove dict key
renatonlima Mar 2, 2021
f57eb12
l10n_br_sale_stock 12.0.5.0.0
OCA-git-bot Mar 12, 2021
5b386e8
[IMP] Test devolution picking process.
mbcosta Mar 15, 2021
999a9fd
[FIX+REF] Make possible translation and better widget
mbcosta Mar 15, 2021
d5fe44b
[FIX] Import order.
mbcosta Mar 16, 2021
d42825b
[UPD] Update l10n_br_sale_stock.pot
oca-travis Mar 16, 2021
c9a0f00
l10n_br_sale_stock 12.0.5.1.0
OCA-git-bot Mar 16, 2021
ad6627a
[FIX] There are two buttons 'Create Invoice' in Sale Order and both s…
mbcosta Mar 17, 2021
3c5dc1e
[FIX] Specific module order installation to run the tests.
mbcosta Mar 18, 2021
c664a93
[FIX] Tests, after devolution picking the qty_invoiced should be zero.
mbcosta Mar 24, 2021
30b3733
l10n_br_sale_stock 12.0.5.2.0
OCA-git-bot Mar 24, 2021
6c662b0
[FIX] Sale Order create invoice button attr
renatonlima Mar 30, 2021
4b5d862
l10n_br_sale_stock 12.0.5.2.1
OCA-git-bot Apr 1, 2021
df8fe03
l10n_br_sale_stock 12.0.5.2.2
OCA-git-bot Apr 8, 2021
92ef73c
remove useless default @api.multi
rvalyi May 16, 2021
3657c35
[REF] l10n_br_sale_stock lint compute method name
mileo May 24, 2021
c1e78ff
l10n_br_sale_stock 12.0.5.3.0
OCA-git-bot May 25, 2021
3ea280b
lint: sed -i 's/assertEquals/assertEqual/g'
rvalyi May 25, 2021
36a03b2
[REF] Standard OCA website l10n_br_sale_stock
mileo May 30, 2021
a01fff1
[IMP] l10n_br_sale_stock: black, isort, prettier
rvalyi Jun 7, 2021
7da65f3
E741 ambiguous variable name 'l'
rvalyi Jun 9, 2021
c903ca9
B902 Invalid 1st arg 'self' used for class method
rvalyi Jun 9, 2021
98295d8
[FIX] check if sale_id.note is false
renatonlima Jun 30, 2021
322d706
l10n_br_sale_stock 12.0.5.3.1
OCA-git-bot Jul 1, 2021
77daf09
[FIX] Test, field price_unit can be changed after Confimed stock.pick…
mbcosta Jul 15, 2021
6cd0c6c
[fix] manual additional data in views and demo
antoniospneto Jul 27, 2021
86a1128
l10n_br_sale_stock 12.0.5.4.0
OCA-git-bot Jul 27, 2021
64dee5b
fix tests
antoniospneto Sep 28, 2021
9146084
[FIX] l10n_br_sale_stock: Concatenation of Sale Note and Customer Add…
mbcosta Feb 22, 2022
e162665
l10n_br_sale_stock 12.0.5.4.1
OCA-git-bot Feb 23, 2022
4e4c375
[REF] Synchronize Sale Partner Shipping in Stock Picking.
mbcosta Mar 24, 2022
aabf462
l10n_br_sale_stock 12.0.5.4.2
OCA-git-bot Mar 24, 2022
9f1d304
[MIG] l10n_br_sale_stock: Migration to 13.0
renatonlima Jun 5, 2022
ac5f1b1
[MIG] l10n_br_sale_stock: Migration to 14.0
renatonlima Jun 5, 2022
8b70f8e
[MIG] Object account.invoice and account.invoice.line become account.…
mbcosta Jan 20, 2022
2a180cf
[MIG] Because of the changed in method _get_new_picking_values are ne…
mbcosta Jan 20, 2022
13a8480
[MIG] l10n_br_sale_stock: since v14 the inherit method always return …
mbcosta Sep 13, 2022
e993028
[MIG+IMP] l10n_br_sale_stock: Demo data and Tests the case of Lucro P…
mbcosta Sep 13, 2022
1923855
[UPD] Update l10n_br_sale_stock.pot
Sep 16, 2022
66a5be0
[UPD] README.rst
OCA-git-bot Sep 16, 2022
8805683
[REF] Context better using kwargs l10n_br_sale_stock
mileo Oct 21, 2022
0dd4933
[REF] attribute-string-redundant l10n_br_sale_stock
mileo Oct 21, 2022
c10b835
l10n_br_sale_stock 14.0.1.0.1
OCA-git-bot Oct 22, 2022
8572db2
[REF] missing-return l10n_br_sale_stock
mileo Oct 22, 2022
9387ac7
l10n_br_sale_stock 14.0.1.0.2
OCA-git-bot Oct 22, 2022
1524cb0
[UPD] README.rst
OCA-git-bot Sep 3, 2023
566b23d
[FIX] l10n_br_sale_stock: Get fields Incoterm and Payment Mode from S…
mbcosta Sep 4, 2023
df8d9db
l10n_br_sale_stock 14.0.1.1.0
OCA-git-bot Sep 5, 2023
aaa8f7d
[UPD] README.rst
OCA-git-bot Sep 5, 2023
b4fbe5b
[REF] l10n_br_sale_stock: Demo Data avoid error when MRP module are i…
mbcosta Sep 9, 2023
e3d3e33
l10n_br_sale_stock 14.0.1.1.1
OCA-git-bot Sep 9, 2023
c477d64
[UPD] README.rst
OCA-git-bot Sep 9, 2023
f6d371e
Update translation files
weblate Oct 9, 2023
8916907
[REF] l10n_br_sale_stock: Remove empty Lines, necessary for the new v…
mbcosta Oct 25, 2023
0927308
[REF] l10n_br_sale_stock: Avoid error Flake8 E741 ambiguous variable …
mbcosta Oct 25, 2023
85647af
[BOT] post-merge updates
OCA-git-bot Oct 27, 2023
74fa377
[BOT] post-merge updates
OCA-git-bot Oct 27, 2023
c716164
[IMP] l10n_br_sale_stock: get analytic account and analytic tags from…
marcelsavegnago Nov 23, 2023
23b83f8
[BOT] post-merge updates
OCA-git-bot Nov 25, 2023
c9bb8fe
[FIX] l10n_br_sale_stock: There no more field uom_id in account.move.…
mbcosta Oct 19, 2023
4158ac1
[BOT] post-merge updates
OCA-git-bot Nov 30, 2023
3f553c5
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Jan 2, 2024
9949c06
[FIX] commission tests
DiegoParadeda Sep 19, 2023
ab40c74
[REF] l10n_br_sale_stock: Removed unnecessary onchanges in Demo Data.
mbcosta Jan 17, 2024
9a5cf66
[BOT] post-merge updates
OCA-git-bot Jan 19, 2024
6778b96
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 6, 2024
07072c6
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 6, 2024
c523f2b
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 6, 2024
fbbe7c0
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 9, 2024
e9f086f
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Feb 22, 2024
531a6d3
Translated using Weblate (Portuguese (Brazil))
May 20, 2024
2226606
Translated using Weblate (Portuguese (Brazil))
marcelsavegnago Jul 29, 2024
8e1d591
[REF] l10n_br_sale_stock: Reduced duplicate Tests
mbcosta Aug 23, 2024
2c4c290
[BOT] post-merge updates
OCA-git-bot Aug 25, 2024
50b660f
[FIX] l10n_br_sale_stock: Case without Fiscal OP
mbcosta Aug 29, 2024
5b0aab0
[BOT] post-merge updates
OCA-git-bot Aug 30, 2024
bc38673
[FIX] l10n_br_sale_stock: proper partner_id
mbcosta Jan 9, 2024
3ac528c
[FIX] l10n_br_sale_stock: partner_invoice_id fix
mbcosta Jan 9, 2024
7ac3763
[BOT] post-merge updates
OCA-git-bot Sep 26, 2024
0df3f1d
[FIX] l10n_br_sale_stock: Get Default OP Fiscal
mbcosta Aug 29, 2024
042cee1
[IMP] l10n_br_sale_stock: Tests
mbcosta Aug 29, 2024
c8acdd8
[FIX] l10n_br_sale_stock: _get_fiscal_partner method return integer i…
WesleyOliveira98 Oct 2, 2024
aa85c31
[BOT] post-merge updates
OCA-git-bot Oct 2, 2024
dcab9ff
[BOT] post-merge updates
OCA-git-bot Oct 4, 2024
e5ee0d6
[MIG] l10n_br_sale_stock: Migration to 15.0
antoniospneto Sep 18, 2024
abe7fd9
[IMP] l10n_br_sale_stock: pre-commit stuff
antoniospneto Dec 7, 2024
7593d8e
[MIG] l10n_br_sale_stock: Migration to 16.0
antoniospneto Sep 18, 2024
6871f03
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
26 changes: 7 additions & 19 deletions l10n_br_account/models/account_move.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,6 +300,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 Down Expand Up @@ -338,31 +339,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
untaxed_amount_currency = invoice.amount_untaxed * sign
untaxed_amount = invoice.amount_untaxed_signed
invoice_payment_terms = (
invoice.invoice_payment_term_id._compute_terms(
date_ref=invoice.invoice_date
Expand Down
86 changes: 68 additions & 18 deletions l10n_br_account/models/account_move_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,18 @@ class AccountMoveLine(models.Model):
" and '3-3' for the last installment.",
)

# These fields are already inherited by _inherits, but there is some limitation of
# the ORM that the values of these fields are zeroed when called by onchange. This
# limitation directly affects the _get_amount_credit_debit method.
amount_untaxed = fields.Monetary(compute="_compute_amounts")
amount_total = fields.Monetary(
compute="_compute_amounts",
)

def _compute_amounts(self):
res = super()._compute_amounts()
return res

@api.depends(
"quantity",
"price_unit",
Expand Down Expand Up @@ -301,6 +313,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 +338,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 +431,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 +557,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()

# Atualiza os impostos contábeis relacionados aos impostos fiscais
user_type = "sale"
if self.move_id.move_type in ("in_invoice", "in_refund"):
def _get_computed_taxes(self):
"""
Override the native method to load taxes from the fiscal module.
"""
self.ensure_one()

# 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,9 +1273,9 @@ 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,
"amount_currency": 133.5,
"debit": 0.0,
"credit": 0.0,
"credit": 133.5,
"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
15 changes: 8 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,28 @@ def _get_view(self, view_id=None, view_type="form", **options):
"company_id",
"price_unit",
"quantity",
"icms_relief_id",
)
def _compute_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
1 change: 0 additions & 1 deletion l10n_br_purchase/models/purchase_order_line.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,6 @@ def _compute_amount(self):
{
"price_subtotal": line.amount_untaxed,
"price_tax": line.amount_tax,
"price_gross": line.amount_untaxed + line.discount_value,
"price_total": line.amount_total,
}
)
Expand Down
Loading
Loading