odoo-addon-l10n-br-fiscal 16.0.8.0.0.2__py3-none-any.whl → 16.0.8.0.2__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.
@@ -11,7 +11,7 @@ Módulo fiscal brasileiro
11
11
  !! This file is generated by oca-gen-addon-readme !!
12
12
  !! changes will be overwritten. !!
13
13
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
14
- !! source digest: sha256:d4aad26a6a617cbc6968550406781562112344606ab00e1a60fc2617db85d829
14
+ !! source digest: sha256:cf48b3dc8a30c761b96bdff67361a3a6a6f6c8ef94813acb868ad483db2c7a59
15
15
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
16
16
 
17
17
  .. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png
@@ -10,7 +10,7 @@
10
10
  "maintainers": ["renatonlima", "rvalyi"],
11
11
  "website": "https://github.com/OCA/l10n-brazil",
12
12
  "development_status": "Production/Stable",
13
- "version": "16.0.8.0.0",
13
+ "version": "16.0.8.0.2",
14
14
  "depends": [
15
15
  "product",
16
16
  "uom_alias",
@@ -20,11 +20,6 @@ _tables_renames = [
20
20
  ),
21
21
  # l10n_br_fiscal/models/res_company.py: cnae_secondary_ids
22
22
  ("res_company_fiscal_cnae_rel", "l10n_br_fiscal_cnae_res_company_rel"),
23
- # l10n_br_fiscal/models/product_template.py: tax_definition_ids
24
- (
25
- "tax_definition_product_rel",
26
- "l10n_br_fiscal_tax_definition_product_template_rel",
27
- ),
28
23
  # l10n_br_fiscal/models/document_mixin.py: comment_ids
29
24
  # (Abstract, assumes concrete l10n_br_fiscal.document)
30
25
  (
@@ -93,14 +88,6 @@ _columns_renames = {
93
88
  ("company_id", "res_company_id"),
94
89
  ("cnae_id", "l10n_br_fiscal_cnae_id"),
95
90
  ],
96
- # tax_definition_product_rel -> l10n_br_fiscal_tax_definition_product_template_rel
97
- "l10n_br_fiscal_tax_definition_product_template_rel": [
98
- (
99
- "product_id",
100
- "product_template_id",
101
- ), # Assuming it was product_template's field
102
- ("tax_definition_id", "l10n_br_fiscal_tax_definition_id"),
103
- ],
104
91
  # l10n_br_fiscal_document_mixin_comment_rel
105
92
  # -> l10n_br_fiscal_comment_l10n_br_fiscal_document_rel
106
93
  "l10n_br_fiscal_comment_l10n_br_fiscal_document_rel": [
@@ -183,6 +170,43 @@ _columns_renames = {
183
170
  }
184
171
 
185
172
 
173
+ def rename_tables(cr, table_spec):
174
+ """
175
+ Rename tables without touching indexes or constraints.
176
+ Verify that the table exists before renaming it.
177
+ """
178
+ for old, new in table_spec:
179
+ # Check whether the table exists
180
+ cr.execute("SELECT to_regclass(%s)", (old,))
181
+ if cr.fetchone()[0] is None:
182
+ _logger.info(f"Table {old} not found – skipping rename")
183
+ continue
184
+
185
+ _logger.info(f"Renaming table {old} → {new}")
186
+ openupgrade.logged_query(
187
+ cr,
188
+ f"ALTER TABLE {old} RENAME TO {new}",
189
+ )
190
+
191
+
192
+ def rename_columns(cr, column_spec):
193
+ """
194
+ Rename columns of existing tables.
195
+ """
196
+ for table, columns in column_spec.items():
197
+ cr.execute("SELECT to_regclass(%s)", (table,))
198
+ if cr.fetchone()[0] is None:
199
+ _logger.info(f"Table {table} not found – skipping column renames")
200
+ continue
201
+
202
+ for old, new in columns:
203
+ _logger.info(f"Renaming {table}.{old} → {new}")
204
+ openupgrade.logged_query(
205
+ cr,
206
+ f"ALTER TABLE {table} RENAME {old} TO {new}",
207
+ )
208
+
209
+
186
210
  @openupgrade.migrate()
187
211
  def migrate(env, version):
188
212
  """
@@ -192,5 +216,5 @@ def migrate(env, version):
192
216
  openupgrade.logged_query(
193
217
  env.cr, "DROP TABLE l10n_br_fiscal_tax_definition_res_country_state_rel;"
194
218
  ) # see https://github.com/OCA/l10n-brazil/issues/3748
195
- openupgrade.rename_tables(env.cr, _tables_renames)
196
- openupgrade.rename_columns(env.cr, _columns_renames)
219
+ rename_tables(env.cr, _tables_renames)
220
+ rename_columns(env.cr, _columns_renames)
@@ -1,64 +1,33 @@
1
- # Copyright (C) 2025 - TODAY - Raphaël Valyi - Akretion <raphael.valyi@akretion.com.br>
1
+ # Copyright (C) 2025 - Raphaël Valyi - Akretion <raphael.valyi@akretion.com.br>
2
+ # Copyright (C) 2025 - Antônio S. Pereira Neto - Engenere <neto@engenere.one>
2
3
  # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3
4
 
4
-
5
5
  from openupgradelib import openupgrade
6
- from psycopg2.extras import execute_values
7
-
8
- to_install = "uom_alias"
9
-
10
-
11
- def install_new_modules(cr):
12
- sql = f"""
13
- UPDATE ir_module_module
14
- SET state='to install'
15
- WHERE name = '{to_install}' AND state='uninstalled'
16
- """
17
- openupgrade.logged_query(cr, sql)
18
6
 
19
7
 
20
8
  @openupgrade.migrate()
21
9
  def migrate(env, version):
22
- install_new_modules(env.cr)
23
- openupgrade.logged_query(env.cr, "DELETE from ir_model WHERE model = 'uom.alias'")
24
- openupgrade.logged_query(
25
- env.cr,
26
- "SELECT id, uom_id, code, write_uid, create_uid, "
27
- "write_date, create_date FROM uom_uom_alternative",
28
- )
29
- alternatives = env.cr.fetchall()
30
- openupgrade.rename_models(
31
- env.cr,
32
- [
33
- (
34
- "uom.uom.alternative",
35
- "uom.alias",
36
- ),
37
- ],
38
- )
39
- execute_values(
40
- env.cr,
41
- """INSERT INTO uom_alias
42
- (id, uom_id, code, write_uid, create_uid, write_date, create_date)
43
- VALUES %s""",
44
- alternatives,
45
- template="(%s, %s, %s, %s, %s, %s, %s)", # Ensures proper escaping
46
- )
47
-
48
- # avoid deleting uom.alias model, table and columns
49
- # along with the old ir.model.data records:
50
- openupgrade.logged_query(
51
- env.cr,
52
- "DELETE FROM ir_model_data WHERE name = 'model_uom_alias' "
53
- "and module = 'l10n_br_fiscal'",
54
- )
10
+ # move data
55
11
  openupgrade.logged_query(
56
12
  env.cr,
57
- "DELETE FROM ir_model_data where model='ir.model.fields' "
58
- "and module = 'l10n_br_fiscal' and name ilike 'field_uom_uom__%'",
13
+ """
14
+ INSERT INTO uom_alias (uom_id, code, write_uid, create_uid, write_date,
15
+ create_date)
16
+ SELECT uom_id, code, write_uid, create_uid, write_date, create_date
17
+ FROM uom_uom_alternative
18
+ """,
59
19
  )
20
+ # update xmlids
60
21
  openupgrade.logged_query(
61
22
  env.cr,
62
- "DELETE FROM ir_model_data where model='ir.model.fields' "
63
- "and module = 'l10n_br_fiscal' and name ilike 'field_uom_alias__%'",
23
+ """
24
+ UPDATE ir_model_data AS imd
25
+ SET model = 'uom.alias',
26
+ res_id = new_alias.id
27
+ FROM uom_uom_alternative AS old_alias
28
+ JOIN uom_alias AS new_alias
29
+ ON new_alias.code = old_alias.code
30
+ WHERE imd.model = 'uom.uom.alternative'
31
+ AND imd.res_id = old_alias.id
32
+ """,
64
33
  )
@@ -372,7 +372,7 @@ ul.auto-toc {
372
372
  !! This file is generated by oca-gen-addon-readme !!
373
373
  !! changes will be overwritten. !!
374
374
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375
- !! source digest: sha256:d4aad26a6a617cbc6968550406781562112344606ab00e1a60fc2617db85d829
375
+ !! source digest: sha256:cf48b3dc8a30c761b96bdff67361a3a6a6f6c8ef94813acb868ad483db2c7a59
376
376
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377
377
  <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/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/l10n-brazil/tree/16.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-16-0/l10n-brazil-16-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=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378
378
  <p><img alt="image" src="https://raw.githubusercontent.com/OCA/l10n-brazil/16.0/l10n_br_fiscal/static/img/fiscal_dashboard.png" /></p>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: odoo-addon-l10n_br_fiscal
3
- Version: 16.0.8.0.0.2
3
+ Version: 16.0.8.0.2
4
4
  Requires-Python: >=3.10
5
5
  Requires-Dist: erpbrasil.base>=2.3.0
6
6
  Requires-Dist: odoo-addon-l10n_br_base>=16.0dev,<16.1dev
@@ -31,7 +31,7 @@ Módulo fiscal brasileiro
31
31
  !! This file is generated by oca-gen-addon-readme !!
32
32
  !! changes will be overwritten. !!
33
33
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
34
- !! source digest: sha256:d4aad26a6a617cbc6968550406781562112344606ab00e1a60fc2617db85d829
34
+ !! source digest: sha256:cf48b3dc8a30c761b96bdff67361a3a6a6f6c8ef94813acb868ad483db2c7a59
35
35
  !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
36
36
 
37
37
  .. |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=UKJa24y-fCDTLxmahJiUhQ2lmjMNWUXKdY7NI8WwIfs,13957
1
+ odoo/addons/l10n_br_fiscal/README.rst,sha256=7aGHGDCKald1cFEmC72TBN_XLLuYfR0FAmWRViqpZww,13957
2
2
  odoo/addons/l10n_br_fiscal/__init__.py,sha256=BQXfCjW4ehK1W1j0z6k8xN7Q2LoZBCjjvYDkQt6nSkI,2717
3
- odoo/addons/l10n_br_fiscal/__manifest__.py,sha256=JRnEnErvgVQQJPomVzzAbzNblHr2tI6RvhZb41MiSdY,4864
3
+ odoo/addons/l10n_br_fiscal/__manifest__.py,sha256=NSHbzU5JymuzkGrb7FwKNfon2v_RJc8lv9Ka5xTAZNo,4864
4
4
  odoo/addons/l10n_br_fiscal/tools.py,sha256=4oAxP-kPKq3L3xhNdhOivxWakJa-j0ISpVIBCtsB0NQ,4061
5
5
  odoo/addons/l10n_br_fiscal/constants/fiscal.py,sha256=F2a4jYAk2j2Yh1Xw7WeS1GcLfW1DbjeNgEF6l7135wc,14962
6
6
  odoo/addons/l10n_br_fiscal/constants/icms.py,sha256=rHlM6jyRvhrIm03sd6guS1xh7SptADLltPmRJ3C_Vh8,3512
@@ -56,8 +56,8 @@ odoo/addons/l10n_br_fiscal/i18n/l10n_br_fiscal.pot,sha256=zlEOv_dIaSLa5XdQuJkPKg
56
56
  odoo/addons/l10n_br_fiscal/i18n/pt_BR.po,sha256=kgX6hjtpZ4I1xIOy2S-YL848CETHn6v_L6ndzMDYTxY,496094
57
57
  odoo/addons/l10n_br_fiscal/migrations/16.0.2.0.0/pre-migration.py,sha256=tw6d7NZrbOmjEaGHI9y-AMiNWNqf_mceTFqTFXuc6cU,687
58
58
  odoo/addons/l10n_br_fiscal/migrations/16.0.2.15.0/pre-migration.py,sha256=5-aWMxFdyNbyw_MJbfyiSFHnm9zxWKYHibOW5GNauWc,517
59
- odoo/addons/l10n_br_fiscal/migrations/16.0.4.0.0/pre-migration.py,sha256=_oWEDuOEkcZcOfd80CjBx_GsAFfalfRicbJ5wx-70ec,8506
60
- odoo/addons/l10n_br_fiscal/migrations/16.0.5.0.0/pre-migration.py,sha256=bnP58iiRj92rv-Kw5GyhD5yaxGQzL9KGK-PY3Kl9Wk8,1947
59
+ odoo/addons/l10n_br_fiscal/migrations/16.0.4.0.0/pre-migration.py,sha256=HcFE37sX6j9EHI2lez0NR7kpblHc8RYyoU0ezDd_rpY,9106
60
+ odoo/addons/l10n_br_fiscal/migrations/16.0.5.0.0/pre-migration.py,sha256=toruTzjKBjAQ34wwCAuC29alrubO00YFhb0_DiG-5B4,1041
61
61
  odoo/addons/l10n_br_fiscal/migrations/16.0.5.2.0/pre-migration.py,sha256=5R4xJtDDacOxP9FHU8yTZ8zSDGSHIy3Z7K84PQ6snBo,748
62
62
  odoo/addons/l10n_br_fiscal/models/__init__.py,sha256=Ez9m9vHzA-K4yYmfYM_TcHbGtsLSsUI7CCSgItbVx-g,1586
63
63
  odoo/addons/l10n_br_fiscal/models/cest.py,sha256=0lYMJqJxvE4jzsg8sUAXphHBHNSBCJ-LEa-ma0ZtAMA,1703
@@ -123,7 +123,7 @@ odoo/addons/l10n_br_fiscal/readme/USAGE.md,sha256=Dw3uZaHJCUtV0xFq6VOQvF2G5fS_oS
123
123
  odoo/addons/l10n_br_fiscal/security/fiscal_security.xml,sha256=PxRef68OVjlCVMOJZbhieVxivgKJYJm9r3TiZO4RerA,3362
124
124
  odoo/addons/l10n_br_fiscal/security/ir.model.access.csv,sha256=4R4STg4HCTG37rFb3YBfZRlEJMSX7fU5fwtHHWI9aeY,14195
125
125
  odoo/addons/l10n_br_fiscal/static/description/icon.png,sha256=Vd1HydYBoGCzNfCqxLlch2i2aeCcyxo-uRxWNp6oMbw,14836
126
- odoo/addons/l10n_br_fiscal/static/description/index.html,sha256=YBjTjXZfST-N54yHWLDGuE3exJXgUAsacQHUgzT1wlI,26637
126
+ odoo/addons/l10n_br_fiscal/static/description/index.html,sha256=no7wnnFXuUgVgo10M57xHZYCoERWfClTkRZ9d6Lgsdw,26637
127
127
  odoo/addons/l10n_br_fiscal/static/img/fiscal_dashboard.png,sha256=Q0fpqFNqEXh6m6E1aJfzSKV2tQ9lC1Y-ofUt6qxVupc,151668
128
128
  odoo/addons/l10n_br_fiscal/static/img/fiscal_line.png,sha256=S4Q4OGSzGnbfm4W5sQVvnD4uUzxS6tbJGT_gs3pB4K0,134276
129
129
  odoo/addons/l10n_br_fiscal/static/img/fiscal_operation.png,sha256=2614c1XjxwVznh707e9gujlUXg0ttutKD1ZiSMTqyv8,105871
@@ -190,7 +190,7 @@ odoo/addons/l10n_br_fiscal/views/tax_view.xml,sha256=qFNYcvJ0o59fDFJ-jEqZ6IYoivt
190
190
  odoo/addons/l10n_br_fiscal/wizards/__init__.py,sha256=_sLxjpuJblbtSngjCsnMm7Iur5afF5xLEkAQLu4sy7I,69
191
191
  odoo/addons/l10n_br_fiscal/wizards/base_wizard_mixin.py,sha256=-r25us0vdNCSe11Gnf_tyPtN1qq-JKsL-fgWbPGktRo,2856
192
192
  odoo/addons/l10n_br_fiscal/wizards/document_status_wizard.py,sha256=KsYj5YWWePO7uk0psBsFdnCL71eLWhcyg7_c7J4G6vA,818
193
- odoo_addon_l10n_br_fiscal-16.0.8.0.0.2.dist-info/METADATA,sha256=-B_3zUdgAtT6khPX44FafvekKC8AX8dNy0waODbbQi0,14721
194
- odoo_addon_l10n_br_fiscal-16.0.8.0.0.2.dist-info/WHEEL,sha256=9fEMia4zL7ZuZbnCOrcYogUhmn4XFIVaJ8G4YGI31xc,81
195
- odoo_addon_l10n_br_fiscal-16.0.8.0.0.2.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
196
- odoo_addon_l10n_br_fiscal-16.0.8.0.0.2.dist-info/RECORD,,
193
+ odoo_addon_l10n_br_fiscal-16.0.8.0.2.dist-info/METADATA,sha256=UGxYHXXOVYUskrRYdNImwJ3NIhYAF5hiKx2iA-VvOc8,14719
194
+ odoo_addon_l10n_br_fiscal-16.0.8.0.2.dist-info/WHEEL,sha256=9fEMia4zL7ZuZbnCOrcYogUhmn4XFIVaJ8G4YGI31xc,81
195
+ odoo_addon_l10n_br_fiscal-16.0.8.0.2.dist-info/top_level.txt,sha256=QE6RBQ0QX5f4eFuUcGgU5Kbq1A_qJcDs-e_vpr6pmfU,4
196
+ odoo_addon_l10n_br_fiscal-16.0.8.0.2.dist-info/RECORD,,