-
-
Notifications
You must be signed in to change notification settings - Fork 243
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
[14.0][FIX] l10n br fiscal: ncm com inicio 09 conflita com tipo servico #3096
base: 14.0
Are you sure you want to change the base?
[14.0][FIX] l10n br fiscal: ncm com inicio 09 conflita com tipo servico #3096
Conversation
atualizando 03-2024
atualização
atualização maio/24
Hi @renatonlima, |
@@ -32,5 +32,5 @@ def _onchange_ncm_id(self): | |||
[("code", "=", r.ncm_id.code[0:2])] | |||
) | |||
|
|||
if r.fiscal_genre_id.code == PRODUCT_FISCAL_TYPE_SERVICE: | |||
if r.fiscal_type == PRODUCT_FISCAL_TYPE_SERVICE: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
acho que vc tem que alterar o decorator do metodo tbm, trocar o fiscal_genre_id
por fiscal_type
@crsilveira depois precisa arrumar os commits tbm, juntar em um só, use o opção de squash no rebase iterativo |
Ontem passei estas instruções em uma outra PR... segue como exemplo. Here are the steps to do that:
By following these steps, you will squash the specified commits into a single migration commit and update the remote repository accordingly. |
Ola @crsilveira vc consegue fazer o rebase e fazer o squash por favor? Talvez vc tem a impressão que nao faz diferença, mas para a gente que mantem o projeto te garanto que faz uma baita diferença... Sempre que tem algum bug cabeludo e que a gente não sabe bem porque uma linha de codigo esta do jeito que esta a gente mergulha num "git blame" para analisar o histórico e cada commit inutil atrapalha... te do outro examplo, esse é o tipo de malabarismo que temos que fazer na OCA para mandar cada commit de uma branch para a outra, por exemplo entre as branches 14.0 e 16.0 para migrar o módulo l10n_br_account: Então se puder aprender a fazer o rebase e squash ajudaria... Até para vc é fondamental vc dominar o rebase para sobreviver com Odoo... |
Fechando aqui, pra tentar fazer corretamente |
Uma dúvida: o que é o correto pra ficar neste decorator : " ...decorator do metodo tbm, trocar o fiscal_genre_id por fiscal_type " ??? |
No decorator vc coloca os campos que vão "acionar" essa função do onchange, no caso da forma que tá hoje é sempre que alterar o campo Olhando melhor vi que já existe um onchange exclusivo para o |
..... vi que já existe um onchange exclusivo para o fiscal_type .......... sim, por isso minha dúvida. Obrigado pela resposta vou ver. |
outro detalhe: vc pode fazer um git push com a opção -f (force) depois que faz rebase. Se fizer push com -f na mesma branch, vc não precisa criar outro PR, pode ser no mesmo PR. Alias vou re-abrir caso vc quiser fazer isso que ai é melhor as explicações do porque do commit ficam todas no mesmo PR centralizado... |
Hi @renatonlima, |
Currently translated at 90.4% (1257 of 1389 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_fiscal Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_fiscal/pt_BR/
Currently translated at 0.9% (11 of 1134 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_nfe_spec Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_nfe_spec/pt_BR/
Currently translated at 78.2% (18 of 23 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_crm Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_crm/pt_BR/
Currently translated at 92.3% (277 of 300 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_purchase Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_purchase/pt_BR/
Currently translated at 92.0% (300 of 326 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_sale Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_sale/pt_BR/
Currently translated at 100.0% (274 of 274 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_contract Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_contract/pt_BR/
Currently translated at 12.3% (73 of 591 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_nfe Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_nfe/pt_BR/
Currently translated at 98.6% (288 of 292 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_stock_account Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_stock_account/pt_BR/
Currently translated at 100.0% (298 of 298 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_repair Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_repair/pt_BR/
Currently translated at 70.5% (342 of 485 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_pos Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_pos/pt_BR/
Currently translated at 100.0% (277 of 277 strings) Translation: l10n-brazil-14.0/l10n-brazil-14.0-l10n_br_sale_blanket_order Translate-URL: https://translation.odoo-community.org/projects/l10n-brazil-14-0/l10n-brazil-14-0-l10n_br_sale_blanket_order/pt_BR/
Tem algo errado.. faz um rebase com a branch 14 do remote original |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Eu vi que o método _onchange_ncm_id tem o decorador @api.onchange("ncm_id", "fiscal_genre_id") que poderia ser alterado removendo o campo fiscal_genre_id, porque não faz sentido agora, então o método ficaria assim:
@api.onchange("ncm_id")
def _onchange_ncm_id(self):
for r in self:
if r.ncm_id:
r.fiscal_genre_id = self.env["l10n_br_fiscal.product.genre"].search(
[("code", "=", r.ncm_id.code[0:2])]
)
A ideia original desse método era que quando alterado o fiscal_genre_id para o "00" Serviço, fosse alterado o campo ncm_id para o NCM de serviço 000.00.00, mas como reportado pelo issue, não estava correto.
Eu diria que poderia ser complementado nesse PR era que se for alterado o campo fiscal_genre_id e caso o NCM esteja preenchido com o NCM de outra família, poderia ser limpado o campo para que o usuário preencha o NCM correto
@api.onchange("fiscal_genre_id")
def _onchange_ fiscal_genre_id(self):
for r in self:
if r. fiscal_genre_id and r.ncm_id:
if r.fiscal_genre_id.code != r.ncm_id.code[0:2]:
r.ncm_id = False
Além esse método também poderia ser adicionado uma constraint para fazer essa validação (garantir que ao salvar o produto o ncm_id seja da mesma família do fiscal_genre_id, mas acho que isso poderia ficar para depois e ser pensado melhor, porque acredito que esse tipo de validação tem o potencial de causar alguns problemas em uma base de dados multi-company com uma empresa que não é do Brasil.
@crsilveira se puder fazer um rebase e depois dos ajustes puder fazer um squash dos commits.. seria bom. Thanks. |
933fa71
to
ff8cd4a
Compare
Issue: #3095