diff --git a/hr_timesheet_name_customer/__manifest__.py b/hr_timesheet_name_customer/__manifest__.py index f75442ad68..29264d125d 100644 --- a/hr_timesheet_name_customer/__manifest__.py +++ b/hr_timesheet_name_customer/__manifest__.py @@ -3,8 +3,8 @@ { "name": "Name Customer", - "summary": "Add Description Customer", - "version": "16.0.0.1.0", + "summary": "Add ‘Description Customer’ field for timesheets", + "version": "16.0.1.0.1", "category": "Timesheet", "website": "https://github.com/OCA/timesheet", "author": "Odoo Community Association (OCA)", @@ -16,5 +16,4 @@ "views/hr_timesheet_name_customer_views.xml", "report/name_customer_template.xml", ], - "demo": [], } diff --git a/hr_timesheet_name_customer/models/hr_timesheet_name_customer.py b/hr_timesheet_name_customer/models/hr_timesheet_name_customer.py index fc57890941..ffb74109d0 100644 --- a/hr_timesheet_name_customer/models/hr_timesheet_name_customer.py +++ b/hr_timesheet_name_customer/models/hr_timesheet_name_customer.py @@ -7,8 +7,9 @@ class NameCustomer(models.Model): name_customer = fields.Char() """override create method, initialize name_customer""" - @api.model + @api.model_create_multi def create(self, vals_list): - if vals_list["name_customer"] is False: - vals_list["name_customer"] = vals_list["name"] + for vals in vals_list: + if not vals.get("name_customer"): + vals_list["name_customer"] = vals_list["name"] return super(NameCustomer, self).create(vals_list)