-
-
Notifications
You must be signed in to change notification settings - Fork 98
[11.0] [MIG] project_billing_utils: Migrated module for v11. #27
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
base: 11.0
Are you sure you want to change the base?
[11.0] [MIG] project_billing_utils: Migrated module for v11. #27
Conversation
(lp:c2c-addons/6.1 rev 2)
(lp:c2c-addons/6.1 rev 4)
(lp:c2c-addons/6.1 rev 11.1.3)
(lp:c2c-addons/6.1 rev 28.1.7)
(lp:c2c-addons/6.1 rev 28.3.24)
(lp:c2c-addons/6.1 rev 28.3.29)
(lp:c2c-addons/6.1 rev 45.1.14)
(lp:c2c-addons/6.1 rev 62)
…oice creation can be customized in sub-modules (lp:c2c-addons/6.1 rev 109)
(lp:c2c-addons/6.1 rev 111)
…stead of aliases osv and osv_memory + remove useless imports
…ort was certainly based on 6.0)
…ctly to cr.execute
…hen associated line to invoice
Introduce a hack to circumvent the check introduced in the core module hr_timesheet_invoice (which is broken, but that is another story)
|
Task timesheets invoicing has changed a lot in this version. Does this module still apply? |
|
Yes, using this module, we can create the invoices through Analytic Account (Project). |
| from openerp import models, api, _ | ||
| from openerp import exceptions | ||
|
|
||
| from odoo import models, api, _ |
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.
good to follow alphabetically ordered in imports
| aal_ids = self.env.context.get('active_ids', False) | ||
| aal_rs = aal_obj.browse(aal_ids) | ||
| aal_rs.write({'invoice_id': self.invoice_id.id}) | ||
| aal_rs.write({'timesheet_invoice_id': self.invoice_id.id}) |
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.
aal_rs.timesheet_invoice_id = self.invoice_id.id is better.
nikul-serpentcs
left a comment
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.
Improve Code
| @@ -0,0 +1,30 @@ | |||
| ############################################################################## | |||
| # | |||
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.
@Chandresh-SerpentCS Remove copyright from all __init__.file file.
| 'version': '11.0.1.0.0', | ||
| 'category': 'Generic Modules/Projects & Services', | ||
| 'author': "Camptocamp,Odoo Community Association (OCA)", | ||
| 'website': 'https://www.camptocamp.com', |
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.
IMO Change website as per this
| project_obj = self.env['project.project'] | ||
| invoice_obj = self.env['account.invoice'] | ||
|
|
||
| invoices = self.env['account.invoice'] |
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.
IMO Remove this one Because duplicate here
| [('account_id', '=', project.analytic_account_id.id)]) | ||
| # If we found line linked with account we raise an error | ||
| if account_lines: | ||
| raise exceptions.Warning( |
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.
IMO here Warning is a python function, in odoo we should use UserError.
|
@nikul-serpentcs, Thanks for the review. I will workout on mentioned points and will resolve it. |
1854d07 to
ee28f9b
Compare
No description provided.