[Merge]with: lp:openobject-addons
bzr revid: dbr@tinyerp.com-20111216100636-lu5521wfym6zq9ee
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -0,0 +1,93 @@
|
||||
<?xml version="1.0" ?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- Email tempalte -->
|
||||
<record id="email_template_1" model="email.template">
|
||||
<field name="name">Template for New Partner</field>
|
||||
<field name="email_from">info@tinyerp.com</field>
|
||||
<field name="subject">Welcome in OpenERP Partner Channel!</field>
|
||||
<field name="email_to">${object.email or ''}</field>
|
||||
<field name="model_id" ref="base.model_res_partner"/>
|
||||
<field name="body_text">Hello, We are very happy to send Welcome message.</field>
|
||||
</record>
|
||||
<record id="email_template_2" model="email.template">
|
||||
<field name="name">Template for Silver Partner</field>
|
||||
<field name="email_from">info@tinyerp.com</field>
|
||||
<field name="subject">Congratulation! You become now our Silver Partner.</field>
|
||||
<field name="email_to">${object.email or ''}</field>
|
||||
<field name="model_id" ref="base.model_res_partner"/>
|
||||
<field name="body_text">Hello, We are happy to announce that you now become our Silver Partner.</field>
|
||||
</record>
|
||||
|
||||
<record id="email_template_3" model="email.template">
|
||||
<field name="name">Template for Gold Partner</field>
|
||||
<field name="email_from">info@tinyerp.com</field>
|
||||
<field name="subject">Congratulation! You become our Gold Partner.</field>
|
||||
<field name="email_to">${object.email or ''}</field>
|
||||
<field name="model_id" ref="base.model_res_partner"/>
|
||||
<field name="body_text">Hello, We are happy to announce that you become our Gold Partner.</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<!-- Campaign -->
|
||||
<record id="marketing_campaign_openerppartnerchannel" model="marketing.campaign">
|
||||
<field name="name">OpenERP Partner Channel</field>
|
||||
<field name="object_id" ref="base.model_res_partner"/>
|
||||
<field name="mode">active</field>
|
||||
</record>
|
||||
|
||||
<!-- Activity -->
|
||||
|
||||
<record id="marketing_campaign_activity_0" model="marketing.campaign.activity">
|
||||
<field name="name">New Partner</field>
|
||||
<field name="campaign_id" ref="marketing_campaign_openerppartnerchannel"/>
|
||||
<field name="email_template_id" ref="email_template_1"/>
|
||||
<field name="condition">object.credit_limit < 10000</field>
|
||||
<field name="keep_if_condition_not_met">True</field>
|
||||
<field eval="1" name="start"/>
|
||||
</record>
|
||||
<record id="marketing_campaign_activity_1" model="marketing.campaign.activity">
|
||||
<field name="name">Silver Partner</field>
|
||||
<field name="campaign_id" ref="marketing_campaign_openerppartnerchannel"/>
|
||||
<field name="condition">object.credit_limit >= 10000 and object.credit_limit < 50000</field>
|
||||
<field name="keep_if_condition_not_met">True</field>
|
||||
<field name="email_template_id" ref="email_template_2"/>
|
||||
</record>
|
||||
|
||||
<record id="marketing_campaign_activity_2" model="marketing.campaign.activity">
|
||||
<field name="name">Gold Partner</field>
|
||||
<field name="condition">object.credit_limit >= 100000</field>
|
||||
<field name="campaign_id" ref="marketing_campaign_openerppartnerchannel"/>
|
||||
<field name="keep_if_condition_not_met">True</field>
|
||||
<field name="email_template_id" ref="email_template_3"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Tranisition -->
|
||||
<record id="marketing_campaign_transition_0" model="marketing.campaign.transition">
|
||||
<field model="marketing.campaign.activity" name="activity_from_id" ref = "marketing_campaign_activity_0"/>
|
||||
<field model="marketing.campaign.activity" name="activity_to_id" ref = "marketing_campaign_activity_1"/>
|
||||
</record>
|
||||
|
||||
<record id="marketing_campaign_transition_1" model="marketing.campaign.transition">
|
||||
<field model="marketing.campaign.activity" name="activity_from_id" ref = "marketing_campaign_activity_1"/>
|
||||
<field model="marketing.campaign.activity" name="activity_to_id" ref = "marketing_campaign_activity_2"/>
|
||||
</record>
|
||||
|
||||
<!-- Segment -->
|
||||
<record id="filter0" model="ir.filters">
|
||||
<field name="name">Partners</field>
|
||||
<field name="domain">[('name','like','Agrolait')]</field>
|
||||
<field name="model_id">res.partner</field>
|
||||
</record>
|
||||
<record id="marketing_campaign_segment0" model="marketing.campaign.segment">
|
||||
<field eval="time.strftime('%Y-%m-%d %H:%M:%S')" name="date_run"/>
|
||||
<field name="name">OpenERP Partner</field>
|
||||
<field name="sync_mode">create_date</field>
|
||||
<field name="ir_filter_id" ref="filter0"></field>
|
||||
<field name="campaign_id" ref="marketing_campaign_openerppartnerchannel"/>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -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'
|
||||
|
||||
@@ -58,7 +58,7 @@
|
||||
<field name="name">For OpenERP Discovery Day on May 2010</field>
|
||||
</record>
|
||||
|
||||
<record id="email_template_3" model="email.template">
|
||||
<record id="email_template_3" model="email.template">
|
||||
<field name="subject">Thanks for subscribing to the OpenERP Discovery Day</field>
|
||||
<field name="email_to">info@tinyerp.com</field>
|
||||
<field model="ir.actions.act_window" name="ref_ir_act_window" search="[('name', '=', u'For OpenERP OnDemand Free Trial 2010 Mail Form')]"/>
|
||||
@@ -72,7 +72,7 @@
|
||||
<field name="name">For OpenERP Discovery Day</field>
|
||||
</record>
|
||||
|
||||
<record id="email_template_4" model="email.template">
|
||||
<record id="email_template_4" model="email.template">
|
||||
<field name="subject">Thanks for buying the OpenERP book</field>
|
||||
<field name="email_to">info@tinyerp.com</field>
|
||||
<field model="ir.actions.act_window" name="ref_ir_act_window" search="[('name', '=', u'For OpenERP OnDemand Free Trial 2010 Mail Form')]"/>
|
||||
@@ -91,7 +91,6 @@
|
||||
<field name="email_to">info@tinyerp.com</field>
|
||||
<field model="ir.actions.act_window" name="ref_ir_act_window" search="[('name', '=', u'For OpenERP OnDemand Free Trial 2010 Mail Form')]"/>
|
||||
<field model="ir.values" name="ref_ir_value" search="[('name', '=', u'Send Mail (For OpenERP OnDemand Free Trial 2010)')]"/>
|
||||
<field name="model_id" ref="crm.model_crm_lead"/>
|
||||
<field eval="0" name="user_signature"/>
|
||||
<field name="body_text">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 @@
|
||||
<record id="marketing_campaign_openerpondemandfreetrial0" model="marketing.campaign">
|
||||
<field name="name">OpenERP OnDemand Free Trial 2010</field>
|
||||
<field name="object_id" ref="crm.model_crm_lead"/>
|
||||
<field name="mode">active</field>
|
||||
<field name="partner_field_id" ref="crm.field_crm_lead_partner_id"/>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
})
|
||||
|
||||
@@ -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'
|
||||
@@ -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
|
||||
@@ -0,0 +1,45 @@
|
||||
Return-Path: <Robert_Adersen@yahoo.com>
|
||||
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 <abc@mycompany.com>; 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 <Robert_Adersen@yahoo.com>
|
||||
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
|
||||
@@ -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'
|
||||
@@ -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'
|
||||
@@ -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 <Robert_Adersen@yahoo.com>')])
|
||||
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"
|
||||
@@ -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'
|
||||
@@ -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 <Unknown>\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
|
||||
|
||||
@@ -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:
|
||||
|
||||
@@ -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()
|
||||
|
||||
|
||||
+34
-16
@@ -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')
|
||||
|
||||
Reference in New Issue
Block a user