Skip to content

Commit

Permalink
[16.0][REF] hr_timesheet_name_customer:review
Browse files Browse the repository at this point in the history
I made changes to make my code prettier and better
I remove empty key in Manfest and add create_multi to my model
  • Loading branch information
Andrey committed Feb 15, 2023
1 parent ae520bc commit 3c7b447
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
5 changes: 2 additions & 3 deletions hr_timesheet_name_customer/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)",
Expand All @@ -16,5 +16,4 @@
"views/hr_timesheet_name_customer_views.xml",
"report/name_customer_template.xml",
],
"demo": [],
}
Original file line number Diff line number Diff line change
Expand Up @@ -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)

0 comments on commit 3c7b447

Please sign in to comment.