diff --git a/README.md b/README.md index a566a39..8d81d3c 100644 --- a/README.md +++ b/README.md @@ -12,18 +12,18 @@ addon | version | summary [multi_step_wizard](multi_step_wizard/) | 3.0.1.0.0| Multi-Steps Wizards [base_menu_visibility_restriction](base_menu_visibility_restriction/) | 3.0.1.0.0| Restrict (with groups) menu visibilty [base_substate](base_substate/) | 3.0.1.0.0| Base Sub State -[base_technical_features](base_technical_features/) | 3.0.1.0.0| Access to technical features without activating debug mode +[base_technical_features](base_technical_features/) | 3.0.1.0.1| Access to technical features without activating debug mode [base_search_custom_field_filter](base_search_custom_field_filter/) | 3.0.1.0.0| Add custom filters for fields via UI [server_action_mass_edit](server_action_mass_edit/) | 3.0.1.0.1| Mass Editing [sequence_reset_period](sequence_reset_period/) | 3.0.1.0.0| Auto-generate yearly/monthly/weekly/daily sequence period ranges [base_optional_quick_create](base_optional_quick_create/) | 3.0.1.0.0| Avoid "quick create" on m2o fields, on a "by model" basis [base_tier_validation_forward](base_tier_validation_forward/) | 3.0.1.0.0| Forward option for base tiers [announcement](announcement/) | 3.0.1.0.0| Notify internal users about relevant organization stuff -[base_tier_validation](base_tier_validation/) | 3.0.2.1.3| Implement a validation process based on tiers. +[base_tier_validation](base_tier_validation/) | 3.0.2.2.1| Implement a validation process based on tiers. [base_revision](base_revision/) | 3.0.1.0.0| Keep track of revised document [date_range_account](date_range_account/) | 3.0.1.0.0| Add Date Range menu entry in Invoicing app [barcode_action](barcode_action/) | 3.0.1.0.0| Allows to use barcodes as a launcher -[date_range](date_range/) | 3.0.1.2.0| Manage all kind of date range +[date_range](date_range/) | 3.0.1.2.1| Manage all kind of date range [base_tier_validation_formula](base_tier_validation_formula/) | 3.0.1.0.0| Formulas for Base tier validation diff --git a/announcement/i18n/it.po b/announcement/i18n/it.po index 371c8ea..c93491c 100644 --- a/announcement/i18n/it.po +++ b/announcement/i18n/it.po @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"PO-Revision-Date: 2024-04-30 10:35+0000\n" +"PO-Revision-Date: 2024-10-21 10:06+0000\n" "Last-Translator: mymage \n" "Language-Team: none\n" "Language: it\n" @@ -14,7 +14,7 @@ msgstr "" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" -"X-Generator: Weblate 4.17\n" +"X-Generator: Weblate 5.6.2\n" #. module: announcement #: model_terms:ir.ui.view,arch_db:announcement.announcement_management_view_form @@ -262,7 +262,7 @@ msgstr "Data inizio notifica" #. module: announcement #: model:ir.model.fields,field_description:announcement.field_announcement_tag__parent_id msgid "Parent Tag" -msgstr "Etichetta adre" +msgstr "Etichetta padre" #. module: announcement #: model:ir.model.fields.selection,name:announcement.selection__read_announcement_wizard__read_state__read diff --git a/base_technical_features/README.rst b/base_technical_features/README.rst index ec554ff..33f0a28 100644 --- a/base_technical_features/README.rst +++ b/base_technical_features/README.rst @@ -7,7 +7,7 @@ Technical features group !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:b1f95f15bf88e671bb7843b72fce85702596559dd2c986cdfb15b0219745b85f + !! source digest: sha256:3570fc5d77fc54c4e2464d9644657778bbf0077fbe794207e6fa7b81bbbcf21f !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png diff --git a/base_technical_features/__manifest__.py b/base_technical_features/__manifest__.py index dd05706..a17da66 100644 --- a/base_technical_features/__manifest__.py +++ b/base_technical_features/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Technical features group", "summary": "Access to technical features without activating debug mode", - "version": "3.0.1.0.0", + "version": "3.0.1.0.1", "category": "Usability", "website": "https://gitlab.com/flectra-community/server-ux", "author": "Opener B.V., Odoo Community Association (OCA)", diff --git a/base_technical_features/static/description/index.html b/base_technical_features/static/description/index.html index 912726a..5479c0d 100644 --- a/base_technical_features/static/description/index.html +++ b/base_technical_features/static/description/index.html @@ -1,4 +1,3 @@ - @@ -9,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -275,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code { margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -301,7 +301,7 @@ span.option { span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:b1f95f15bf88e671bb7843b72fce85702596559dd2c986cdfb15b0219745b85f +!! source digest: sha256:3570fc5d77fc54c4e2464d9644657778bbf0077fbe794207e6fa7b81bbbcf21f !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

Beta License: AGPL-3 OCA/server-ux Translate me on Weblate Try me on Runboat

@@ -428,7 +428,9 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

Maintainers

This module is maintained by the OCA.

-Odoo Community Association + +Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

diff --git a/base_tier_validation/COPYRIGHT b/base_tier_validation/COPYRIGHT index 7604876..bdcc65f 100644 --- a/base_tier_validation/COPYRIGHT +++ b/base_tier_validation/COPYRIGHT @@ -5,6 +5,7 @@ Most of the files are

Mature License: AGPL-3 OCA/server-ux Translate me on Weblate Try me on Runboat

Validating some operations is a common need across different areas in a @@ -382,6 +382,11 @@ some development.

See purchase_tier_validation as an example of implementation.

+

Additionally, if your state field is a (stored) computed field, you need +to set _tier_validation_state_field_is_computed to True in your +model Python file, and you will want to add the dependent fields of the +compute method in _get_after_validation_exceptions and +_get_under_validation_exceptions.

Table of contents

    @@ -594,7 +599,6 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

    Authors

      -
    • brain-tec AG
    • ForgeFlow
    @@ -618,6 +622,7 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
  • Houzéfa Abbasbhay
+
  • Stefan Rijnhart <stefan@opener.amsterdam>
  • diff --git a/base_tier_validation/tests/common.py b/base_tier_validation/tests/common.py index e1e58d8..4d030c4 100644 --- a/base_tier_validation/tests/common.py +++ b/base_tier_validation/tests/common.py @@ -19,14 +19,21 @@ class CommonTierValidation(common.TransactionCase): TierDefinition, TierValidationTester, TierValidationTester2, + TierValidationTesterComputed, ) cls.loader.update_registry( - (TierValidationTester, TierValidationTester2, TierDefinition) + ( + TierValidationTester, + TierValidationTester2, + TierValidationTesterComputed, + TierDefinition, + ) ) cls.test_model = cls.env[TierValidationTester._name] cls.test_model_2 = cls.env[TierValidationTester2._name] + cls.test_model_computed = cls.env[TierValidationTesterComputed._name] cls.tester_model = cls.env["ir.model"].search( [("model", "=", "tier.validation.tester")] @@ -34,34 +41,32 @@ class CommonTierValidation(common.TransactionCase): cls.tester_model_2 = cls.env["ir.model"].search( [("model", "=", "tier.validation.tester2")] ) - - # Access record: - cls.env["ir.model.access"].create( - { - "name": "access.tester", - "model_id": cls.tester_model.id, - "perm_read": 1, - "perm_write": 1, - "perm_create": 1, - "perm_unlink": 1, - } - ) - cls.env["ir.model.access"].create( - { - "name": "access.tester2", - "model_id": cls.tester_model_2.id, - "perm_read": 1, - "perm_write": 1, - "perm_create": 1, - "perm_unlink": 1, - } + cls.tester_model_computed = cls.env["ir.model"].search( + [("model", "=", "tier.validation.tester.computed")] ) - # Define views to avoid automatic views with all fields. - for model in cls.test_model._name, cls.test_model_2._name: + models = ( + cls.tester_model, + cls.tester_model_2, + cls.tester_model_computed, + ) + for model in models: + # Access record: + cls.env["ir.model.access"].create( + { + "name": f"access {model.name}", + "model_id": model.id, + "perm_read": 1, + "perm_write": 1, + "perm_create": 1, + "perm_unlink": 1, + } + ) + + # Define views to avoid automatic views with all fields. cls.env["ir.ui.view"].create( { - "model": model, + "model": model.model, "name": f"Demo view for {model}", "arch": """
    @@ -103,6 +108,7 @@ class CommonTierValidation(common.TransactionCase): cls.test_record = cls.test_model.create({"test_field": 1.0}) cls.test_record_2 = cls.test_model_2.create({"test_field": 1.0}) + cls.test_record_computed = cls.test_model_computed.create({"test_field": 1.0}) cls.tier_def_obj.create( { @@ -142,6 +148,19 @@ class CommonTierValidation(common.TransactionCase): } ) + cls.tier_def_obj.create( + { + "model_id": cls.tester_model_computed.id, + "review_type": "individual", + "reviewer_id": cls.test_user_1.id, + "definition_domain": "[]", + "approve_sequence": True, + "notify_on_pending": False, + "sequence": 20, + "name": "Definition for computed model", + } + ) + @classmethod def tearDownClass(cls): cls.loader.restore_registry() diff --git a/base_tier_validation/tests/test_tier_validation.py b/base_tier_validation/tests/test_tier_validation.py index 3cf9218..9d01885 100644 --- a/base_tier_validation/tests/test_tier_validation.py +++ b/base_tier_validation/tests/test_tier_validation.py @@ -970,6 +970,35 @@ class TierTierValidation(CommonTierValidation): ) self.assertEqual(self.test_record.test_validation_field, 4) + def test_26_computed_state_field(self): + """Test the regular flow on a model where state is a computed field""" + # The record cannot be confirmed without validation + with self.assertRaisesRegex( + ValidationError, + "This action needs to be validated", + ): + with self.env.cr.savepoint(): + self.test_record_computed.action_confirm() + # Flush manually to trigger the _write + self.test_record_computed.flush_recordset() + self.assertEqual(self.test_record_computed.state, "draft") + # The validation is performed + self.test_record_computed.request_validation() + self.test_record_computed.invalidate_recordset() + self.assertEqual(self.test_record_computed.review_ids.status, "waiting") + self.test_record_computed.with_user(self.test_user_1).validate_tier() + self.test_record_computed.invalidate_recordset() + self.assertEqual(self.test_record_computed.review_ids.status, "approved") + # After validation, the record can be confirmed + self.test_record_computed.action_confirm() + self.test_record_computed.flush_recordset() + self.assertEqual(self.test_record_computed.state, "confirmed") + # After cancelling, the reviews are removed + self.test_record_computed.action_cancel() + self.test_record_computed.flush_recordset() + self.assertFalse(self.test_record_computed.review_ids) + self.test_record_computed.invalidate_recordset() + @tagged("at_install") class TierTierValidationView(CommonTierValidation): diff --git a/base_tier_validation/tests/tier_validation_tester.py b/base_tier_validation/tests/tier_validation_tester.py index 38c8ee1..f63709a 100644 --- a/base_tier_validation/tests/tier_validation_tester.py +++ b/base_tier_validation/tests/tier_validation_tester.py @@ -48,6 +48,59 @@ class TierValidationTester2(models.Model): self.write({"state": "confirmed"}) +class TierValidationTesterComputed(models.Model): + _name = "tier.validation.tester.computed" + _description = "Tier Validation Tester Computed" + _inherit = ["tier.validation"] + _tier_validation_manual_config = False + _tier_validation_state_field_is_computed = True + + confirmed = fields.Boolean() + cancelled = fields.Boolean() + state = fields.Selection( + selection=[ + ("draft", "Draft"), + ("confirmed", "Confirmed"), + ("cancel", "Cancel"), + ], + compute="_compute_state", + store=True, + ) + test_field = fields.Float() + test_validation_field = fields.Float() + user_id = fields.Many2one(string="Assigned to:", comodel_name="res.users") + + @api.model + def _get_after_validation_exceptions(self): + return super()._get_after_validation_exceptions() + [ + "confirmed", + "cancelled", + ] + + @api.model + def _get_under_validation_exceptions(self): + return super()._get_under_validation_exceptions() + [ + "confirmed", + "cancelled", + ] + + @api.depends("confirmed", "cancelled") + def _compute_state(self): + for rec in self: + if rec.cancelled: + rec.state = "cancel" + elif rec.confirmed: + rec.state = "confirmed" + else: + rec.state = "draft" + + def action_confirm(self): + self.write({"confirmed": True}) + + def action_cancel(self): + self.write({"cancelled": True}) + + class TierDefinition(models.Model): _inherit = "tier.definition" @@ -56,4 +109,5 @@ class TierDefinition(models.Model): res = super()._get_tier_validation_model_names() res.append("tier.validation.tester") res.append("tier.validation.tester2") + res.append("tier.validation.tester.computed") return res diff --git a/date_range/README.rst b/date_range/README.rst index 3be5ca0..b1409a4 100644 --- a/date_range/README.rst +++ b/date_range/README.rst @@ -7,7 +7,7 @@ Date Range !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !! source digest: sha256:bef360f14e07013cc293245f850d87fd6cfd11edbb6f8384310c65afc5f86b0a + !! source digest: sha256:adcc800f01bc1399a9e196d4c4ed89ddb1287e99ee0e66d667dc47a6ff09a4db !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png diff --git a/date_range/__manifest__.py b/date_range/__manifest__.py index 4d37aed..8f360dd 100644 --- a/date_range/__manifest__.py +++ b/date_range/__manifest__.py @@ -3,7 +3,7 @@ { "name": "Date Range", "summary": "Manage all kind of date range", - "version": "3.0.1.2.0", + "version": "3.0.1.2.1", "category": "Uncategorized", "website": "https://gitlab.com/flectra-community/server-ux", "author": "ACSONE SA/NV, Odoo Community Association (OCA)", diff --git a/date_range/i18n/es_AR.po b/date_range/i18n/es_AR.po index ed57968..f426497 100644 --- a/date_range/i18n/es_AR.po +++ b/date_range/i18n/es_AR.po @@ -9,35 +9,36 @@ msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2017-08-01 02:44+0000\n" -"PO-Revision-Date: 2017-08-01 02:44+0000\n" -"Last-Translator: OCA Transbot , 2016\n" -"Language-Team: Spanish (Argentina) (https://www.transifex.com/oca/" -"teams/23907/es_AR/)\n" +"PO-Revision-Date: 2024-10-07 00:06+0000\n" +"Last-Translator: Ignacio Buioli \n" +"Language-Team: Spanish (Argentina) (https://www.transifex.com/oca/teams/" +"23907/es_AR/)\n" "Language: es_AR\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 5.6.2\n" #. module: date_range #. odoo-python #: code:addons/date_range/models/date_range.py:0 #, python-format msgid "%(name)s is not a valid range (%(date_start)s > %(date_end)s)" -msgstr "" +msgstr "%(name)s no es un rango válido (%(date_start)s > %(date_end)s)" #. module: date_range #. odoo-python #: code:addons/date_range/models/date_range.py:0 #, python-format msgid "%(thisname)s overlaps %(dtname)s" -msgstr "" +msgstr "%(thisname)s sobrescribe %(dtname)s" #. module: date_range #: model_terms:ir.ui.view,arch_db:date_range.date_range_generator_view_form #: model_terms:ir.ui.view,arch_db:date_range.view_date_range_type_form_view msgid "&nbsp;" -msgstr "" +msgstr "&nbsp;" #. module: date_range #: model_terms:ir.ui.view,arch_db:date_range.date_range_generator_view_form @@ -45,59 +46,61 @@ msgid "" ",\n" " or generate" msgstr "" +",\n" +" o generar" #. module: date_range #: model:ir.model.constraint,message:date_range.constraint_date_range_date_range_uniq msgid "A date range must be unique per company !" -msgstr "" +msgstr "¡El rango de fecha debe ser único por compañía!" #. module: date_range #: model:ir.model.constraint,message:date_range.constraint_date_range_type_date_range_type_uniq msgid "A date range type must be unique per company !" -msgstr "" +msgstr "¡El tipo de rango de fecha debe ser único por compañía!" #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range__active #: model:ir.model.fields,field_description:date_range.field_date_range_type__active msgid "Active" -msgstr "" +msgstr "Activo" #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range_type__allow_overlap msgid "Allow Overlap" -msgstr "" +msgstr "Permitir Sobrescritura" #. module: date_range #: model_terms:ir.ui.view,arch_db:date_range.view_date_range_form_view #: model_terms:ir.ui.view,arch_db:date_range.view_date_range_search #: model_terms:ir.ui.view,arch_db:date_range.view_date_range_type_search msgid "Archived" -msgstr "" +msgstr "Archivado" #. module: date_range #: model:ir.actions.server,name:date_range.ir_cron_autocreate_ir_actions_server msgid "Auto-generate date ranges" -msgstr "" +msgstr "Autogenerar rangos de fecha" #. module: date_range #: model_terms:ir.ui.view,arch_db:date_range.view_date_range_type_form_view msgid "Auto-generation settings" -msgstr "" +msgstr "Autogeneración de ajustes" #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range_type__autogeneration_count msgid "Autogeneration Count" -msgstr "" +msgstr "Cuenta de Autogeneración" #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range_type__autogeneration_date_start msgid "Autogeneration Start Date" -msgstr "" +msgstr "Autogeneración de Fecha de Inicio" #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range_type__autogeneration_unit msgid "Autogeneration Unit" -msgstr "" +msgstr "Autogeneración de Unidad" #. module: date_range #: model_terms:ir.ui.view,arch_db:date_range.date_range_generator_view_form @@ -110,17 +113,17 @@ msgstr "Cancelar" #: model:ir.model.fields,field_description:date_range.field_date_range_type__company_id #: model_terms:ir.ui.view,arch_db:date_range.view_date_range_search msgid "Company" -msgstr "" +msgstr "Compañía" #. module: date_range #: model_terms:ir.ui.view,arch_db:date_range.view_date_range_type_form_view msgid "Configuration" -msgstr "" +msgstr "Configuración" #. module: date_range #: model_terms:ir.ui.view,arch_db:date_range.view_date_range_type_form_view msgid "Create" -msgstr "" +msgstr "Crear" #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range__create_uid @@ -139,45 +142,45 @@ msgstr "Creado en" #. module: date_range #: model:ir.model,name:date_range.model_date_range msgid "Date Range" -msgstr "" +msgstr "Rango de Fecha" #. module: date_range #: model:ir.model,name:date_range.model_date_range_generator msgid "Date Range Generator" -msgstr "" +msgstr "Generador de Rango de Fecha" #. module: date_range #: model:ir.model,name:date_range.model_date_range_type #: model_terms:ir.ui.view,arch_db:date_range.view_date_range_type_form_view msgid "Date Range Type" -msgstr "" +msgstr "Tipo de Rango de Fecha" #. module: date_range #: model:ir.actions.act_window,name:date_range.date_range_type_action #: model:ir.ui.menu,name:date_range.menu_date_range_type_action msgid "Date Range Types" -msgstr "" +msgstr "Tipos de Rango de Fecha" #. module: date_range #: model:ir.actions.act_window,name:date_range.date_range_action #: model:ir.ui.menu,name:date_range.menu_date_range_action msgid "Date Ranges" -msgstr "" +msgstr "Rangos de Fecha" #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range_type__date_ranges_exist msgid "Date Ranges Exist" -msgstr "" +msgstr "Rangos de Fecha Existen" #. module: date_range #: model:ir.ui.menu,name:date_range.menu_date_range msgid "Date ranges" -msgstr "" +msgstr "Rangos de fecha" #. module: date_range #: model_terms:ir.ui.view,arch_db:date_range.view_date_range_type_form_view msgid "Defaults for generating date ranges" -msgstr "" +msgstr "Valores predeterminados para generar rangos de fechas" #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range__display_name @@ -190,18 +193,18 @@ msgstr "Mostrar Nombre" #: model:ir.model.fields,field_description:date_range.field_date_range_generator__duration_count #: model:ir.model.fields,field_description:date_range.field_date_range_type__duration_count msgid "Duration" -msgstr "" +msgstr "Duración" #. module: date_range #: model_terms:ir.ui.view,arch_db:date_range.view_date_range_search msgid "End Date" -msgstr "" +msgstr "Fecha de Finalización" #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range__date_end #: model:ir.model.fields,field_description:date_range.field_date_range_generator__date_end msgid "End date" -msgstr "" +msgstr "Fecha de finalización" #. module: date_range #: model:ir.model.fields,help:date_range.field_date_range_generator__name_expr @@ -211,28 +214,31 @@ msgid "" "You can use the Date types 'date_end' and 'date_start', as well as the " "'index' variable." msgstr "" +"Expresión evaluada. Por ejemplo, \"'FY%s' % date_start.strftime('%Y%m%d')\"\n" +"Puede utilizar los tipos de fecha 'date_end' y 'date_start', así como la " +"variable 'index'." #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range_search_mixin__date_range_search_id msgid "Filter by period (technical field)" -msgstr "" +msgstr "Filtrar por período (campo técnico)" #. module: date_range #: model_terms:ir.ui.view,arch_db:date_range.date_range_generator_view_form msgid "Generate" -msgstr "" +msgstr "Generar" #. module: date_range #: model:ir.actions.act_window,name:date_range.date_range_generator_action #: model:ir.ui.menu,name:date_range.menu_date_range_generator_action #: model_terms:ir.ui.view,arch_db:date_range.date_range_generator_view_form msgid "Generate Date Ranges" -msgstr "" +msgstr "Generar Rangos de Fecha" #. module: date_range #: model_terms:ir.ui.view,arch_db:date_range.view_date_range_type_form_view msgid "Generation" -msgstr "" +msgstr "Generación" #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range__id @@ -245,13 +251,15 @@ msgstr "ID" #: model:ir.model.fields,help:date_range.field_date_range_type__allow_overlap msgid "If set, date ranges of same type must not overlap." msgstr "" +"Si está configurado, los rangos de fecha del mismo tipo no deben " +"sobrescribirse." #. module: date_range #. odoo-python #: code:addons/date_range/wizard/date_range_generator.py:0 #, python-format msgid "Invalid name expression: %s" -msgstr "" +msgstr "Nombre de expresión inválido: %s" #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range__write_uid @@ -271,6 +279,7 @@ msgstr "Última actualización el" #: model:ir.model,name:date_range.model_date_range_search_mixin msgid "Mixin class to add a Many2one style period search field" msgstr "" +"Clase Mixin para agregar un campo de búsqueda de período de estilo Many2one" #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range__name @@ -283,77 +292,77 @@ msgstr "Nombre" #: code:addons/date_range/wizard/date_range_generator.py:0 #, python-format msgid "No ranges to generate with these settings" -msgstr "" +msgstr "No hay rangos a generar con estos ajustes" #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range_generator__count msgid "Number of ranges to generate" -msgstr "" +msgstr "Número de rangos a generar" #. module: date_range #: model:ir.model.fields,help:date_range.field_date_range_type__autogeneration_date_start msgid "Only applies when there are no date ranges of this type yet" -msgstr "" +msgstr "Solo aplica cuando no hay rangos de fecha de este tipo aún" #. module: date_range #: model_terms:ir.ui.view,arch_db:date_range.date_range_generator_view_form msgid "Parameters" -msgstr "" +msgstr "Parámetros" #. module: date_range #. odoo-python #: code:addons/date_range/models/date_range_search_mixin.py:0 #, python-format msgid "Period" -msgstr "" +msgstr "Período" #. module: date_range #. odoo-python #: code:addons/date_range/wizard/date_range_generator.py:0 #, python-format msgid "Please enter an end date, or the number of ranges to generate." -msgstr "" +msgstr "Ingrese una fecha de finalización, o el número de rangos a generar." #. module: date_range #. odoo-python #: code:addons/date_range/wizard/date_range_generator.py:0 #, python-format msgid "Please set a prefix or an expression to generate the range names." -msgstr "" +msgstr "Configure un prefijo o una expresión para generar el rango de nombres." #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range_generator__range_name_preview #: model:ir.model.fields,field_description:date_range.field_date_range_type__range_name_preview msgid "Range Name Preview" -msgstr "" +msgstr "Previsualizar Nombre del Rango" #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range_generator__name_expr #: model:ir.model.fields,field_description:date_range.field_date_range_type__name_expr msgid "Range name expression" -msgstr "" +msgstr "Expresión del rango del nombre" #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range_generator__name_prefix #: model:ir.model.fields,field_description:date_range.field_date_range_type__name_prefix msgid "Range name prefix" -msgstr "" +msgstr "Prefijo del rango del nombre" #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range_type__date_range_ids msgid "Ranges" -msgstr "" +msgstr "Rangos" #. module: date_range #: model_terms:ir.ui.view,arch_db:date_range.view_date_range_search msgid "Start Date" -msgstr "" +msgstr "Fecha de Inicio" #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range__date_start #: model:ir.model.fields,field_description:date_range.field_date_range_generator__date_start msgid "Start date" -msgstr "" +msgstr "Fecha de inicio" #. module: date_range #. odoo-python @@ -363,17 +372,20 @@ msgid "" "The Company in the Date Range Generator and in Date Range Type must be the " "same." msgstr "" +"La Compañía en el Generador de Rango de Fecha y en el Tipo del Rango de " +"Fecha debe ser igual." #. module: date_range #: model:ir.model.fields,help:date_range.field_date_range_type__active msgid "" "The active field allows you to hide the date range type without removing it." msgstr "" +"El campo activo le permite esconder el tipo de rango de fecha sin eliminarlo." #. module: date_range #: model:ir.model.fields,help:date_range.field_date_range__active msgid "The active field allows you to hide the date range without removing it." -msgstr "" +msgstr "El campo activo le permite ocultar el rango de fecha sin eliminarlo." #. module: date_range #: model:ir.model.fields,field_description:date_range.field_date_range__type_id @@ -385,12 +397,12 @@ msgstr "Tipo" #: model:ir.model.fields,field_description:date_range.field_date_range_generator__unit_of_time #: model:ir.model.fields,field_description:date_range.field_date_range_type__unit_of_time msgid "Unit Of Time" -msgstr "" +msgstr "Unidad de Tiempo" #. module: date_range #: model_terms:ir.ui.view,arch_db:date_range.date_range_generator_view_form msgid "Until" -msgstr "" +msgstr "Hasta" #. module: date_range #. odoo-python @@ -400,50 +412,52 @@ msgid "" "You cannot change the company, as this Date Range Type is assigned to Date " "Range '%s'." msgstr "" +"No puede cambiar la compañía, ya que este Tipo de Rango de Fechas está " +"asignado al Rango de Fechas '%s'." #. module: date_range #: model:ir.model.fields.selection,name:date_range.selection__date_range_generator__unit_of_time__3 #: model:ir.model.fields.selection,name:date_range.selection__date_range_type__autogeneration_unit__3 #: model:ir.model.fields.selection,name:date_range.selection__date_range_type__unit_of_time__3 msgid "days" -msgstr "" +msgstr "días" #. module: date_range #: model_terms:ir.ui.view,arch_db:date_range.date_range_generator_view_form msgid "entries." -msgstr "" +msgstr "entradas." #. module: date_range #: model_terms:ir.ui.view,arch_db:date_range.view_date_range_type_form_view msgid "in advance" -msgstr "" +msgstr "por adelantado" #. module: date_range #: model:ir.model.fields.selection,name:date_range.selection__date_range_generator__unit_of_time__1 #: model:ir.model.fields.selection,name:date_range.selection__date_range_type__autogeneration_unit__1 #: model:ir.model.fields.selection,name:date_range.selection__date_range_type__unit_of_time__1 msgid "months" -msgstr "" +msgstr "meses" #. module: date_range #: model_terms:ir.ui.view,arch_db:date_range.date_range_generator_view_form #: model_terms:ir.ui.view,arch_db:date_range.view_date_range_type_form_view msgid "or enter a complex expression below" -msgstr "" +msgstr "o ingrese una expresión compleja debajo" #. module: date_range #: model:ir.model.fields.selection,name:date_range.selection__date_range_generator__unit_of_time__2 #: model:ir.model.fields.selection,name:date_range.selection__date_range_type__autogeneration_unit__2 #: model:ir.model.fields.selection,name:date_range.selection__date_range_type__unit_of_time__2 msgid "weeks" -msgstr "" +msgstr "semanas" #. module: date_range #: model:ir.model.fields.selection,name:date_range.selection__date_range_generator__unit_of_time__0 #: model:ir.model.fields.selection,name:date_range.selection__date_range_type__autogeneration_unit__0 #: model:ir.model.fields.selection,name:date_range.selection__date_range_type__unit_of_time__0 msgid "years" -msgstr "" +msgstr "años" #, fuzzy #~ msgid "Type Name" diff --git a/date_range/static/description/index.html b/date_range/static/description/index.html index 9b2877c..743f09e 100644 --- a/date_range/static/description/index.html +++ b/date_range/static/description/index.html @@ -8,10 +8,11 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $ +:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ :Copyright: This stylesheet has been placed in the public domain. Default cascading style sheet for the HTML output of Docutils. +Despite the name, some widely supported CSS2 features are used. See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to customize this style sheet. @@ -274,7 +275,7 @@ pre.literal-block, pre.doctest-block, pre.math, pre.code { margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: grey; } /* line numbers */ +pre.code .ln { color: gray; } /* line numbers */ pre.code, code { background-color: #eeeeee } pre.code .comment, code .comment { color: #5C6576 } pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold } @@ -300,7 +301,7 @@ span.option { span.pre { white-space: pre } -span.problematic { +span.problematic, pre.problematic { color: red } span.section-subtitle { @@ -366,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -!! source digest: sha256:bef360f14e07013cc293245f850d87fd6cfd11edbb6f8384310c65afc5f86b0a +!! source digest: sha256:adcc800f01bc1399a9e196d4c4ed89ddb1287e99ee0e66d667dc47a6ff09a4db !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->

    Mature License: LGPL-3 OCA/server-ux Translate me on Weblate Try me on Runboat

    This module lets you define global date ranges that can be used to @@ -483,7 +484,9 @@ If you spotted it first, help us to smash it by providing a detailed and welcome

    Maintainers

    This module is maintained by the OCA.

    -Odoo Community Association + +Odoo Community Association +

    OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

    diff --git a/date_range/static/src/js/tree_editor.esm.js b/date_range/static/src/js/tree_editor.esm.js index d2107c0..f39f3f9 100644 --- a/date_range/static/src/js/tree_editor.esm.js +++ b/date_range/static/src/js/tree_editor.esm.js @@ -46,6 +46,11 @@ patch(TreeEditor.prototype, { ) { info.component = Select; } + // Prevent issues when the domain is not initialized, for example in + // Flectra Studio editing + if (!this.env.domain) { + return info; + } let dateRanges = this.env.domain.dateRanges; if (this.update_operator && this.update_operator.split("daterange_")[1]) { dateRanges = this.env.domain.dateRanges.filter( @@ -105,6 +110,11 @@ patch(TreeEditor.prototype, { super.updateLeafOperator.apply(this, arguments); this.update_operator = operator; const fieldDef = this.getFieldDef(node.path); + // Prevent issues when the domain is not initialized, for example in + // Flectra Studio editing + if (!this.env.domain) { + return; + } let dateRanges = this.env.domain.dateRanges.filter( (range) => range.type_id[0] === Number(operator.split("daterange_")[1]) );