Skip to content

Commit

Permalink
[FIX] fieldservice_equipment_stock: Fix warning on fsm_equipment and …
Browse files Browse the repository at this point in the history
…display create_fsm_equipment field in traceability group.
  • Loading branch information
szekawong committed Dec 12, 2023
1 parent d5e3941 commit bcd2c6a
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion fieldservice_equipment_stock/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Field Service - Stock Equipment
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1611123b2193163bada4ee7f794a60e78686102f2ef98400bcba099ace4783df
!! source digest: sha256:60636d35efda73608a27ac5bcaedb6220163f12665a388b90db0d2b4c4d2312e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
Expand Down
2 changes: 1 addition & 1 deletion fieldservice_equipment_stock/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
{
"name": "Field Service - Stock Equipment",
"summary": "Integrate stock operations with your field service equipments",
"version": "16.0.1.0.0",
"version": "16.0.1.0.1",
"category": "Field Service",
"author": "Open Source Integrators, "
"Brian McMaster, "
Expand Down
13 changes: 7 additions & 6 deletions fieldservice_equipment_stock/models/fsm_equipment.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,13 @@ def _compute_current_stock_loc_id(self):
def _onchange_product(self):
self.current_stock_location_id = False

@api.model
def create(self, vals):
res = super(FSMEquipment, self).create(vals)
if "lot_id" in vals:
res.lot_id.fsm_equipment_id = res.id
return res
@api.model_create_multi
def create(self, vals_list):
equipments = super(FSMEquipment, self).create(vals_list)
for equipment in equipments:
if equipment.lot_id:
equipment.lot_id.fsm_equipment_id = equipment.id
return equipments

def write(self, vals):
res = super(FSMEquipment, self).write(vals)
Expand Down
2 changes: 1 addition & 1 deletion fieldservice_equipment_stock/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ <h1 class="title">Field Service - Stock Equipment</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:1611123b2193163bada4ee7f794a60e78686102f2ef98400bcba099ace4783df
!! source digest: sha256:60636d35efda73608a27ac5bcaedb6220163f12665a388b90db0d2b4c4d2312e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.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/field-service/tree/16.0/fieldservice_equipment_stock"><img alt="OCA/field-service" src="https://img.shields.io/badge/github-OCA%2Ffield--service-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/field-service-16-0/field-service-16-0-fieldservice_equipment_stock"><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/field-service&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module is an add-on for the Field Service application in Odoo.
Expand Down
4 changes: 2 additions & 2 deletions fieldservice_equipment_stock/views/product_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
<field name="model">product.template</field>
<field name="inherit_id" ref="product.product_template_only_form_view" />
<field name="arch" type="xml">
<field name="tracking" position="after">
<group name="traceability" position="inside">
<field
name="create_fsm_equipment"
attrs="{'invisible': [('tracking', '!=', 'serial')]}"
/>
</field>
</group>
</field>
</record>

Expand Down

0 comments on commit bcd2c6a

Please sign in to comment.