From 84c7d1f4fd99a350d2015c6afe102ea9e1ae98c7 Mon Sep 17 00:00:00 2001 From: ilo Date: Wed, 11 Sep 2024 14:52:41 -0300 Subject: [PATCH] [FIX] Migrating ``required`` from model to view While migrating ``fieldservice_repair`` (https://github.com/OCA/field-service/pull/1209) some unit tests were failing because this module adds ``required`` condition on two new fields on ``fms.equipment`` model. To avoid this, the best solution was to migrate the required to the view as we cannot force the installation order on odoo. --- fieldservice_equipment_stock/models/fsm_equipment.py | 4 ++-- .../static/description/index.html | 11 ++++------- fieldservice_equipment_stock/views/fsm_equipment.xml | 3 ++- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/fieldservice_equipment_stock/models/fsm_equipment.py b/fieldservice_equipment_stock/models/fsm_equipment.py index 0ad6b4aca3..9c50770efa 100644 --- a/fieldservice_equipment_stock/models/fsm_equipment.py +++ b/fieldservice_equipment_stock/models/fsm_equipment.py @@ -7,8 +7,8 @@ class FSMEquipment(models.Model): _inherit = "fsm.equipment" - product_id = fields.Many2one("product.product", string="Product", required=True) - lot_id = fields.Many2one("stock.lot", string="Serial #", required=True) + product_id = fields.Many2one("product.product", string="Product") + lot_id = fields.Many2one("stock.lot", string="Serial #") current_stock_location_id = fields.Many2one( "stock.location", string="Current Inventory Location", diff --git a/fieldservice_equipment_stock/static/description/index.html b/fieldservice_equipment_stock/static/description/index.html index 4a48836dda..47fef11d7b 100644 --- a/fieldservice_equipment_stock/static/description/index.html +++ b/fieldservice_equipment_stock/static/description/index.html @@ -8,11 +8,10 @@ /* :Author: David Goodger (goodger@python.org) -:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $ +:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z 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 +274,7 @@ margin-left: 2em ; margin-right: 2em } -pre.code .ln { color: gray; } /* line numbers */ +pre.code .ln { color: grey; } /* 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 +300,7 @@ span.pre { white-space: pre } -span.problematic, pre.problematic { +span.problematic { color: red } span.section-subtitle { @@ -461,9 +460,7 @@

Other credits

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/fieldservice_equipment_stock/views/fsm_equipment.xml b/fieldservice_equipment_stock/views/fsm_equipment.xml index e5ddd4e6e5..a92a59a0d9 100644 --- a/fieldservice_equipment_stock/views/fsm_equipment.xml +++ b/fieldservice_equipment_stock/views/fsm_equipment.xml @@ -7,11 +7,12 @@ - +