Skip to content

Commit

Permalink
[FIX] Adapt fsm.equipement create method to multi calls.
Browse files Browse the repository at this point in the history
  • Loading branch information
szekawong committed Dec 11, 2023
1 parent c0ae50e commit bcca633
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 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
11 changes: 6 additions & 5 deletions fieldservice_equipment_stock/models/fsm_equipment.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,12 @@ def _onchange_product(self):
self.current_stock_location_id = False

@api.model_create_multi
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
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

0 comments on commit bcca633

Please sign in to comment.