OCA / field-service

Field Service Management
https://odoo-community.org/psc-teams/field-service-126
GNU Affero General Public License v3.0
148 stars 240 forks source link

The model ...fieldservice_vehicle.... is not overriding the create method in batch.... v16 #1191

Open legacyplumbing opened 6 months ago

legacyplumbing commented 6 months ago

OCA/OCB odoo v16

upon install of Field-Service v16

2024-05-31 00:24:16,090 159591 WARNING blounts.5.14.24 odoo.api.create: The model odoo.addons.fieldservice_vehicle.models.fsm_order is not overriding the create method in batch

Thank ya'll

legacyplumbing commented 6 months ago

I fixed this in my local repo... like so /field-service/fieldservice_vehicle/models/fsm_order.py

Original section for @api.model

@api.model  
def create(self, vals):
    res = super(FSMOrder, self).create(vals)
    if not vals.get("vehicle_id") and vals.get("person_id"):
        self._onchange_person_id()
    return res

CHANGED TO:

@api.model_create_multi
def create(self, vals_list):
    for vals in vals_list:
        res = super(FSMOrder, self).create(vals)
    if not vals.get("vehicle_id") and vals.get("person_id"):
        self._onchange_person_id()
    return res

No more warning in odoo-server.log... hope I did that correctly.

Thanks.

github-actions[bot] commented 22 hours ago

There hasn't been any activity on this issue in the past 6 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. If you want this issue to never become stale, please ask a PSC member to apply the "no stale" label.