odoo-addon-l10n-br-fiscal 15.0.1.20.2.1__py3-none-any.whl → 15.0.1.20.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of odoo-addon-l10n-br-fiscal might be problematic. Click here for more details.

@@ -7,7 +7,7 @@ Módulo fiscal brasileiro
7
7
  !! This file is generated by oca-gen-addon-readme !!
8
8
  !! changes will be overwritten. !!
9
9
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10
- !! source digest: sha256:6b5dddb9fe0735e01e0e41387881e3a446601cc47681c79f129fc004e527ec29
10
+ !! source digest: sha256:c7f252e4f8791d96f0ed30fe6d126e82bbfd888301db36b6429f64926eba8be8
11
11
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12
12
 
13
13
  .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
@@ -10,7 +10,7 @@
10
10
  "maintainers": ["renatonlima"],
11
11
  "website": "https://github.com/OCA/l10n-brazil",
12
12
  "development_status": "Production/Stable",
13
- "version": "15.0.1.20.2",
13
+ "version": "15.0.1.20.3",
14
14
  "depends": [
15
15
  "product",
16
16
  "l10n_br_base",
@@ -252,32 +252,38 @@ class FiscalDocumentLineMixinMethods(models.AbstractModel):
252
252
 
253
253
  def _remove_all_fiscal_tax_ids(self):
254
254
  for line in self:
255
- line.fiscal_tax_ids = False
256
-
255
+ to_update = {"fiscal_tax_ids": False}
257
256
  for fiscal_tax_field in FISCAL_TAX_ID_FIELDS:
258
- line[fiscal_tax_field] = False
259
-
260
- self._set_fields_issqn(TAX_DICT_VALUES)
261
- self._set_fields_csll(TAX_DICT_VALUES)
262
- self._set_fields_irpj(TAX_DICT_VALUES)
263
- self._set_fields_inss(TAX_DICT_VALUES)
264
- self._set_fields_icms(TAX_DICT_VALUES)
265
- self._set_fields_icmsfcp(TAX_DICT_VALUES)
266
- self._set_fields_icmsfcpst(TAX_DICT_VALUES)
267
- self._set_fields_icmsst(TAX_DICT_VALUES)
268
- self._set_fields_icmssn(TAX_DICT_VALUES)
269
- self._set_fields_ipi(TAX_DICT_VALUES)
270
- self._set_fields_ii(TAX_DICT_VALUES)
271
- self._set_fields_pis(TAX_DICT_VALUES)
272
- self._set_fields_pisst(TAX_DICT_VALUES)
273
- self._set_fields_cofins(TAX_DICT_VALUES)
274
- self._set_fields_cofinsst(TAX_DICT_VALUES)
275
- self._set_fields_issqn_wh(TAX_DICT_VALUES)
276
- self._set_fields_pis_wh(TAX_DICT_VALUES)
277
- self._set_fields_cofins_wh(TAX_DICT_VALUES)
278
- self._set_fields_csll_wh(TAX_DICT_VALUES)
279
- self._set_fields_irpj_wh(TAX_DICT_VALUES)
280
- self._set_fields_inss_wh(TAX_DICT_VALUES)
257
+ to_update[fiscal_tax_field] = False
258
+ tax_methods = [
259
+ self._prepare_fields_issqn,
260
+ self._prepare_fields_csll,
261
+ self._prepare_fields_irpj,
262
+ self._prepare_fields_inss,
263
+ self._prepare_fields_icms,
264
+ self._prepare_fields_icmsfcp,
265
+ self._prepare_fields_icmsfcpst,
266
+ self._prepare_fields_icmsst,
267
+ self._prepare_fields_icmssn,
268
+ self._prepare_fields_ipi,
269
+ self._prepare_fields_ii,
270
+ self._prepare_fields_pis,
271
+ self._prepare_fields_pisst,
272
+ self._prepare_fields_cofins,
273
+ self._prepare_fields_cofinsst,
274
+ self._prepare_fields_issqn_wh,
275
+ self._prepare_fields_pis_wh,
276
+ self._prepare_fields_cofins_wh,
277
+ self._prepare_fields_csll_wh,
278
+ self._prepare_fields_irpj_wh,
279
+ self._prepare_fields_inss_wh,
280
+ ]
281
+ for method in tax_methods:
282
+ prepared_fields = method(TAX_DICT_VALUES)
283
+ if prepared_fields:
284
+ to_update.update(prepared_fields)
285
+ # Update all fields at once
286
+ line.update(to_update)
281
287
 
282
288
  def _update_fiscal_tax_ids(self, taxes):
283
289
  for line in self:
@@ -290,24 +296,37 @@ class FiscalDocumentLineMixinMethods(models.AbstractModel):
290
296
  def _update_fiscal_taxes(self):
291
297
  for line in self:
292
298
  compute_result = self._compute_taxes(line.fiscal_tax_ids)
293
- computed_taxes = compute_result.get("taxes", {})
294
- line.amount_tax_included = compute_result.get("amount_included", 0.0)
295
- line.amount_tax_not_included = compute_result.get(
296
- "amount_not_included", 0.0
297
- )
298
- line.amount_tax_withholding = compute_result.get("amount_withholding", 0.0)
299
- line.estimate_tax = compute_result.get("estimate_tax", 0.0)
300
- for tax in line.fiscal_tax_ids:
301
- computed_tax = computed_taxes.get(tax.tax_domain, {})
302
- if hasattr(line, "%s_tax_id" % (tax.tax_domain,)):
303
- # since v13, when line is a new record,
304
- # line.fiscal_tax_ids recordset is made of
305
- # NewId records with an origin pointing back to the original
306
- # tax. tax.ids[0] is a way to the the single original tax back.
307
- setattr(line, "%s_tax_id" % (tax.tax_domain,), tax.ids[0])
308
- method = getattr(self, "_set_fields_%s" % (tax.tax_domain,))
309
- if method:
310
- method(computed_tax)
299
+ to_update = {
300
+ "amount_tax_included": compute_result.get("amount_included", 0.0),
301
+ "amount_tax_not_included": compute_result.get(
302
+ "amount_not_included", 0.0
303
+ ),
304
+ "amount_tax_withholding": compute_result.get("amount_withholding", 0.0),
305
+ "estimate_tax": compute_result.get("estimate_tax", 0.0),
306
+ }
307
+ to_update.update(line._prepare_tax_fields(compute_result))
308
+
309
+ in_draft_mode = self != self._origin
310
+ if in_draft_mode:
311
+ line.update(to_update)
312
+ else:
313
+ line.write(to_update)
314
+
315
+ def _prepare_tax_fields(self, compute_result):
316
+ self.ensure_one()
317
+ computed_taxes = compute_result.get("taxes", {})
318
+ tax_values = {}
319
+ for tax in self.fiscal_tax_ids:
320
+ computed_tax = computed_taxes.get(tax.tax_domain, {})
321
+ tax_field_name = f"{tax.tax_domain}_tax_id"
322
+ if hasattr(self, tax_field_name):
323
+ tax_values[tax_field_name] = tax.ids[0]
324
+ method = getattr(self, f"_prepare_fields_{tax.tax_domain}", None)
325
+ if method and computed_tax:
326
+ prepared_fields = method(computed_tax)
327
+ if prepared_fields:
328
+ tax_values.update(prepared_fields)
329
+ return tax_values
311
330
 
312
331
  def _get_product_price(self):
313
332
  self.ensure_one()
@@ -420,25 +439,27 @@ class FiscalDocumentLineMixinMethods(models.AbstractModel):
420
439
  self._get_product_price()
421
440
  self._onchange_fiscal_operation_id()
422
441
 
423
- def _set_fields_issqn(self, tax_dict):
442
+ def _prepare_fields_issqn(self, tax_dict):
424
443
  self.ensure_one()
425
- if tax_dict:
426
- self.issqn_base = tax_dict.get("base")
427
- self.issqn_percent = tax_dict.get("percent_amount")
428
- self.issqn_reduction = tax_dict.get("percent_reduction")
429
- self.issqn_value = tax_dict.get("tax_value")
444
+ return {
445
+ "issqn_base": tax_dict.get("base"),
446
+ "issqn_percent": tax_dict.get("percent_amount"),
447
+ "issqn_reduction": tax_dict.get("percent_reduction"),
448
+ "issqn_value": tax_dict.get("tax_value"),
449
+ }
430
450
 
431
451
  @api.onchange("issqn_base", "issqn_percent", "issqn_reduction", "issqn_value")
432
452
  def _onchange_issqn_fields(self):
433
453
  pass
434
454
 
435
- def _set_fields_issqn_wh(self, tax_dict):
455
+ def _prepare_fields_issqn_wh(self, tax_dict):
436
456
  self.ensure_one()
437
- if tax_dict:
438
- self.issqn_wh_base = tax_dict.get("base")
439
- self.issqn_wh_percent = tax_dict.get("percent_amount")
440
- self.issqn_wh_reduction = tax_dict.get("percent_reduction")
441
- self.issqn_wh_value = tax_dict.get("tax_value")
457
+ return {
458
+ "issqn_wh_base": tax_dict.get("base"),
459
+ "issqn_wh_percent": tax_dict.get("percent_amount"),
460
+ "issqn_wh_reduction": tax_dict.get("percent_reduction"),
461
+ "issqn_wh_value": tax_dict.get("tax_value"),
462
+ }
442
463
 
443
464
  @api.onchange(
444
465
  "issqn_wh_base", "issqn_wh_percent", "issqn_wh_reduction", "issqn_wh_value"
@@ -446,25 +467,27 @@ class FiscalDocumentLineMixinMethods(models.AbstractModel):
446
467
  def _onchange_issqn_wh_fields(self):
447
468
  pass
448
469
 
449
- def _set_fields_csll(self, tax_dict):
470
+ def _prepare_fields_csll(self, tax_dict):
450
471
  self.ensure_one()
451
- if tax_dict:
452
- self.csll_base = tax_dict.get("base")
453
- self.csll_percent = tax_dict.get("percent_amount")
454
- self.csll_reduction = tax_dict.get("percent_reduction")
455
- self.csll_value = tax_dict.get("tax_value")
472
+ return {
473
+ "csll_base": tax_dict.get("base"),
474
+ "csll_percent": tax_dict.get("percent_amount"),
475
+ "csll_reduction": tax_dict.get("percent_reduction"),
476
+ "csll_value": tax_dict.get("tax_value"),
477
+ }
456
478
 
457
479
  @api.onchange("csll_base", "csll_percent", "csll_reduction", "csll_value")
458
480
  def _onchange_csll_fields(self):
459
481
  pass
460
482
 
461
- def _set_fields_csll_wh(self, tax_dict):
483
+ def _prepare_fields_csll_wh(self, tax_dict):
462
484
  self.ensure_one()
463
- if tax_dict:
464
- self.csll_wh_base = tax_dict.get("base")
465
- self.csll_wh_percent = tax_dict.get("percent_amount")
466
- self.csll_wh_reduction = tax_dict.get("percent_reduction")
467
- self.csll_wh_value = tax_dict.get("tax_value")
485
+ return {
486
+ "csll_wh_base": tax_dict.get("base"),
487
+ "csll_wh_percent": tax_dict.get("percent_amount"),
488
+ "csll_wh_reduction": tax_dict.get("percent_reduction"),
489
+ "csll_wh_value": tax_dict.get("tax_value"),
490
+ }
468
491
 
469
492
  @api.onchange(
470
493
  "csll_wh_base", "csll_wh_percent", "csll_wh_reduction", "csll_wh_value"
@@ -472,25 +495,27 @@ class FiscalDocumentLineMixinMethods(models.AbstractModel):
472
495
  def _onchange_csll_wh_fields(self):
473
496
  pass
474
497
 
475
- def _set_fields_irpj(self, tax_dict):
498
+ def _prepare_fields_irpj(self, tax_dict):
476
499
  self.ensure_one()
477
- if tax_dict:
478
- self.irpj_base = tax_dict.get("base")
479
- self.irpj_percent = tax_dict.get("percent_amount")
480
- self.irpj_reduction = tax_dict.get("percent_reduction")
481
- self.irpj_value = tax_dict.get("tax_value")
500
+ return {
501
+ "irpj_base": tax_dict.get("base"),
502
+ "irpj_percent": tax_dict.get("percent_amount"),
503
+ "irpj_reduction": tax_dict.get("percent_reduction"),
504
+ "irpj_value": tax_dict.get("tax_value"),
505
+ }
482
506
 
483
507
  @api.onchange("irpj_base", "irpj_percent", "irpj_reduction", "irpj_value")
484
508
  def _onchange_irpj_fields(self):
485
509
  pass
486
510
 
487
- def _set_fields_irpj_wh(self, tax_dict):
511
+ def _prepare_fields_irpj_wh(self, tax_dict):
488
512
  self.ensure_one()
489
- if tax_dict:
490
- self.irpj_wh_base = tax_dict.get("base")
491
- self.irpj_wh_percent = tax_dict.get("percent_amount")
492
- self.irpj_wh_reduction = tax_dict.get("percent_reduction")
493
- self.irpj_wh_value = tax_dict.get("tax_value")
513
+ return {
514
+ "irpj_wh_base": tax_dict.get("base"),
515
+ "irpj_wh_percent": tax_dict.get("percent_amount"),
516
+ "irpj_wh_reduction": tax_dict.get("percent_reduction"),
517
+ "irpj_wh_value": tax_dict.get("tax_value"),
518
+ }
494
519
 
495
520
  @api.onchange(
496
521
  "irpj_wh_base", "irpj_wh_percent", "irpj_wh_reduction", "irpj_wh_value"
@@ -498,25 +523,27 @@ class FiscalDocumentLineMixinMethods(models.AbstractModel):
498
523
  def _onchange_irpj_wh_fields(self):
499
524
  pass
500
525
 
501
- def _set_fields_inss(self, tax_dict):
526
+ def _prepare_fields_inss(self, tax_dict):
502
527
  self.ensure_one()
503
- if tax_dict:
504
- self.inss_base = tax_dict.get("base")
505
- self.inss_percent = tax_dict.get("percent_amount")
506
- self.inss_reduction = tax_dict.get("percent_reduction")
507
- self.inss_value = tax_dict.get("tax_value")
528
+ return {
529
+ "inss_base": tax_dict.get("base"),
530
+ "inss_percent": tax_dict.get("percent_amount"),
531
+ "inss_reduction": tax_dict.get("percent_reduction"),
532
+ "inss_value": tax_dict.get("tax_value"),
533
+ }
508
534
 
509
535
  @api.onchange("inss_base", "inss_percent", "inss_reduction", "inss_value")
510
536
  def _onchange_inss_fields(self):
511
537
  pass
512
538
 
513
- def _set_fields_inss_wh(self, tax_dict):
539
+ def _prepare_fields_inss_wh(self, tax_dict):
514
540
  self.ensure_one()
515
- if tax_dict:
516
- self.inss_wh_base = tax_dict.get("base")
517
- self.inss_wh_percent = tax_dict.get("percent_amount")
518
- self.inss_wh_reduction = tax_dict.get("percent_reduction")
519
- self.inss_wh_value = tax_dict.get("tax_value")
541
+ return {
542
+ "inss_wh_base": tax_dict.get("base"),
543
+ "inss_wh_percent": tax_dict.get("percent_amount"),
544
+ "inss_wh_reduction": tax_dict.get("percent_reduction"),
545
+ "inss_wh_value": tax_dict.get("tax_value"),
546
+ }
520
547
 
521
548
  @api.onchange(
522
549
  "inss_wh_base", "inss_wh_percent", "inss_wh_reduction", "inss_wh_value"
@@ -524,42 +551,24 @@ class FiscalDocumentLineMixinMethods(models.AbstractModel):
524
551
  def _onchange_inss_wh_fields(self):
525
552
  pass
526
553
 
527
- def _set_fields_icms(self, tax_dict):
554
+ def _prepare_fields_icms(self, tax_dict):
528
555
  self.ensure_one()
529
- if tax_dict:
530
- self.icms_cst_id = tax_dict.get("cst_id")
531
- self.icms_base_type = tax_dict.get("icms_base_type", ICMS_BASE_TYPE_DEFAULT)
532
- self.icms_base = tax_dict.get("base")
533
- self.icms_percent = tax_dict.get("percent_amount")
534
- self.icms_reduction = tax_dict.get("percent_reduction")
535
- self.icms_value = tax_dict.get("tax_value")
536
-
537
- # vBCUFDest - Valor da BC do ICMS na UF de destino
538
- if tax_dict.get("icms_dest_base") is not None:
539
- self.icms_destination_base = tax_dict.get("icms_dest_base")
540
-
541
- # pICMSUFDest - Alíquota interna da UF de destino
542
- self.icms_origin_percent = tax_dict.get("icms_origin_perc")
543
-
544
- # pICMSInter - Alíquota interestadual das UF envolvidas
545
- self.icms_destination_percent = tax_dict.get("icms_dest_perc")
546
-
547
- # pICMSInterPart - Percentual provisório de partilha
548
- # do ICMS Interestadual
549
- self.icms_sharing_percent = tax_dict.get("icms_sharing_percent")
550
-
551
- # vICMSUFRemet - Valor do ICMS Interestadual
552
- # para a UF do remetente
553
- if tax_dict.get("icms_origin_value") is not None:
554
- self.icms_origin_value = tax_dict.get("icms_origin_value")
555
-
556
- # vICMSUFDest - Valor do ICMS Interestadual para a UF de destino
557
- if tax_dict.get("icms_dest_value") is not None:
558
- self.icms_destination_value = tax_dict.get("icms_dest_value")
559
-
560
- # Valor da desoneração do ICMS
561
- if tax_dict.get("icms_relief") is not None:
562
- self.icms_relief_value = tax_dict.get("icms_relief")
556
+ cst_id = tax_dict.get("cst_id").id if tax_dict.get("cst_id") else False
557
+ return {
558
+ "icms_cst_id": cst_id,
559
+ "icms_base_type": tax_dict.get("icms_base_type", ICMS_BASE_TYPE_DEFAULT),
560
+ "icms_base": tax_dict.get("base", 0.0),
561
+ "icms_percent": tax_dict.get("percent_amount", 0.0),
562
+ "icms_reduction": tax_dict.get("percent_reduction", 0.0),
563
+ "icms_value": tax_dict.get("tax_value", 0.0),
564
+ "icms_origin_percent": tax_dict.get("icms_origin_perc", 0.0),
565
+ "icms_destination_percent": tax_dict.get("icms_dest_perc", 0.0),
566
+ "icms_sharing_percent": tax_dict.get("icms_sharing_percent", 0.0),
567
+ "icms_destination_base": tax_dict.get("icms_dest_base", 0.0),
568
+ "icms_origin_value": tax_dict.get("icms_origin_value", 0.0),
569
+ "icms_destination_value": tax_dict.get("icms_dest_value", 0.0),
570
+ "icms_relief_value": tax_dict.get("icms_relief", 0.0),
571
+ }
563
572
 
564
573
  @api.onchange(
565
574
  "icms_base",
@@ -577,15 +586,22 @@ class FiscalDocumentLineMixinMethods(models.AbstractModel):
577
586
  if self.icms_tax_benefit_id:
578
587
  self.icms_tax_id = self.icms_tax_benefit_id.tax_id
579
588
 
580
- def _set_fields_icmssn(self, tax_dict):
589
+ def _prepare_fields_icmssn(self, tax_dict):
581
590
  self.ensure_one()
582
- self.icms_cst_id = tax_dict.get("cst_id")
583
- self.icmssn_base = tax_dict.get("base")
584
- self.icmssn_percent = tax_dict.get("percent_amount")
585
- self.icmssn_reduction = tax_dict.get("percent_reduction")
586
- self.icmssn_credit_value = tax_dict.get("tax_value")
587
- self.simple_value = self.icmssn_base * self.icmssn_range_id.total_tax_percent
588
- self.simple_without_icms_value = self.simple_value - self.icmssn_credit_value
591
+ cst_id = tax_dict.get("cst_id").id if tax_dict.get("cst_id") else False
592
+ icmssn_base = tax_dict.get("base", 0.0)
593
+ icmssn_credit_value = tax_dict.get("tax_value", 0.0)
594
+ simple_value = icmssn_base * self.icmssn_range_id.total_tax_percent
595
+ simple_without_icms_value = simple_value - icmssn_credit_value
596
+ return {
597
+ "icms_cst_id": cst_id,
598
+ "icmssn_base": icmssn_base,
599
+ "icmssn_percent": tax_dict.get("percent_amount"),
600
+ "icmssn_reduction": tax_dict.get("percent_reduction"),
601
+ "icmssn_credit_value": icmssn_credit_value,
602
+ "simple_value": simple_value,
603
+ "simple_without_icms_value": simple_without_icms_value,
604
+ }
589
605
 
590
606
  @api.onchange(
591
607
  "icmssn_base", "icmssn_percent", "icmssn_reduction", "icmssn_credit_value"
@@ -593,20 +609,18 @@ class FiscalDocumentLineMixinMethods(models.AbstractModel):
593
609
  def _onchange_icmssn_fields(self):
594
610
  pass
595
611
 
596
- def _set_fields_icmsst(self, tax_dict):
612
+ def _prepare_fields_icmsst(self, tax_dict):
597
613
  self.ensure_one()
598
- self.icmsst_base_type = tax_dict.get(
599
- "icmsst_base_type", ICMS_ST_BASE_TYPE_DEFAULT
600
- )
601
- self.icmsst_mva_percent = tax_dict.get("icmsst_mva_percent")
602
- self.icmsst_percent = tax_dict.get("percent_amount")
603
- self.icmsst_reduction = tax_dict.get("percent_reduction")
604
- self.icmsst_base = tax_dict.get("base")
605
- self.icmsst_value = tax_dict.get("tax_value")
606
-
607
- # TODO - OTHER TAX icmsst_wh_tax_id
608
- # self.icmsst_wh_base
609
- # self.icmsst_wh_value
614
+ return {
615
+ "icmsst_base_type": tax_dict.get(
616
+ "icmsst_base_type", ICMS_ST_BASE_TYPE_DEFAULT
617
+ ),
618
+ "icmsst_mva_percent": tax_dict.get("icmsst_mva_percent"),
619
+ "icmsst_percent": tax_dict.get("percent_amount"),
620
+ "icmsst_reduction": tax_dict.get("percent_reduction"),
621
+ "icmsst_base": tax_dict.get("base"),
622
+ "icmsst_value": tax_dict.get("tax_value"),
623
+ }
610
624
 
611
625
  @api.onchange(
612
626
  "icmsst_base_type",
@@ -621,56 +635,65 @@ class FiscalDocumentLineMixinMethods(models.AbstractModel):
621
635
  def _onchange_icmsst_fields(self):
622
636
  pass
623
637
 
624
- def _set_fields_icmsfcp(self, tax_dict):
638
+ def _prepare_fields_icmsfcp(self, tax_dict):
625
639
  self.ensure_one()
626
- self.icmsfcp_base = tax_dict.get("base", 0.0)
627
- self.icmsfcp_percent = tax_dict.get("percent_amount", 0.0)
628
- self.icmsfcp_value = tax_dict.get("tax_value", 0.0)
640
+ return {
641
+ "icmsfcp_base": tax_dict.get("base", 0.0),
642
+ "icmsfcp_percent": tax_dict.get("percent_amount", 0.0),
643
+ "icmsfcp_value": tax_dict.get("tax_value", 0.0),
644
+ }
629
645
 
630
- def _set_fields_icmsfcpst(self, tax_dict):
646
+ def _prepare_fields_icmsfcpst(self, tax_dict):
631
647
  self.ensure_one()
632
- self.icmsfcpst_base = self.icmsst_base
633
- self.icmsfcpst_percent = tax_dict.get("percent_amount", 0.0)
634
- self.icmsfcpst_value = tax_dict.get("tax_value", 0.0)
648
+ return {
649
+ "icmsfcpst_base": self.icmsst_base,
650
+ "icmsfcpst_percent": tax_dict.get("percent_amount", 0.0),
651
+ "icmsfcpst_value": tax_dict.get("tax_value", 0.0),
652
+ }
635
653
 
636
654
  @api.onchange("icmsfcp_percent", "icmsfcp_value")
637
655
  def _onchange_icmsfcp_fields(self):
638
656
  pass
639
657
 
640
- def _set_fields_ipi(self, tax_dict):
658
+ def _prepare_fields_ipi(self, tax_dict):
641
659
  self.ensure_one()
642
- if tax_dict:
643
- self.ipi_cst_id = tax_dict.get("cst_id")
644
- self.ipi_base_type = tax_dict.get("base_type", False)
645
- self.ipi_base = tax_dict.get("base", 0.00)
646
- self.ipi_percent = tax_dict.get("percent_amount", 0.00)
647
- self.ipi_reduction = tax_dict.get("percent_reduction", 0.00)
648
- self.ipi_value = tax_dict.get("tax_value", 0.00)
660
+ cst_id = tax_dict.get("cst_id").id if tax_dict.get("cst_id") else False
661
+ return {
662
+ "ipi_cst_id": cst_id,
663
+ "ipi_base_type": tax_dict.get("base_type", False),
664
+ "ipi_base": tax_dict.get("base", 0.00),
665
+ "ipi_percent": tax_dict.get("percent_amount", 0.00),
666
+ "ipi_reduction": tax_dict.get("percent_reduction", 0.00),
667
+ "ipi_value": tax_dict.get("tax_value", 0.00),
668
+ }
649
669
 
650
670
  @api.onchange("ipi_base", "ipi_percent", "ipi_reduction", "ipi_value")
651
671
  def _onchange_ipi_fields(self):
652
672
  pass
653
673
 
654
- def _set_fields_ii(self, tax_dict):
674
+ def _prepare_fields_ii(self, tax_dict):
655
675
  self.ensure_one()
656
- if tax_dict:
657
- self.ii_base = tax_dict.get("base", 0.00)
658
- self.ii_percent = tax_dict.get("percent_amount", 0.00)
659
- self.ii_value = tax_dict.get("tax_value", 0.00)
676
+ return {
677
+ "ii_base": tax_dict.get("base", 0.00),
678
+ "ii_percent": tax_dict.get("percent_amount", 0.00),
679
+ "ii_value": tax_dict.get("tax_value", 0.00),
680
+ }
660
681
 
661
682
  @api.onchange("ii_base", "ii_percent", "ii_value")
662
683
  def _onchange_ii_fields(self):
663
684
  pass
664
685
 
665
- def _set_fields_pis(self, tax_dict):
686
+ def _prepare_fields_pis(self, tax_dict):
666
687
  self.ensure_one()
667
- if tax_dict:
668
- self.pis_cst_id = tax_dict.get("cst_id")
669
- self.pis_base_type = tax_dict.get("base_type")
670
- self.pis_base = tax_dict.get("base", 0.00)
671
- self.pis_percent = tax_dict.get("percent_amount", 0.00)
672
- self.pis_reduction = tax_dict.get("percent_reduction", 0.00)
673
- self.pis_value = tax_dict.get("tax_value", 0.00)
688
+ cst_id = tax_dict.get("cst_id").id if tax_dict.get("cst_id") else False
689
+ return {
690
+ "pis_cst_id": cst_id,
691
+ "pis_base_type": tax_dict.get("base_type"),
692
+ "pis_base": tax_dict.get("base", 0.00),
693
+ "pis_percent": tax_dict.get("percent_amount", 0.00),
694
+ "pis_reduction": tax_dict.get("percent_reduction", 0.00),
695
+ "pis_value": tax_dict.get("tax_value", 0.00),
696
+ }
674
697
 
675
698
  @api.onchange(
676
699
  "pis_base_type", "pis_base", "pis_percent", "pis_reduction", "pis_value"
@@ -678,14 +701,15 @@ class FiscalDocumentLineMixinMethods(models.AbstractModel):
678
701
  def _onchange_pis_fields(self):
679
702
  pass
680
703
 
681
- def _set_fields_pis_wh(self, tax_dict):
704
+ def _prepare_fields_pis_wh(self, tax_dict):
682
705
  self.ensure_one()
683
- if tax_dict:
684
- self.pis_wh_base_type = tax_dict.get("base_type")
685
- self.pis_wh_base = tax_dict.get("base", 0.00)
686
- self.pis_wh_percent = tax_dict.get("percent_amount", 0.00)
687
- self.pis_wh_reduction = tax_dict.get("percent_reduction", 0.00)
688
- self.pis_wh_value = tax_dict.get("tax_value", 0.00)
706
+ return {
707
+ "pis_wh_base_type": tax_dict.get("base_type"),
708
+ "pis_wh_base": tax_dict.get("base", 0.00),
709
+ "pis_wh_percent": tax_dict.get("percent_amount", 0.00),
710
+ "pis_wh_reduction": tax_dict.get("percent_reduction", 0.00),
711
+ "pis_wh_value": tax_dict.get("tax_value", 0.00),
712
+ }
689
713
 
690
714
  @api.onchange(
691
715
  "pis_wh_base_type",
@@ -697,15 +721,17 @@ class FiscalDocumentLineMixinMethods(models.AbstractModel):
697
721
  def _onchange_pis_wh_fields(self):
698
722
  pass
699
723
 
700
- def _set_fields_pisst(self, tax_dict):
724
+ def _prepare_fields_pisst(self, tax_dict):
701
725
  self.ensure_one()
702
- if tax_dict:
703
- self.pisst_cst_id = tax_dict.get("cst_id")
704
- self.pisst_base_type = tax_dict.get("base_type")
705
- self.pisst_base = tax_dict.get("base", 0.00)
706
- self.pisst_percent = tax_dict.get("percent_amount", 0.00)
707
- self.pisst_reduction = tax_dict.get("percent_reduction", 0.00)
708
- self.pisst_value = tax_dict.get("tax_value", 0.00)
726
+ cst_id = tax_dict.get("cst_id").id if tax_dict.get("cst_id") else False
727
+ return {
728
+ "pisst_cst_id": cst_id,
729
+ "pisst_base_type": tax_dict.get("base_type"),
730
+ "pisst_base": tax_dict.get("base", 0.00),
731
+ "pisst_percent": tax_dict.get("percent_amount", 0.00),
732
+ "pisst_reduction": tax_dict.get("percent_reduction", 0.00),
733
+ "pisst_value": tax_dict.get("tax_value", 0.00),
734
+ }
709
735
 
710
736
  @api.onchange(
711
737
  "pisst_base_type",
@@ -717,15 +743,17 @@ class FiscalDocumentLineMixinMethods(models.AbstractModel):
717
743
  def _onchange_pisst_fields(self):
718
744
  pass
719
745
 
720
- def _set_fields_cofins(self, tax_dict):
746
+ def _prepare_fields_cofins(self, tax_dict):
721
747
  self.ensure_one()
722
- if tax_dict:
723
- self.cofins_cst_id = tax_dict.get("cst_id")
724
- self.cofins_base_type = tax_dict.get("base_type")
725
- self.cofins_base = tax_dict.get("base", 0.00)
726
- self.cofins_percent = tax_dict.get("percent_amount", 0.00)
727
- self.cofins_reduction = tax_dict.get("percent_reduction", 0.00)
728
- self.cofins_value = tax_dict.get("tax_value", 0.00)
748
+ cst_id = tax_dict.get("cst_id").id if tax_dict.get("cst_id") else False
749
+ return {
750
+ "cofins_cst_id": cst_id,
751
+ "cofins_base_type": tax_dict.get("base_type"),
752
+ "cofins_base": tax_dict.get("base", 0.00),
753
+ "cofins_percent": tax_dict.get("percent_amount", 0.00),
754
+ "cofins_reduction": tax_dict.get("percent_reduction", 0.00),
755
+ "cofins_value": tax_dict.get("tax_value", 0.00),
756
+ }
729
757
 
730
758
  @api.onchange(
731
759
  "cofins_base_type",
@@ -737,14 +765,15 @@ class FiscalDocumentLineMixinMethods(models.AbstractModel):
737
765
  def _onchange_cofins_fields(self):
738
766
  pass
739
767
 
740
- def _set_fields_cofins_wh(self, tax_dict):
768
+ def _prepare_fields_cofins_wh(self, tax_dict):
741
769
  self.ensure_one()
742
- if tax_dict:
743
- self.cofins_wh_base_type = tax_dict.get("base_type")
744
- self.cofins_wh_base = tax_dict.get("base", 0.00)
745
- self.cofins_wh_percent = tax_dict.get("percent_amount", 0.00)
746
- self.cofins_wh_reduction = tax_dict.get("percent_reduction", 0.00)
747
- self.cofins_wh_value = tax_dict.get("tax_value", 0.00)
770
+ return {
771
+ "cofins_wh_base_type": tax_dict.get("base_type"),
772
+ "cofins_wh_base": tax_dict.get("base", 0.00),
773
+ "cofins_wh_percent": tax_dict.get("percent_amount", 0.00),
774
+ "cofins_wh_reduction": tax_dict.get("percent_reduction", 0.00),
775
+ "cofins_wh_value": tax_dict.get("tax_value", 0.00),
776
+ }
748
777
 
749
778
  @api.onchange(
750
779
  "cofins_wh_base_type",
@@ -756,15 +785,17 @@ class FiscalDocumentLineMixinMethods(models.AbstractModel):
756
785
  def _onchange_cofins_wh_fields(self):
757
786
  pass
758
787
 
759
- def _set_fields_cofinsst(self, tax_dict):
788
+ def _prepare_fields_cofinsst(self, tax_dict):
760
789
  self.ensure_one()
761
- if tax_dict:
762
- self.cofinsst_cst_id = tax_dict.get("cst_id")
763
- self.cofinsst_base_type = tax_dict.get("base_type")
764
- self.cofinsst_base = tax_dict.get("base", 0.00)
765
- self.cofinsst_percent = tax_dict.get("percent_amount", 0.00)
766
- self.cofinsst_reduction = tax_dict.get("percent_reduction", 0.00)
767
- self.cofinsst_value = tax_dict.get("tax_value", 0.00)
790
+ cst_id = tax_dict.get("cst_id").id if tax_dict.get("cst_id") else False
791
+ return {
792
+ "cofinsst_cst_id": cst_id,
793
+ "cofinsst_base_type": tax_dict.get("base_type"),
794
+ "cofinsst_base": tax_dict.get("base", 0.00),
795
+ "cofinsst_percent": tax_dict.get("percent_amount", 0.00),
796
+ "cofinsst_reduction": tax_dict.get("percent_reduction", 0.00),
797
+ "cofinsst_value": tax_dict.get("tax_value", 0.00),
798
+ }
768
799
 
769
800
  @api.onchange(
770
801
  "cofinsst_base_type",
@@ -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:6b5dddb9fe0735e01e0e41387881e3a446601cc47681c79f129fc004e527ec29
370
+ !! source digest: sha256:c7f252e4f8791d96f0ed30fe6d126e82bbfd888301db36b6429f64926eba8be8
371
371
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
372
372
  <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Production/Stable" src="https://img.shields.io/badge/maturity-Production%2FStable-green.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/15.0/l10n_br_fiscal"><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-15-0/l10n-brazil-15-0-l10n_br_fiscal"><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&amp;target_branch=15.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
373
373
  <img alt="https://raw.githubusercontent.com/OCA/l10n-brazil/15.0/l10n_br_fiscal/static/img/fiscal_dashboard.png" src="https://raw.githubusercontent.com/OCA/l10n-brazil/15.0/l10n_br_fiscal/static/img/fiscal_dashboard.png" />
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-l10n_br_fiscal
3
- Version: 15.0.1.20.2.1
3
+ Version: 15.0.1.20.3
4
4
  Summary: Brazilian fiscal core module.
5
5
  Home-page: https://github.com/OCA/l10n-brazil
6
6
  Author: Akretion, Odoo Community Association (OCA)
@@ -25,7 +25,7 @@ Módulo fiscal brasileiro
25
25
  !! This file is generated by oca-gen-addon-readme !!
26
26
  !! changes will be overwritten. !!
27
27
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
28
- !! source digest: sha256:6b5dddb9fe0735e01e0e41387881e3a446601cc47681c79f129fc004e527ec29
28
+ !! source digest: sha256:c7f252e4f8791d96f0ed30fe6d126e82bbfd888301db36b6429f64926eba8be8
29
29
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
30
30
 
31
31
  .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
@@ -1,6 +1,6 @@
1
- odoo/addons/l10n_br_fiscal/README.rst,sha256=VPokZ2vSqxeCkVeeepsF1zJ6BbIPPmG6fgcamrjsmTU,13503
1
+ odoo/addons/l10n_br_fiscal/README.rst,sha256=JePvGU3rxtdnblrlBaDzLBNhDa_2qZ12G4JEETjGYRc,13503
2
2
  odoo/addons/l10n_br_fiscal/__init__.py,sha256=16Tdff74OkWmnKSfmV6qrNkgsK12gOtMMppwWmIAFIo,144
3
- odoo/addons/l10n_br_fiscal/__manifest__.py,sha256=k-p0ppzQh-f_nHEfCUchORANc8QU6c4KwxFaB-sTUl4,4115
3
+ odoo/addons/l10n_br_fiscal/__manifest__.py,sha256=f-BSEl1cZ0fI-bbz1x8HTgEhTtCMIzi7Ogb2r4wd7tk,4115
4
4
  odoo/addons/l10n_br_fiscal/hooks.py,sha256=cna_821w1vrwbfQd59YVY66cU9hhY0av2Zwzr5nHDVI,4825
5
5
  odoo/addons/l10n_br_fiscal/tools.py,sha256=nh67fxnJjF3Y-yfHl2mJh6TxMkr8r8GKEQ6NJliTAHE,2488
6
6
  odoo/addons/l10n_br_fiscal/constants/fiscal.py,sha256=ICWcrew-iUcWFgF4bLzdjUtbMdaejZ0AucwLFu5u1fo,14935
@@ -75,7 +75,7 @@ odoo/addons/l10n_br_fiscal/models/document_eletronic.py,sha256=sBM2hS_S20840zVTh
75
75
  odoo/addons/l10n_br_fiscal/models/document_email.py,sha256=ikGhCrTI18X01RszlCqO0tvhTOKr2d5KJLcj_QA1o_Y,2113
76
76
  odoo/addons/l10n_br_fiscal/models/document_event.py,sha256=iO8CxGe7_Til9tsvywxS4b4wNBwm4Cr9wyiv7IK_FMw,11311
77
77
  odoo/addons/l10n_br_fiscal/models/document_fiscal_line_mixin.py,sha256=v9Wv0b206PBoUg5WmldqIGlpWwaulNmBxFO_3Ii9714,26240
78
- odoo/addons/l10n_br_fiscal/models/document_fiscal_line_mixin_methods.py,sha256=0EnhGSHgP1531dmoDs6Kjy4NXEzrUkK8Y2j5y4dFPeQ,32977
78
+ odoo/addons/l10n_br_fiscal/models/document_fiscal_line_mixin_methods.py,sha256=cszQZfyvZdUJB6qNsDDnlofeRLDi8qCw_zKvSdYmhVc,33249
79
79
  odoo/addons/l10n_br_fiscal/models/document_fiscal_mixin.py,sha256=1Ep0ClxXpMTB_mzikF_3gdA3Nk6N2YxMR8yDq_QoOAg,282
80
80
  odoo/addons/l10n_br_fiscal/models/document_fiscal_mixin_fields.py,sha256=tLYUrorgnXmsWAVM80AI60lsh8cee8pJ_bFDIAioz04,11347
81
81
  odoo/addons/l10n_br_fiscal/models/document_fiscal_mixin_methods.py,sha256=XdbVoBuRCgPL_viEfELzp0mQgbqf-h696QC_RlA45DE,11427
@@ -141,7 +141,7 @@ odoo/addons/l10n_br_fiscal/readme/USAGE.rst,sha256=jDnMjM42hjTlqhbpIzjkhJo59eX4j
141
141
  odoo/addons/l10n_br_fiscal/security/fiscal_security.xml,sha256=c4D3MoIsVnkZ1pDY_iw8jM2hBPz3VCkl5JKnm_hkau0,3700
142
142
  odoo/addons/l10n_br_fiscal/security/ir.model.access.csv,sha256=63NQv85E3jV-T-Zw4pB72Jrdh6xPQ42glHQpOASGte0,15362
143
143
  odoo/addons/l10n_br_fiscal/static/description/icon.png,sha256=Vd1HydYBoGCzNfCqxLlch2i2aeCcyxo-uRxWNp6oMbw,14836
144
- odoo/addons/l10n_br_fiscal/static/description/index.html,sha256=abrqwKzZs1HG5YPqZ_L_6JPBxfK2CmFVYlHuNRkAjOk,26256
144
+ odoo/addons/l10n_br_fiscal/static/description/index.html,sha256=zIYYrx3uW6HQ1kI0VI0c7lK9WQzpPWP9-Grp05DmyWw,26256
145
145
  odoo/addons/l10n_br_fiscal/static/img/fiscal_dashboard.png,sha256=Q0fpqFNqEXh6m6E1aJfzSKV2tQ9lC1Y-ofUt6qxVupc,151668
146
146
  odoo/addons/l10n_br_fiscal/static/img/fiscal_line.png,sha256=S4Q4OGSzGnbfm4W5sQVvnD4uUzxS6tbJGT_gs3pB4K0,134276
147
147
  odoo/addons/l10n_br_fiscal/static/img/fiscal_operation.png,sha256=2614c1XjxwVznh707e9gujlUXg0ttutKD1ZiSMTqyv8,105871
@@ -224,7 +224,7 @@ odoo/addons/l10n_br_fiscal/wizards/document_status_wizard.py,sha256=_hsF1mQdknc0
224
224
  odoo/addons/l10n_br_fiscal/wizards/document_status_wizard.xml,sha256=S9hSkgbBKCt78bTe3sRupfnIcmZZ8KWhaZ9q_PKYvgc,2483
225
225
  odoo/addons/l10n_br_fiscal/wizards/invalidate_number_wizard.py,sha256=VYw_GXEdqsEW5kV8RJk-vP1X6KW_CafP1nxggdOICNY,1083
226
226
  odoo/addons/l10n_br_fiscal/wizards/invalidate_number_wizard.xml,sha256=H0JzzzbJmWziLZjZ8acQsqJcgsaYD3M6I3OydoNFuUc,1215
227
- odoo_addon_l10n_br_fiscal-15.0.1.20.2.1.dist-info/METADATA,sha256=0jnqvPTQrgIomoKEySQm0BhDlkCDypJgXNYfNfgQhvg,14173
228
- odoo_addon_l10n_br_fiscal-15.0.1.20.2.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
229
- odoo_addon_l10n_br_fiscal-15.0.1.20.2.1.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
230
- odoo_addon_l10n_br_fiscal-15.0.1.20.2.1.dist-info/RECORD,,
227
+ odoo_addon_l10n_br_fiscal-15.0.1.20.3.dist-info/METADATA,sha256=UmAXhWXqmMKHyQb8xSM5cgCy9pOlZgVKEO3zzJDD8BQ,14171
228
+ odoo_addon_l10n_br_fiscal-15.0.1.20.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
229
+ odoo_addon_l10n_br_fiscal-15.0.1.20.3.dist-info/top_level.txt,sha256=qBj40grFkGOfDZ2WDSw3y1RnDlgG0u8rP8pvGNdbz4w,5
230
+ odoo_addon_l10n_br_fiscal-15.0.1.20.3.dist-info/RECORD,,