diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py index 2854ddf95a5..c07ec8188b8 100644 --- a/addons/hr_recruitment/hr_recruitment.py +++ b/addons/hr_recruitment/hr_recruitment.py @@ -184,10 +184,6 @@ class hr_applicant(crm.crm_case, osv.osv): 'user_email': fields.related('user_id', 'user_email', type='char', string='User Email', readonly=True), } - def _get_stage(self, cr, uid, context=None): - ids = self.pool.get('hr.recruitment.stage').search(cr, uid, [], context=context) - return ids and ids[0] or False - _defaults = { 'active': lambda *a: 1, 'user_id': lambda self, cr, uid, context: uid, diff --git a/addons/hr_recruitment/test/recruitment_process.yml b/addons/hr_recruitment/test/recruitment_process.yml index 43575137a6e..c1ef5022209 100644 --- a/addons/hr_recruitment/test/recruitment_process.yml +++ b/addons/hr_recruitment/test/recruitment_process.yml @@ -19,27 +19,49 @@ assert applicant.name == "Application for the post of Jr.application Programmer.", "Subject does not match" assert applicant.state == "draft" assert len(resume_ids), "Resume does not attached." +- + I refuse applicant for the Recruitment. +- + !python {model: hr.applicant}: | + self.case_close(cr, uid, [ref("hr_case_programmer")]) +- + I open applicant for the Recruitment. +- + !python {model: hr.applicant}: | + self.case_reset(cr, uid, [ref("hr_case_programmer")]) + self.case_open(cr, uid, [ref("hr_case_programmer")]) - I assign the Job position to the applicant - !python {model: hr.applicant}: | self.write(cr, uid, [ref('hr_case_programmer')], {'job_id':ref('hr.job_jr_appli')}) -- - I open applicant for the Recruitment -- - - !python {model: hr.applicant}: | - self.case_open(cr, uid, [ref("hr_case_programmer")]) - I start communication with applicant, first schedule phonecall. - !python {model: hr.recruitment.job2phonecall}: | - self.make_phonecall(cr, uid, [ref('hr_case_programmer')]) + context.update({'active_model': 'hr.applicant', 'active_id': ref("hr_case_programmer"), 'active_ids': [ref("hr_case_programmer")], 'survey_id': ref("survey_job_0")}) + id = self.create(cr, uid, {}, context=context) + self.make_phonecall(cr, uid, [id], context=context) - I schedule meeting with applicant for interview. - !python {model: hr.applicant}: | self.action_makeMeeting(cr, uid, [ref('hr_case_programmer')]) +- + I check Initial Qualification of applicant. +- + !python {model: hr.applicant}: | + self.stage_next(cr, uid, [ref('hr_case_programmer')]) +- + I schedule First Interview of applicant. +- + !python {model: hr.applicant}: | + self.stage_next(cr, uid, [ref('hr_case_programmer')]) +- + On a successful First Interview of applicant, I schedule Second Interview. +- + !python {model: hr.applicant}: | + self.stage_next(cr, uid, [ref('hr_case_programmer')]) - Applicant fillup the answer of the interview quetion. - @@ -56,7 +78,13 @@ !python {model: hr.applicant}: | self.action_print_survey(cr, uid, [ref('hr_case_programmer')]) - - On a successful interview with the applicant, I hired employee. + On a successful Second Interview of applicant Contract is Proposed to applicant. +- + !python {model: hr.applicant}: | + self.stage_next(cr, uid, [ref('hr_case_programmer')]) + self.stage_previous(cr, uid, [ref('hr_case_programmer')]) +- + I Hired Applicant. - !python {model: hr.applicant}: | self.case_close_with_emp(cr, uid, [ref('hr_case_programmer')]) @@ -65,3 +93,28 @@ - !assert {model: hr.applicant, id: hr_case_programmer}: - state == 'done' +- + I do not give employment to the hired the applicant. +- + !python {model: hired.employee}: | + context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")}) + emp_id = self.create(cr, uid, {}, context=context) + self.case_close(cr, uid, [emp_id], context=context) +- + Now I give employment to hired applicant . +- + !python {model: hr.applicant}: | + hired_emp_obj = self.pool.get('hired.employee') + self.case_reset(cr, uid, [ref("hr_case_programmer")]) + self.case_open(cr, uid, [ref("hr_case_programmer")]) + context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")}) + emp_hr_id = hired_emp_obj.create(cr, uid, {}, context=context) + hired_emp_obj.case_close_with_emp(cr, uid, [emp_hr_id], context=context) +- + Now hired employee want to be a partner of company. +- + !record {model: hr.recruitment.partner.create, id: hr_recruitment_partner_id1 }: +- + !python {model: hr.recruitment.partner.create}: | + context.update({'active_model': 'hr.applicant', 'active_ids': [ref("hr_recruitment.hr_case_programmer")], 'active_id': ref("hr_recruitment.hr_case_programmer")}) + self.make_order(cr, uid, [ref("hr_recruitment_partner_id1")], context=context) diff --git a/addons/marketing_campaign/__openerp__.py b/addons/marketing_campaign/__openerp__.py index 44a2f1e30bd..44646a07ead 100644 --- a/addons/marketing_campaign/__openerp__.py +++ b/addons/marketing_campaign/__openerp__.py @@ -58,7 +58,11 @@ Note: If you need demo data, you can install the marketing_campaign_crm_demo mod "security/ir.model.access.csv" ], 'demo_xml': [ + 'marketing_campaign_demo.xml', ], + 'test': [ + 'test/marketing_campaign.yml', + ], 'installable': True, 'active': False, 'certificate' : '00421723279617928365', diff --git a/addons/marketing_campaign/marketing_campaign.py b/addons/marketing_campaign/marketing_campaign.py index 82832134c27..4e6f6a5227e 100644 --- a/addons/marketing_campaign/marketing_campaign.py +++ b/addons/marketing_campaign/marketing_campaign.py @@ -164,11 +164,12 @@ Normal - the campaign runs normally and automatically sends all emails and repor self.write(cr, uid, ids, {'state': 'cancelled'}) return True - + # dead code def signal(self, cr, uid, model, res_id, signal, run_existing=True, context=None): record = self.pool.get(model).browse(cr, uid, res_id, context) return self._signal(cr, uid, record, signal, run_existing, context) + #dead code def _signal(self, cr, uid, record, signal, run_existing=True, context=None): if not signal: raise ValueError('signal cannot be False') @@ -461,6 +462,7 @@ class marketing_campaign_activity(osv.osv): return super(marketing_campaign_activity, self).search(cr, uid, args, offset, limit, order, context, count) + #dead code def _process_wi_report(self, cr, uid, activity, workitem, context=None): service = netsvc.LocalService('report.%s'%activity.report_id.report_name) (report_data, format) = service.create(cr, uid, [], {}, {}) @@ -481,6 +483,7 @@ class marketing_campaign_activity(osv.osv): activity.email_template_id.id, workitem.res_id, context=context) + #dead code def _process_wi_action(self, cr, uid, activity, workitem, context=None): if context is None: context = {} @@ -670,7 +673,7 @@ class marketing_campaign_workitem(osv.osv): def _process_one(self, cr, uid, workitem, context=None): if workitem.state != 'todo': - return + return False activity = workitem.activity_id proxy = self.pool.get(workitem.object_id.model) @@ -707,7 +710,7 @@ class marketing_campaign_workitem(osv.osv): if result: # process _chain - workitem = workitem.browse(context)[0] # reload + workitem = workitem.browse(context=context)[0] # reload date = datetime.strptime(workitem.date, DT_FMT) for transition in activity.to_ids: @@ -784,11 +787,7 @@ class marketing_campaign_workitem(osv.osv): res = {} wi_obj = self.browse(cr, uid, ids[0], context=context) if wi_obj.activity_id.type == 'email': - data_obj = self.pool.get('ir.model.data') - data_id = data_obj._get_id(cr, uid, 'email_template', 'email_template_preview_form') - view_id = 0 - if data_id: - view_id = data_obj.browse(cr, uid, data_id, context=context).res_id + view_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'email_template', 'email_template_preview_form') res = { 'name': _('Email Preview'), 'view_type': 'form', @@ -796,7 +795,7 @@ class marketing_campaign_workitem(osv.osv): 'res_model': 'email_template.preview', 'view_id': False, 'context': context, - 'views': [(view_id, 'form')], + 'views': [(view_id and view_id[1] or 0, 'form')], 'type': 'ir.actions.act_window', 'target': 'new', 'nodestroy':True, diff --git a/addons/marketing_campaign/marketing_campaign_demo.xml b/addons/marketing_campaign/marketing_campaign_demo.xml new file mode 100644 index 00000000000..aaf5a98c6bc --- /dev/null +++ b/addons/marketing_campaign/marketing_campaign_demo.xml @@ -0,0 +1,93 @@ + + + + + + Template for New Partner + info@tinyerp.com + Welcome in OpenERP Partner Channel! + ${object.email or ''} + + Hello, We are very happy to send Welcome message. + + + Template for Silver Partner + info@tinyerp.com + Congratulation! You become now our Silver Partner. + ${object.email or ''} + + Hello, We are happy to announce that you now become our Silver Partner. + + + + Template for Gold Partner + info@tinyerp.com + Congratulation! You become our Gold Partner. + ${object.email or ''} + + Hello, We are happy to announce that you become our Gold Partner. + + + + + + + OpenERP Partner Channel + + active + + + + + + New Partner + + + object.credit_limit < 10000 + True + + + + Silver Partner + + object.credit_limit >= 10000 and object.credit_limit < 50000 + True + + + + + Gold Partner + object.credit_limit >= 100000 + + True + + + + + + + + + + + + + + + + + + Partners + [('name','like','Agrolait')] + res.partner + + + + OpenERP Partner + create_date + + + + + + diff --git a/addons/marketing_campaign/test/marketing_campaign.yml b/addons/marketing_campaign/test/marketing_campaign.yml new file mode 100644 index 00000000000..1b7a7fa2ae3 --- /dev/null +++ b/addons/marketing_campaign/test/marketing_campaign.yml @@ -0,0 +1,151 @@ +- + In order to test process of compaign, I start compaign. +- + !workflow {model: marketing.campaign, action: state_running_set, ref: marketing_campaign_openerppartnerchannel} +- + I check the campaign on Running mode after started. +- + !assert {model: marketing.campaign, id: marketing_campaign_openerppartnerchannel}: + - state == 'running' +- + I start this segment after assinged campaign. +- + !workflow {model: marketing.campaign.segment, action: state_running_set, ref: marketing_campaign_segment0} +- + I check the segment on Running mode after started. +- + !assert {model: marketing.campaign.segment, id: marketing_campaign_segment0}: + - state == 'running' +- + I synchronized segment manually to see all step of activity and process covered on this campaign. +- + !python {model: marketing.campaign.segment}: | + segment_id = self.browse(cr ,uid ,ref("marketing_campaign_segment0") ,context) + assert segment_id.date_next_sync, 'Next Synchronization date is not calculated.' + self.synchroniz(cr, uid, [ref("marketing_campaign_segment0")]) +- + I cancel Marketing Workitems. +- + !python {model: marketing.campaign.workitem}: | + ids = self.search(cr, uid, [('segment_id', '=', ref('marketing_campaign_segment0')), + ('campaign_id', '=', ref('marketing_campaign_openerppartnerchannel'))]) + self.button_cancel(cr, uid, ids) + record = self.browse(cr, uid, ids[0]) + assert record.state == 'cancelled' or record.state == 'done' , 'Marketing Workitem shoud be in cancel state.' +- + I set Marketing Workitems in draft state. +- + !python {model: marketing.campaign.workitem}: | + ids = self.search(cr, uid, [('segment_id', '=', ref('marketing_campaign_segment0')), + ('campaign_id', '=', ref('marketing_campaign_openerppartnerchannel'))]) + self.button_draft(cr, uid, ids) + record = self.browse(cr, uid, ids[0]) + assert record.state == 'todo' or record.state == 'done' , 'Marketing Workitem shoud be in draft state.' +- + I check followup detail of first activity. +- + !python {model: marketing.campaign.workitem}: | + ids = self.search(cr, uid, [('segment_id', '=', ref('marketing_campaign_segment0')), + ('campaign_id', '=', ref('marketing_campaign_openerppartnerchannel')), ('activity_id', '=', ref('marketing_campaign_activity_0'))]) + assert ids, 'Followup item is not created for first activity.' + work_item_id = self.browse(cr ,uid ,ids[0] ,context) + assert work_item_id.res_name, 'Resource Name is not defined.' +- + I process followup of first activity. +- + !python {model: marketing.campaign.workitem}: | + ids = self.search(cr, uid, [('segment_id', '=', ref('marketing_campaign_segment0')), + ('campaign_id', '=', ref('marketing_campaign_openerppartnerchannel')), ('activity_id', '=', ref('marketing_campaign_activity_0'))]) + self.process(cr, uid, ids) + record = self.browse(cr, uid, ids)[0] + assert record.state == "done", "Followup item should be closed after process." +- + I check followup detail of second activity after process of first activity. +- + !python {model: marketing.campaign.workitem}: | + ids = self.search(cr, uid, [('segment_id', '=', ref('marketing_campaign_segment0')), + ('campaign_id', '=', ref('marketing_campaign_openerppartnerchannel')), ('activity_id', '=', ref('marketing_campaign_activity_1'))]) + assert ids, 'Followup item is not created for second activity.' +- + Now I increase credit limit of customer +- + !python {model: res.partner}: | + self.write(cr, uid, [ref("base.res_partner_agrolait")], {'credit_limit':41000}, context=context) +- + I process followup of second activity after set draft. +- + !python {model: marketing.campaign.workitem}: | + ids = self.search(cr, uid, [('segment_id', '=', ref('marketing_campaign_segment0')), + ('campaign_id', '=', ref('marketing_campaign_openerppartnerchannel')), ('activity_id', '=', ref('marketing_campaign_activity_1'))]) + self.button_draft(cr, uid, ids, context=context) + self.process(cr, uid, ids, context=context) + record = self.browse(cr, uid, ids[0], context=context) + assert record.state == "done", "Followup item should be closed after process." +- + I check followup detail of third activity after process of second activity. +- + !python {model: marketing.campaign.workitem}: | + ids = self.search(cr, uid, [('segment_id', '=', ref('marketing_campaign_segment0')), + ('campaign_id', '=', ref('marketing_campaign_openerppartnerchannel')), ('activity_id', '=', ref('marketing_campaign_activity_2'))]) + assert ids, 'Followup item is not created for third activity.' +- + Now I increase credit limit of customer +- + !python {model: res.partner}: | + self.write(cr, uid, [ref("base.res_partner_agrolait")], {'credit_limit':151000}, context=context) +- + I process followup of third activity after set draft. +- + !python {model: marketing.campaign.workitem}: | + ids = self.search(cr, uid, [('segment_id', '=', ref('marketing_campaign_segment0')), + ('campaign_id', '=', ref('marketing_campaign_openerppartnerchannel')), ('activity_id', '=', ref('marketing_campaign_activity_2'))]) + self.button_draft(cr, uid, ids, context=context) + self.process(cr, uid, ids, context=context) + record = self.browse(cr, uid, ids[0], context=context) + assert record.state == "done", "Followup item should be closed after process." +- + I print workitem report. +- + !python {model: marketing.campaign.workitem}: | + ids = self.search(cr, uid, [('segment_id', '=', ref('marketing_campaign_segment0')), + ('campaign_id', '=', ref('marketing_campaign_openerppartnerchannel')), ('activity_id', '=', ref('marketing_campaign_activity_2'))]) + self.preview(cr, uid, ids) +- + I cancel segmentation because of some activity. +- + !workflow {model: marketing.campaign.segment, action: state_cancel_set, ref: marketing_campaign_segment0} +- + I check the segmentation is canceled. +- + !assert {model: marketing.campaign.segment, id: marketing_campaign_segment0}: + - state == 'cancelled' +- + I reopen the segmentation. +- + !workflow {model: marketing.campaign.segment, action: state_draft_set, ref: marketing_campaign_segment0} +- + !workflow {model: marketing.campaign.segment, action: state_running_set, ref: marketing_campaign_segment0} +- + I check the segment on Running mode after started. +- + !assert {model: marketing.campaign.segment, id: marketing_campaign_segment0}: + - state == 'running' +- + I close segmentation After completion of all activity. +- + !workflow {model: marketing.campaign.segment, action: state_done_set, ref: marketing_campaign_segment0} +- + I check the segmentation is done. +- + !assert {model: marketing.campaign.segment, id: marketing_campaign_segment0}: + - state == 'done' +- + I close this campaing. +- + !workflow {model: marketing.campaign.segment, action: state_done_set, ref: marketing_campaign_openerppartnerchannel} +- + I check the campaing is done. +- + !assert {model: marketing.campaign.segment, id: marketing_campaign_openerppartnerchannel}: + - state == 'done' + diff --git a/addons/marketing_campaign_crm_demo/marketing_campaign_demo.xml b/addons/marketing_campaign_crm_demo/marketing_campaign_demo.xml index abf29f2c011..989d11e6ffd 100644 --- a/addons/marketing_campaign_crm_demo/marketing_campaign_demo.xml +++ b/addons/marketing_campaign_crm_demo/marketing_campaign_demo.xml @@ -58,7 +58,7 @@ For OpenERP Discovery Day on May 2010 - + Thanks for subscribing to the OpenERP Discovery Day info@tinyerp.com @@ -72,7 +72,7 @@ For OpenERP Discovery Day - + Thanks for buying the OpenERP book info@tinyerp.com @@ -91,7 +91,6 @@ info@tinyerp.com - Hello, We have very good offer that might suit you. For our gold partners,We are arranging free technical training on june,2010. @@ -157,6 +156,7 @@ OpenERP OnDemand Free Trial 2010 + active diff --git a/addons/project_issue/__openerp__.py b/addons/project_issue/__openerp__.py index 215e4971bf2..012f9b5e799 100644 --- a/addons/project_issue/__openerp__.py +++ b/addons/project_issue/__openerp__.py @@ -54,8 +54,10 @@ and decide on their status as they evolve. ], 'demo_xml': ['project_issue_demo.xml'], 'test': [ - 'test/convert_issue_to_task.yml', - 'test/test_project_issue_states.yml' + 'test/subscribe_issue.yml', + 'test/issue_process.yml', + 'test/cancel_issue.yml', + 'test/issue_demo.yml' ], 'installable': True, 'active': False, diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py index 22cc02b8645..9d61e9fe850 100644 --- a/addons/project_issue/project_issue.py +++ b/addons/project_issue/project_issue.py @@ -314,7 +314,8 @@ class project_issue(crm.crm_case, osv.osv): 'description':bug.description, 'date_deadline': bug.date, 'project_id': bug.project_id.id, - 'priority': bug.priority, + # priority must be in ['0','1','2','3','4'], while bug.priority is in ['1','2','3','4','5'] + 'priority': str(int(bug.priority) - 1), 'user_id': bug.user_id.id, 'planned_hours': 0.0, }) diff --git a/addons/project_issue/test/cancel_issue.yml b/addons/project_issue/test/cancel_issue.yml new file mode 100644 index 00000000000..ff05d923ed0 --- /dev/null +++ b/addons/project_issue/test/cancel_issue.yml @@ -0,0 +1,60 @@ +- + In order to test process of issue tracking in OpenERP, I cancel the unqualified Issue. +- + !python {model: project.issue}: | + self.case_cancel(cr, uid, [ref("crm_case_buginaccountsmodule0")]) +- + I check the issue is in cancel state. +- + !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue is in cancel state}: + - state == 'cancel' +- + I re-open the Issue. +- + !python {model: project.issue}: | + self.case_open(cr, uid, [ref("crm_case_buginaccountsmodule0")]) +- + I check the state of issue after open it. +- + !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue is in open state}: + - state == 'open' +- + I put the issue in pending state. +- + !python {model: project.issue}: | + self.case_pending(cr, uid, [ref("crm_case_buginaccountsmodule0")]) +- + I check the state of issue after put it in pending state. +- + !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue should be in pending state}: + - state == 'pending' +- + I cancel the issue is in pending state. +- + !python {model: project.issue}: | + self.case_cancel(cr, uid, [ref("crm_case_buginaccountsmodule0")]) +- + I check the issue is in cancel state. +- + !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue is in cancel state}: + - state == 'cancel' +- + I close Issue. +- + !python {model: project.issue}: | + self.case_close(cr, uid, [ref("crm_case_buginaccountsmodule0")]) +- + I check state of Issue after close. +- + !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue is in done state}: + - state == 'done' +- + I cancel the issue is in done state. +- + !python {model: project.issue}: | + self.case_cancel(cr, uid, [ref("crm_case_buginaccountsmodule0")]) +- + I check the issue is in cancel state. +- + !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue is in cancel state}: + - state == 'cancel' \ No newline at end of file diff --git a/addons/project_issue/test/convert_issue_to_task.yml b/addons/project_issue/test/convert_issue_to_task.yml deleted file mode 100644 index 13ddef69251..00000000000 --- a/addons/project_issue/test/convert_issue_to_task.yml +++ /dev/null @@ -1,32 +0,0 @@ -- - Create an issue -- - !record {model: project.issue, id: project_issue_onchangeevent0}: - categ_id: project_issue.bug_categ - name: on_change event does not pass context to the method - project_id: project.project_project_22 - working_hours_close: 0.0 - working_hours_open: 0.0 - -- - Check there is no task attached to issue -- - !assert {model: project.issue, id: project_issue_onchangeevent0, string: There must not be any task attached to issue}: - - task_id.id == False - -- - Convert issue to task -- - !python {model: project.issue}: | - self.convert_issue_task(cr, uid, [ref("project_issue_onchangeevent0")], - {"lang": "en_US", "project_id": False, "tz": False, "active_model": "ir.ui.menu", - "department_id": False, "section_id": False, "search_default_project_id": - False, "search_default_my_bugs": 1, "search_default_user_id": 1, "search_default_current_bugs": - 1, "active_ids": [ref("project_issue.menu_project_issue_track")], "active_id": - ref("project_issue.menu_project_issue_track"), }) - -- - Check there is a task attached to issue -- - !assert {model: project.issue, id: project_issue_onchangeevent0, string: After creating a task for the issue there must be a task attached to it}: - - task_id.id != False diff --git a/addons/project_issue/test/issue.eml b/addons/project_issue/test/issue.eml new file mode 100644 index 00000000000..32659bbd7da --- /dev/null +++ b/addons/project_issue/test/issue.eml @@ -0,0 +1,45 @@ +Return-Path: +X-Original-To: abc@mycompany.com +Delivered-To: abc@mycompany.com +Received: by mail1.mycompany.com (Postfix, from userid 10002) + id 3955EBFACA; Tue, 29 Nov 2011 08:14:47 +0100 (CET) +X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail1.mycompany.com +X-Spam-Level: +X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, + RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 +Received: from nm39-vm6.bullet.mail.ne1.yahoo.com (nm39-vm6.bullet.mail.ne1.yahoo.com [98.138.229.166]) + by mail1.mycompany.com (Postfix) with SMTP id 0D074BF53A + for ; Tue, 29 Nov 2011 08:14:44 +0100 (CET) +Received: from [98.138.90.54] by nm39.bullet.mail.ne1.yahoo.com with NNFMP; 29 Nov 2011 07:13:26 -0000 +Received: from [98.138.84.39] by tm7.bullet.mail.ne1.yahoo.com with NNFMP; 29 Nov 2011 07:13:26 -0000 +Received: from [127.0.0.1] by smtp107.mail.ne1.yahoo.com with NNFMP; 29 Nov 2011 07:13:26 -0000 +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.in; s=s1024; t=1322550806; bh=LFefFqrky41IufKZHP8a86obZoBPxyX1aafgWNcrw7U=; h=X-Yahoo-Newman-Id:X-Yahoo-Newman-Property:X-YMail-OSG:X-Yahoo-SMTP:Received:Message-ID:Date:From:User-Agent:MIME-Version:To:Subject:Content-Type:Content-Transfer-Encoding; b=NB8bd6b4Uk3/3fKhdzbcqFEZGPpKyotLeE0xh8H08rcFEahMFfY5uXgsYZsUFvTLCKfTyQWh/oPTVxHeUTGY/Y5MzAnndghX6S0mzlFtmW2dwLMqdWxQLZwU7EhbyYF9PCHicsmtlUVyo7Ou5ePSviqC0SOyCJJVWwzWlv5W9Zg= +X-Yahoo-Newman-Id: 152218.10448.bm@smtp107.mail.ne1.yahoo.com +X-Yahoo-Newman-Property: ymail-3 +X-YMail-OSG: i4zQqJUVM1mab8kxoCTmgMwxw9th.MdiJzmc4Ffbno7QGkl + acotmc0pGoiw_GrhwReSA6uNIveeAUi9WA6NniWAElxbUzGIQplTBHjRhdqF + d_rLG1Yn71DYxllLCZC8xoRzumVHw.kue0ymrl4D0VO.lEeyXbbYoz.TpAvu + ZASBwSV_mESEUu96bb1esfOjI_2MhibMNmt.2egkOG6LS3AcDkVWXJb.VpQe + yZieJ5djjUx9uu4HModjROSUWHKm3Qd5ZwvG.3s1JvHNNvPC3Mo6x.DXi_rj + d70J2pruXhJ9ZnbNooZiSHkrhaugWV.kquq6475ZxKP6Tu7G8iUgZUkHWCf. + aEdBFl2.4RanSkMohEfbNtwpXUQ0eDDOOPatHFB27JSP0jw-- +X-Yahoo-SMTP: oNtzSBqswBAqJIGYOgyGesyleENrhUEtEgBkQ053 +Received: from [192.168.1.30] (Robert_Adersen@180.211.100.2 with plain) + by smtp107.mail.ne1.yahoo.com with SMTP; 28 Nov 2011 23:13:25 -0800 PST +Message-ID: <4ED48611.6070605@yahoo.in> +Date: Tue, 29 Nov 2011 12:43:21 +0530 +From: Robert Adersen +User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.17) Gecko/20110424 Thunderbird/3.1.10 +MIME-Version: 1.0 +To: abc@mycompany.com +Subject: Error in the account module +Content-Type: text/plain; charset=ISO-8859-1; format=flowed +Content-Transfer-Encoding: 7bit + +Hello Sir, + +I am using the openerp v6.1 and i have problem in hr module, so try to +check it and solve my problem. + +thanks +Robert Adersen diff --git a/addons/project_issue/test/issue_demo.yml b/addons/project_issue/test/issue_demo.yml new file mode 100644 index 00000000000..1ad26e6db73 --- /dev/null +++ b/addons/project_issue/test/issue_demo.yml @@ -0,0 +1,8 @@ +- + !record {model: project.issue, id: project_task_1, view: False}: + task_id: 'project.project_task_17' + name: 'Error in account module' +- + !record {model: project.issue, id: project01, view: False}: + project_id: 'project.project_project_9' + name: 'OpenERP Integration' diff --git a/addons/project_issue/test/issue_process.yml b/addons/project_issue/test/issue_process.yml new file mode 100644 index 00000000000..d5900bb1b4f --- /dev/null +++ b/addons/project_issue/test/issue_process.yml @@ -0,0 +1,57 @@ +- + In order to test process of issue tracking in OpenERP, I Open the Issue. +- + !python {model: project.issue}: | + self.case_open(cr, uid, [ref("crm_case_buginaccountsmodule0")]) +- + I check state of Issue after opened it. +- + !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue should be in open state}: + - state == 'open' +- + Now I put Issue in pending due to need more information. +- + !python {model: project.issue}: | + self.case_pending(cr, uid, [ref("crm_case_buginaccountsmodule0")]) +- + I check state after put in pending. +- + !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue should be in pending state}: + - state == 'pending' +- + I send mail to get more details. +- + !python {model: mail.compose.message }: | + ctx = context.copy() + ctx.update({'active_model': 'project.issue', 'active_id': ref("crm_case_buginaccountsmodule0"), 'active_ids': [ref("crm_case_buginaccountsmodule0")]}) + vals = self.default_get(cr, uid , [], context=ctx) + try: + new_id = self.create(cr, uid, {'email_from': 'support@mycompany.com','email_to': 'Robert_Adersen@yahoo.com', 'subject': 'Regarding error in account module we nees more details'}) + self.send_mail(cr, uid, [new_id], context=ctx) + except Exception, e: + pass +- + After getting sufficient details, I re-open Issue from pending state. +- + !python {model: project.issue}: | + self.case_open(cr, uid, [ref("crm_case_buginaccountsmodule0")]) +- + I check state of Issue after re-opened. +- + !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue should be in open state}: + - state == 'open' +- + I create Task for Issue. +- + !python {model: project.issue}: | + self.convert_issue_task(cr, uid, [ref("crm_case_buginaccountsmodule0")]) +- + I close Issue after resolving it +- + !python {model: project.issue}: | + self.case_close(cr, uid, [ref("crm_case_buginaccountsmodule0")]) +- + I Check state of Issue after closed. +- + !assert {model: project.issue, id: crm_case_buginaccountsmodule0, severity: error, string: Issue should be in done state}: + - state == 'done' diff --git a/addons/project_issue/test/subscribe_issue.yml b/addons/project_issue/test/subscribe_issue.yml new file mode 100644 index 00000000000..4ba472b41ed --- /dev/null +++ b/addons/project_issue/test/subscribe_issue.yml @@ -0,0 +1,17 @@ +- + In Order to test process of Issue in OpenERP, Custmer send the issue by email. +- + !python {model: mail.thread}: | + import addons + request_file = open(addons.get_module_resource('project_issue','test', 'issue.eml'),'rb') + request_message = request_file.read() + self.message_process(cr, uid, 'project.issue', request_message) +- + After getting the mail, I check details of new issue of that customer. +- + !python {model: project.issue}: | + issue_ids = self.search(cr, uid, [('email_from', '=', 'Robert Adersen ')]) + assert issue_ids and len(issue_ids), "issue is not created after getting request" + issue = self.browse(cr, uid, issue_ids[0], context=context) + assert not issue.partner_id, "Customer should be a new" + assert issue.name == "Error in the account module", "Subject does not match" \ No newline at end of file diff --git a/addons/project_issue/test/test_project_issue_states.yml b/addons/project_issue/test/test_project_issue_states.yml deleted file mode 100644 index ee48c9a9df0..00000000000 --- a/addons/project_issue/test/test_project_issue_states.yml +++ /dev/null @@ -1,112 +0,0 @@ -- - Create an issue -- - !record {model: project.issue, id: project_issue_stockmovedates0}: - categ_id: project_issue.bug_categ - name: Stock Move dates - project_id: project.project_project_22 - working_hours_close: 0.0 - working_hours_open: 0.0 -- - Check if issue in 'draft' state -- - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in draft state}: - - state == 'draft' - -- - Open the issue -- - !python {model: project.issue}: | - self.case_open(cr, uid, [ref("project_issue_stockmovedates0")], {"lang": - "en_US", "active_ids": [ref("project_issue.menu_project_issue_track")], "tz": - False, "active_model": "ir.ui.menu", "search_default_project_id": False, "search_default_my_bugs": - 1, "search_default_user_id": 1, "search_default_current_bugs": 1, "project_id": - False, "active_id": ref("project_issue.menu_project_issue_track"), }) -- - Check if issue in 'open' state -- - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in open state}: - - state == 'open' - -- - Keep issue pending -- - !python {model: project.issue}: | - self.case_pending(cr, uid, [ref("project_issue_stockmovedates0")], - {"lang": "en_US", "active_ids": [ref("project_issue.menu_project_issue_track")], - "tz": False, "active_model": "ir.ui.menu", "search_default_project_id": - False, "search_default_my_bugs": 1, "search_default_user_id": 1, "search_default_current_bugs": - 1, "project_id": False, "active_id": ref("project_issue.menu_project_issue_track"), - }) -- - Check if issue in 'pending' state -- - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in pending state}: - - state == 'pending' - - -- - Open the issue -- - !python {model: project.issue}: | - self.case_open(cr, uid, [ref("project_issue_stockmovedates0")], {"lang": - "en_US", "active_ids": [ref("project_issue.menu_project_issue_track")], "tz": - False, "active_model": "ir.ui.menu", "search_default_project_id": False, "search_default_my_bugs": - 1, "search_default_user_id": 1, "search_default_current_bugs": 1, "project_id": - False, "active_id": ref("project_issue.menu_project_issue_track"), }) -- - Check if issue in 'open' state -- - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in open state}: - - state == 'open' - - -- - Cancel the issue -- - !python {model: project.issue}: | - self.case_cancel(cr, uid, [ref("project_issue_stockmovedates0")], - {"lang": "en_US", "active_ids": [ref("project_issue.menu_project_issue_track")], - "tz": False, "active_model": "ir.ui.menu", "search_default_project_id": - False, "search_default_my_bugs": 1, "search_default_user_id": 1, "search_default_current_bugs": - 1, "project_id": False, "active_id": ref("project_issue.menu_project_issue_track"), - }) -- - Check if issue in 'cancel' state -- - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in cancel state}: - - state == 'cancel' - - -- - Reset the issue -- - !python {model: project.issue}: | - self.case_reset(cr, uid, [ref("project_issue_stockmovedates0")], - {"lang": "en_US", "active_ids": [ref("project_issue.menu_project_issue_track")], - "tz": False, "active_model": "ir.ui.menu", "search_default_project_id": - False, "search_default_my_bugs": 1, "search_default_user_id": 1, "search_default_current_bugs": - 1, "project_id": False, "active_id": ref("project_issue.menu_project_issue_track"), - }) -- - Check if issue in 'draft' state -- - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in draft state}: - - state == 'draft' - - -- - Close the issue -- - !python {model: project.issue}: | - self.case_close(cr, uid, [ref("project_issue_stockmovedates0")], - {"lang": "en_US", "active_ids": [ref("project_issue.menu_project_issue_track")], - "tz": False, "active_model": "ir.ui.menu", "search_default_project_id": - False, "search_default_my_bugs": 1, "search_default_user_id": 1, "search_default_current_bugs": - 1, "project_id": False, "active_id": ref("project_issue.menu_project_issue_track"), - }) -- - Check if issue in 'done' state -- - !assert {model: project.issue, id: project_issue_stockmovedates0, severity: error, string: Issue is in done state}: - - state == 'done' diff --git a/addons/sale/i18n/es_CL.po b/addons/sale/i18n/es_CL.po index bda9cda990f..ca227ac4115 100644 --- a/addons/sale/i18n/es_CL.po +++ b/addons/sale/i18n/es_CL.po @@ -7,20 +7,20 @@ msgstr "" "Project-Id-Version: OpenERP Server 6.0dev_rc3\n" "Report-Msgid-Bugs-To: support@openerp.com\n" "POT-Creation-Date: 2011-01-11 11:16+0000\n" -"PO-Revision-Date: 2011-10-06 16:03+0000\n" +"PO-Revision-Date: 2011-12-15 21:29+0000\n" "Last-Translator: Francisco Reyes Acuña \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Launchpad-Export-Date: 2011-11-05 05:17+0000\n" -"X-Generator: Launchpad (build 14231)\n" +"X-Launchpad-Export-Date: 2011-12-16 05:24+0000\n" +"X-Generator: Launchpad (build 14523)\n" #. module: sale #: view:board.board:0 #: model:ir.actions.act_window,name:sale.action_sales_by_salesman msgid "Sales by Salesman in last 90 days" -msgstr "Ventas por comercial últimos 90 días" +msgstr "Ventas por vendedor en los últimos 90 días" #. module: sale #: help:sale.installer,delivery:0 diff --git a/addons/sale/stock.py b/addons/sale/stock.py index 9e0a47b3ceb..378af21c1b4 100644 --- a/addons/sale/stock.py +++ b/addons/sale/stock.py @@ -27,12 +27,11 @@ class stock_move(osv.osv): 'sale_line_id': fields.many2one('sale.order.line', 'Sales Order Line', ondelete='set null', select=True, readonly=True), } - def _create_chained_picking(self, cr, uid, pick_name, picking, ptype, move, context=None): - res = super(stock_move, self)._create_chained_picking(cr, uid, pick_name, picking, ptype, move, context=context) + def _prepare_chained_picking(self, cr, uid, picking_name, picking, picking_type, moves_todo, context=None): + values = super(stock_move, self)._prepare_chained_picking(cr, uid, picking_name, picking, picking_type, moves_todo, context=context) if picking.sale_id: - self.pool.get('stock.picking').write(cr, uid, [res], {'sale_id': picking.sale_id.id}) - return res -stock_move() + values['sale_id'] = picking.sale_id.id + return values class stock_picking(osv.osv): _inherit = 'stock.picking' @@ -196,7 +195,4 @@ class stock_picking(osv.osv): }) return result -stock_picking() - - # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/share/res_users.py b/addons/share/res_users.py index 0462f1339d0..db4184ce378 100644 --- a/addons/share/res_users.py +++ b/addons/share/res_users.py @@ -28,10 +28,11 @@ class res_groups(osv.osv): help="Group created to set access rights for sharing data with some users.") } - def __init__(self, pool, cr): - super(res_groups, self).__init__(pool, cr) - # add domain in get_groups_by_application() - self.groups_by_application_domain.append(('share', '=', False)) + def get_application_groups(self, cr, uid, domain=None, context=None): + if domain is None: + domain = [] + domain.append(('share', '=', False)) + return super(res_groups, self).get_application_groups(cr, uid, domain=domain, context=context) res_groups() diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 461c863aaed..0536c725638 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1852,23 +1852,41 @@ class stock_move(osv.osv): result[m.picking_id].append( (m, dest) ) return result - def _create_chained_picking(self, cr, uid, pick_name, picking, ptype, move, context=None): - res_obj = self.pool.get('res.company') + def _prepare_chained_picking(self, cr, uid, picking_name, picking, picking_type, moves_todo, context=None): + """Prepare the definition (values) to create a new chained picking. + + :param str picking_name: desired new picking name + :param browse_record picking: source picking (being chained to) + :param str picking_type: desired new picking type + :param list moves_todo: specification of the stock moves to be later included in this + picking, in the form:: + + [[move, (dest_location, auto_packing, chained_delay, chained_journal, + chained_company_id, chained_picking_type)], + ... + ] + + See also :meth:`stock_location.chained_location_get`. + """ + res_company = self.pool.get('res.company') + return { + 'name': picking_name, + 'origin': tools.ustr(picking.origin or ''), + 'type': picking_type, + 'note': picking.note, + 'move_type': picking.move_type, + 'auto_picking': moves_todo[0][1][1] == 'auto', + 'stock_journal_id': moves_todo[0][1][3], + 'company_id': moves_todo[0][1][4] or res_company._company_default_get(cr, uid, 'stock.company', context=context), + 'address_id': picking.address_id.id, + 'invoice_state': 'none', + 'date': picking.date, + } + + def _create_chained_picking(self, cr, uid, picking_name, picking, picking_type, moves_todo, context=None): picking_obj = self.pool.get('stock.picking') - pick_id= picking_obj.create(cr, uid, { - 'name': pick_name, - 'origin': tools.ustr(picking.origin or ''), - 'type': ptype, - 'note': picking.note, - 'move_type': picking.move_type, - 'auto_picking': move[0][1][1] == 'auto', - 'stock_journal_id': move[0][1][3], - 'company_id': move[0][1][4] or res_obj._company_default_get(cr, uid, 'stock.company', context=context), - 'address_id': picking.address_id.id, - 'invoice_state': 'none', - 'date': picking.date, - }) - return pick_id + return picking_obj.create(cr, uid, self._prepare_chained_picking(cr, uid, picking_name, picking, picking_type, moves_todo, context=context)) + def create_chained_picking(self, cr, uid, moves, context=None): res_obj = self.pool.get('res.company') location_obj = self.pool.get('stock.location')