-
-
Notifications
You must be signed in to change notification settings - Fork 342
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[16.0][ADD] hr_timesheet_name_customer #568
[16.0][ADD] hr_timesheet_name_customer #568
Conversation
"""override create method, initialize name_customer""" | ||
|
||
@api.model | ||
def create(self, vals_list): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Starting Odoo 12 you can create several record and once using create_multi decorator.
Check example here
|
||
@api.model | ||
def create(self, vals_list): | ||
if vals_list["name_customer"] is False: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just do
If not vals.get(“name_customer”):
Because if name_customer is not present in Val’s vals[“name_customer”] will trigger an exception
{ | ||
"name": "Name Customer", | ||
"summary": "Add Description Customer", | ||
"version": "16.0.0.1.0", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pleas follow version numbering rules. You can check them here
|
||
{ | ||
"name": "Name Customer", | ||
"summary": "Add Description Customer", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Make description more clear for end user. Eg
“Add ‘Description Customer’ field for timesheets”
"views/hr_timesheet_name_customer_views.xml", | ||
"report/name_customer_template.xml", | ||
], | ||
"demo": [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not add empty keys. Remove it please
e6b5724
to
3c7b447
Compare
{ | ||
"name": "Name Customer", | ||
"summary": "Add ‘Description Customer’ field for timesheets", | ||
"version": "16.0.1.0.1", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is still a release version so 16.0.1.0.0
@@ -0,0 +1,18 @@ | |||
<?xml version="1.0" encoding="utf-8" ?> | |||
<odoo> | |||
<record id="hr_timesheet_name_customer_view" model="ir.ui.view"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please follow guidelines when for inherited xml ids
# customer partner | ||
cls.partner = cls.env["res.partner"].create( | ||
{ | ||
"name": "Customer Task", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not the best name for Customer)
It might be misleading
from odoo.tests.common import TransactionCase | ||
|
||
|
||
class TestCommonNameCustomer(TransactionCase): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this class you can move to new common.py file and them make import to current file.
|
||
|
||
class TestTimesheet(TestCommonNameCustomer): | ||
def setUp(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can delete this.
<field name="model">account.analytic.line</field> | ||
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree" /> | ||
<field name="arch" type="xml"> | ||
<xpath expr="//field[@name='name']" position="after"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can replace on <field name="name" position="after">...</field>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR Name must be have format [verion][ADD] module_name
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl-3.0). | ||
|
||
{ | ||
"name": "Name Customer", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Timesheet Description Customer
"application": False, | ||
"installable": True, | ||
"depends": ["hr_timesheet"], | ||
"data": [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -0,0 +1,5 @@ | |||
To use this module you need to: | |||
|
|||
#. Go to Apps and install this module |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modify "Description Customer" field value. Select timesheets you want to print add choose "Timesheets Customer" report.
"Description" column values will be populated from the "Description Customer" field.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
please move squash commits and move out of "draft"
This PR has the |
f617766
to
3786e67
Compare
Hey @OCA/human-resources-maintainers could you please have a look at this? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add license and copyright in python file
@@ -0,0 +1 @@ | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please delete this file or generate readme from https://github.com/OCA/maintainer-tools#readme-generator
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please delete this file or generate readme from https://github.com/OCA/maintainer-tools#readme-generator
If you delete it then pre-commit will fail. That’s why we are simply adding a file with some placeholder in it. It will be overwritten anyway
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please delete this file or generate readme from https://github.com/OCA/maintainer-tools#readme-generator
@Saran440 could you please review its once again? Would be great to have it merged
Code Reviewed. 👍 please rebase commit into 1 commit. |
726189c
to
10ddf55
Compare
This module added new field Customer Description in list view In this module in report pdf instead of Description you can see Customer Description. This field can see only Timesheets:Administrator
10ddf55
to
53ad149
Compare
done |
/ocabot merge nobump |
This PR looks fantastic, let's merge it! |
Congratulations, your PR was merged at fb3bb70. Thanks a lot for contributing to OCA. ❤️ |
This module added new field Customer Description in list view In this module in report pdf instead of Description you can see Customer Description. This field can see only Timesheets:Administrator