Skip to content

Conversation

@Chandresh-SerpentCS
Copy link

No description provided.

jgrandguillaume and others added 30 commits June 26, 2018 12:08
(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)
…stead of aliases osv and osv_memory + remove useless imports
Introduce a hack to circumvent the check introduced in the core module hr_timesheet_invoice
(which is broken, but that is another story)
@pedrobaeza
Copy link
Member

Task timesheets invoicing has changed a lot in this version. Does this module still apply?

@Chandresh-SerpentCS
Copy link
Author

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, _

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})

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.

Copy link
Member

@nikul-serpentcs nikul-serpentcs left a 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 @@
##############################################################################
#
Copy link
Member

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',
Copy link
Member

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']
Copy link
Member

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(
Copy link
Member

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.

@Chandresh-SerpentCS
Copy link
Author

@nikul-serpentcs, Thanks for the review. I will workout on mentioned points and will resolve it.

@Chandresh-SerpentCS Chandresh-SerpentCS force-pushed the 11.0-MIG-project_billing_utils branch from 1854d07 to ee28f9b Compare October 5, 2018 12:18
@emagdalenaC2i emagdalenaC2i mentioned this pull request Dec 29, 2018
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.