diff --git a/crm_claim_code/README.rst b/crm_claim_code/README.rst index dbb4686654a5..cbb31130a771 100644 --- a/crm_claim_code/README.rst +++ b/crm_claim_code/README.rst @@ -77,6 +77,10 @@ Contributors - Pedro M. Baeza - Vicent Cubells +- `APSL-Nagarro `__: + + - Bernat Obrador + Maintainers ----------- diff --git a/crm_claim_code/__manifest__.py b/crm_claim_code/__manifest__.py index 44c176333ba4..65c3b39d7f60 100644 --- a/crm_claim_code/__manifest__.py +++ b/crm_claim_code/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Sequential Code for Claims", - "version": "16.0.1.0.1", + "version": "17.0.1.0.1", "category": "Customer Relationship Management", "author": "AvanzOSC, Tecnativa, Odoo Community Association (OCA)", "website": "https://github.com/OCA/crm", diff --git a/crm_claim_code/hooks.py b/crm_claim_code/hooks.py index 5a07394cb7da..6622f4ae3927 100644 --- a/crm_claim_code/hooks.py +++ b/crm_claim_code/hooks.py @@ -1,30 +1,26 @@ # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl). -from odoo import SUPERUSER_ID -from odoo.api import Environment new_field_code_added = False -def create_code_equal_to_id(cr): - cr.execute( +def create_code_equal_to_id(env): + env.cr.execute( "SELECT column_name FROM information_schema.columns " "WHERE table_name = 'crm_claim' AND column_name = 'code'" ) - if not cr.fetchone(): - cr.execute("ALTER TABLE crm_claim ADD COLUMN code character varying;") - cr.execute("UPDATE crm_claim SET code = id;") + if not env.cr.fetchone(): + env.cr.execute("ALTER TABLE crm_claim ADD COLUMN code character varying;") + env.cr.execute("UPDATE crm_claim SET code = id;") global new_field_code_added new_field_code_added = True -def assign_old_sequences(cr, registry): +def assign_old_sequences(env): if not new_field_code_added: # the field was already existing before the installation of the addon return - env = Environment(cr, SUPERUSER_ID, {}) - sequence_model = env["ir.sequence"] claims = env["crm.claim"].search([], order="id") diff --git a/crm_claim_code/models/crm_claim.py b/crm_claim_code/models/crm_claim.py index b278122016be..a8c73d801748 100644 --- a/crm_claim_code/models/crm_claim.py +++ b/crm_claim_code/models/crm_claim.py @@ -13,7 +13,6 @@ class CrmClaim(models.Model): string="Claim Number", required=True, default="/", - readonly=True, copy=False, ) diff --git a/crm_claim_code/readme/CONTRIBUTORS.md b/crm_claim_code/readme/CONTRIBUTORS.md index 1f18d5b736b0..8ac9792dc32f 100644 --- a/crm_claim_code/readme/CONTRIBUTORS.md +++ b/crm_claim_code/readme/CONTRIBUTORS.md @@ -7,3 +7,5 @@ - Ernesto Tejeda - Pedro M. Baeza - Vicent Cubells +- [APSL-Nagarro](): + - Bernat Obrador \<\> diff --git a/crm_claim_code/static/description/index.html b/crm_claim_code/static/description/index.html index 5c8c377c2f50..c4209408abd9 100644 --- a/crm_claim_code/static/description/index.html +++ b/crm_claim_code/static/description/index.html @@ -426,6 +426,10 @@

Contributors

  • Vicent Cubells
  • +
  • APSL-Nagarro: +
  • diff --git a/crm_claim_code/views/crm_claim_view.xml b/crm_claim_code/views/crm_claim_view.xml index 2caf296c1277..241e31d6fb8f 100644 --- a/crm_claim_code/views/crm_claim_view.xml +++ b/crm_claim_code/views/crm_claim_view.xml @@ -6,7 +6,7 @@ - + @@ -16,7 +16,7 @@ - +