[IMP]: Improve code
bzr revid: ksa@tinyerp.co.in-20110408125758-6soa3t29oels77ym
This commit is contained in:
parent
2289e6db4f
commit
0fa464b1b7
|
@ -18,7 +18,6 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import account_analytic_plans
|
||||
import wizard
|
||||
import report
|
||||
|
|
|
@ -70,7 +70,7 @@ of distribution models.
|
|||
'account_analytic_plans_report.xml',
|
||||
'wizard/analytic_plan_create_model_view.xml',
|
||||
'wizard/account_crossovered_analytic_view.xml',
|
||||
'installer_view.xml'
|
||||
'account_analytic_plans_installer_view.xml'
|
||||
],
|
||||
'demo_xml' : [],
|
||||
'test' : ['test/acount_analytic_plans_report.yml'],
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
</record>
|
||||
<record id="account_analytic_plan_installer_todo" model="ir.actions.todo">
|
||||
<field name="action_id" ref="account_analytic_plan_form_action_installer"/>
|
||||
<field name="sequence">3</field>
|
||||
<field name="sequence">15</field>
|
||||
<field name="restart">always</field>
|
||||
</record>
|
||||
|
|
@ -76,7 +76,7 @@
|
|||
|
||||
<record id="crm_case_section_installer_todo" model="ir.actions.todo">
|
||||
<field name="action_id" ref="crm_case_section_view_form_installer"/>
|
||||
<field name="sequence">3</field>
|
||||
<field name="sequence">10</field>
|
||||
<field name="restart">always</field>
|
||||
</record>
|
||||
|
||||
|
@ -91,7 +91,7 @@
|
|||
|
||||
<record id="crm_case_stage_installer_todo" model="ir.actions.todo">
|
||||
<field name="action_id" ref="crm_case_stage_form_installer"/>
|
||||
<field name="sequence">3</field>
|
||||
<field name="sequence">10</field>
|
||||
<field name="restart">always</field>
|
||||
</record>
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ Fetch email from POP / IMAP servers.
|
|||
"fetchmail_view.xml",
|
||||
"fetchmail_data.xml",
|
||||
'security/ir.model.access.csv',
|
||||
'installer_view.xml'
|
||||
'fetchmail_installer_view.xml'
|
||||
],
|
||||
'demo_xml': [
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ in the form of pdf file. Implements a dashboard for My Current Evaluations
|
|||
"hr_evaluation_view.xml",
|
||||
"report/hr_evaluation_report_view.xml",
|
||||
"board_hr_evaluation_view.xml",
|
||||
'installer_view.xml'
|
||||
'hr_evaluation_installer_view.xml'
|
||||
],
|
||||
"test": ["test/test_hr_evaluation.yml"],
|
||||
"active": False,
|
||||
|
|
|
@ -55,7 +55,7 @@ re-invoice your customer's expenses if your work by project.
|
|||
'report/hr_expense_report_view.xml',
|
||||
'board_hr_expense_view.xml',
|
||||
'board_hr_expense_manager_view.xml',
|
||||
'installer_view.xml',
|
||||
'hr_expense_installer_view.xml',
|
||||
'hr_expense_data.xml'
|
||||
],
|
||||
'demo_xml': [
|
||||
|
|
|
@ -230,9 +230,13 @@ class product_product(osv.osv):
|
|||
}
|
||||
|
||||
def on_change_hr_expense_ok(self, cr, uid, id, hr_expense_ok):
|
||||
|
||||
if not hr_expense_ok:
|
||||
return {}
|
||||
res = {'value' : {'type':'service','procure_method':'make_to_stock','supply_method':'buy','purchase_ok':True,'sale_ok' :False,'categ_id':19 }}
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
cat_id = data_obj._get_id(cr, uid, 'hr_expense', 'cat_expense')
|
||||
categ_id = data_obj.browse(cr, uid, cat_id).res_id
|
||||
res = {'value' : {'type':'service','procure_method':'make_to_stock','supply_method':'buy','purchase_ok':True,'sale_ok' :False,'categ_id':categ_id }}
|
||||
return res
|
||||
|
||||
product_product()
|
||||
|
|
|
@ -47,7 +47,7 @@ system to store and search in your CV base.
|
|||
'security/ir.model.access.csv',
|
||||
'report/hr_recruitment_report_view.xml',
|
||||
'board_hr_recruitment_statistical_view.xml',
|
||||
'installer_view.xml'
|
||||
'hr_recruitment_installer_view.xml'
|
||||
],
|
||||
'init_xml': [
|
||||
'hr_recruitment_data.xml'
|
||||
|
|
|
@ -47,7 +47,7 @@ reports, etc.""",
|
|||
'wizard/hr_timesheet_invoice_create_view.xml',
|
||||
'wizard/hr_timesheet_invoice_create_final_view.xml',
|
||||
'board_hr_timesheet_invoice.xml',
|
||||
'installer_view.xml'
|
||||
'hr_timesheet_invoice_installer_view.xml'
|
||||
],
|
||||
'demo': [
|
||||
'hr_timesheet_invoice_demo.xml',
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
<separator string="" colspan="4" />
|
||||
<label string="" colspan="2" />
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel" />
|
||||
<button name="employee_data" string="OK" type="object" icon="gtk-ok"/>
|
||||
<button name="set_employee_data" string="OK" type="object" icon="gtk-ok"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
@ -40,7 +40,7 @@
|
|||
<record id="hr_timesheet_invoice_todo" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_hr_timesheet_invoice_wizard"/>
|
||||
<field name="sequence">3</field>
|
||||
<field name="restart">always</field>
|
||||
<field name="restart">never</field>
|
||||
</record>
|
||||
|
||||
</data>
|
|
@ -56,7 +56,7 @@ class hr_timesheet_invoice_wizard(osv.osv_memory):
|
|||
context = {}
|
||||
res = super(hr_timesheet_invoice_wizard, self).default_get(cr, uid, fields, context=context)
|
||||
emp_obj = self.pool.get('hr.employee')
|
||||
emp_id = emp_obj.search(cr, uid, ['|',('user_id', '=', uid),('product_id','=',False),('journal_id','=','')], context=context)
|
||||
emp_id = emp_obj.search(cr, uid, [('user_id', '=', uid)], context=context)
|
||||
result = []
|
||||
data = {}
|
||||
for emp in emp_obj.browse(cr, uid, emp_id, context=context):
|
||||
|
@ -66,14 +66,13 @@ class hr_timesheet_invoice_wizard(osv.osv_memory):
|
|||
res.update({'emp_ids': result})
|
||||
return res
|
||||
|
||||
def employee_data(self, cr, uid, ids, context=None):
|
||||
def set_employee_data(self, cr, uid, ids, context=None):
|
||||
if context is None:
|
||||
context = {}
|
||||
hr_obj = self.pool.get('hr.employee')
|
||||
for emp in self.browse(cr, uid, ids, context=context):
|
||||
for emp_data in emp.emp_ids:
|
||||
emp_id = hr_obj.search(cr, uid, [('id', '=', emp_data.employee_id.id)], context=context)
|
||||
hr_obj.write(cr, uid, emp_id, {'name': emp_data.employee_id.name,'product_id':emp_data.product_id.id or False, 'journal_id':emp_data.journal_id.id or ''})
|
||||
hr_obj.write(cr, uid, emp_data.employee_id.id, {'name': emp_data.employee_id.name, 'product_id':emp_data.product_id.id or False, 'journal_id':emp_data.journal_id.id or ''})
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
hr_timesheet_invoice_wizard()
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
'lunch_view.xml',
|
||||
'lunch_report.xml',
|
||||
'report/report_lunch_order_view.xml',
|
||||
'installer_view.xml'
|
||||
'lunch_installer_view.xml'
|
||||
],
|
||||
"demo_xml": ['lunch_demo.xml'],
|
||||
"test": ['test/test_lunch.yml', 'test/lunch_report.yml'],
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
|
||||
<record id="view_lunch_product_form_todo" model="ir.actions.todo">
|
||||
<field name="action_id" ref="view_lunch_product_form_installer"/>
|
||||
<field name="sequence">3</field>
|
||||
<field name="sequence">50</field>
|
||||
<field name="restart">always</field>
|
||||
</record>
|
||||
</data>
|
Loading…
Reference in New Issue