From 9abbb104d0f97600bd98c895664fb6675ce25848 Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Wed, 21 Apr 2010 19:57:13 +0530 Subject: [PATCH 01/15] [IMP]: lunch: Develop Yaml test case and change category_id field type selection to many2one bzr revid: atp@tinyerp.co.in-20100421142713-uyt4qp321a6gmotr --- addons/lunch/__openerp__.py | 5 +- addons/lunch/lunch.py | 14 +--- addons/lunch/lunch_view.xml | 2 +- addons/lunch/test/test_lunch.yml | 122 +++++++++++++++++++++++++++++++ 4 files changed, 128 insertions(+), 15 deletions(-) create mode 100644 addons/lunch/test/test_lunch.yml diff --git a/addons/lunch/__openerp__.py b/addons/lunch/__openerp__.py index 782d5f49df9..efde2f16e61 100644 --- a/addons/lunch/__openerp__.py +++ b/addons/lunch/__openerp__.py @@ -47,7 +47,10 @@ 'lunch_report.xml', #'process/lunch_process.xml' ], - "demo_xml": ['lunch_demo.xml'], + "demo_xml": ['lunch_demo.xml', + ], + "test": ['test/test_lunch.yml' + ], "installable": True, } diff --git a/addons/lunch/lunch.py b/addons/lunch/lunch.py index 207d7ebe940..a986dc25953 100644 --- a/addons/lunch/lunch.py +++ b/addons/lunch/lunch.py @@ -42,21 +42,9 @@ class lunch_product(osv.osv): _name = 'lunch.product' _description = "Lunch Product" - def _category_name_get(self, cr, uid, context={}): - - """ Get category name - @param cr: the current row, from the database cursor, - @param uid: the current user’s ID for security checks, - @param context: A standard dictionary for contextual values""" - - obj = self.pool.get('lunch.category') - cat_ids = obj.search(cr, uid, []) - res = obj.read(cr, uid, cat_ids, ['name', 'category']) - return [(str(r['id']), r['name']) for r in res]+ [('0','')] - _columns = { 'name': fields.char('Name', size=50, required=True), - 'category_id': fields.selection(_category_name_get, 'Category', size=32), + 'category_id': fields.many2one('lunch.category', 'Category'), 'description': fields.char('Description', size=128, required=False), 'price': fields.float('Price', digits=(16,2)), 'active': fields.boolean('Active'), diff --git a/addons/lunch/lunch_view.xml b/addons/lunch/lunch_view.xml index 962330c1ea2..ab3d6792683 100644 --- a/addons/lunch/lunch_view.xml +++ b/addons/lunch/lunch_view.xml @@ -195,7 +195,7 @@
- + diff --git a/addons/lunch/test/test_lunch.yml b/addons/lunch/test/test_lunch.yml new file mode 100644 index 00000000000..01ed21b690a --- /dev/null +++ b/addons/lunch/test/test_lunch.yml @@ -0,0 +1,122 @@ +- | + In order to test the Lunch module in OpenERP, + I will create one lunch order and then check the effect on cashboxes and cashmoves + +- | + Given that I have a category of lunch products "Sandwich". +- + !record {model: lunch.category, id: lunch_category_burger0}: + name: Burger +- | + Given that I have a product "Club1" in this category with a price of "2.75". + +- + !record {model: lunch.product, id: lunch_product_club1}: + category_id: lunch_category_burger0 + name: Club1 + price: 2.75 +- | + Given that I have a cashbox "Cashbox" +- + !record {model: lunch.cashbox, id: lunch_cashbox_cashbox0}: + manager: base.user_root + name: CashBox +- | + I create a lunch order "LU001" for the "Club1" product +- | + When I select the product "club1", the price of 2.75 is automatically proposed +- + !record {model: lunch.order, id: lunch_order_0}: + date: '2010-04-19' + product: 'lunch_product_club1' + price: 2.75 + user_id: base.user_root + +- | + I check that lunch order is on draft state after having created it. +- + !assert {model: lunch.order, id: lunch_order_0}: + - state == 'draft' +- | + I confirm the order "LU001" using the "Confirm Order" wizard. +- + !record {model: lunch.order.confirm, id: lunch_order_confirm_0}: + confirm_cashbox: 'lunch_cashbox_cashbox0' +- + !python {model: lunch.order.confirm}: | + self.confirm(cr, uid, [ref('lunch_order_confirm_0')], {'active_ids': [ref('lunch_order_0')]}) +- | + I check that the Cash Moves have been generated with the right box + name +- + # !assert {model: lunch.order, id: lunch_order_0}: + # - cashmove != False + +- | + I check that the Total on the cashbox is -2.75 + +- + !assert {model: lunch.cashbox, id: lunch_cashbox_cashbox0}: + - sum_remain == -2.75 + +- | + I create a new lunch order "LU002" for the "Club" product, at another date. +- + !record {model: lunch.order, id: lunch_order_1}: + date: '2010-04-22' + product: 'lunch_product_club1' + price: 2.75 + user_id: base.user_root + +- | + I confirm this order.open wizard and select cashbox. +- + !record {model: lunch.order.confirm, id: lunch_order_confirm_1}: + confirm_cashbox: 'lunch_cashbox_cashbox0' +- + Now I click on "Confirm Order" button of this wizard. +- + !python {model: lunch.order.confirm}: | + self.confirm(cr, uid, [ref('lunch_order_confirm_1')], {'active_ids': [ref('lunch_order_1')]}) + +- | + I check that the Total on the cashbox is -5.50 +- + !assert {model: lunch.cashbox, id: lunch_cashbox_cashbox0}: + - sum_remain == -5.50 +- | + I reset the cashbox to zero using the "Set CashBox to Zero" wizard. +- + !record {model: lunch.cashbox.clean, id: lunch_cashbox_clean_0}: + {} +- + !python {model: lunch.cashbox.clean, id: lunch_cashbox_clean_0}: | + self.set_to_zero(cr, uid, [ref('lunch_cashbox_clean_0')], {'active_ids': [ref('lunch_cashbox_cashbox0')]}) + +- | + I check that the Total on the cashbox is 0.0 +- + !assert {model: lunch.cashbox, id: lunch_cashbox_cashbox0}: + - sum_remain == 0.00 + +- | + I cancel the order "LU002" +- + !record {model: lunch.order.cancel, id: lunch_order_cancel_0}: + {} +- + !python {model: lunch.order.cancel}: | + self.cancel(cr, uid, [ref('lunch_order_cancel_0')], {'active_ids': [ref('lunch_order_1')]}) + +- | + I test that the Cash Moves revord have been removed for the order LU002. +- + !assert {model: lunch.order, id: lunch_order_1}: + - cashmove == False + +- | + I check that the Total on the cashbox is -2.75 +- + !assert {model: lunch.cashbox, id: lunch_cashbox_cashbox0}: + - sum_remain == -2.75 + \ No newline at end of file From dc456e15857a5a67adfa2a67cfb86cfe0208868e Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Wed, 21 Apr 2010 20:09:30 +0530 Subject: [PATCH 02/15] [ADD]: idea: Develop Yaml test case bzr revid: atp@tinyerp.co.in-20100421143930-3tvyfatres2ckp2j --- addons/idea/__openerp__.py | 1 + addons/idea/test/test_idea.yml | 94 ++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) create mode 100644 addons/idea/test/test_idea.yml diff --git a/addons/idea/__openerp__.py b/addons/idea/__openerp__.py index c5794346f4d..4730fd4637c 100644 --- a/addons/idea/__openerp__.py +++ b/addons/idea/__openerp__.py @@ -43,6 +43,7 @@ 'security/ir.model.access.csv', ], 'demo_xml': [], + 'test':['test/test_idea.yml'], 'installable': True, 'certificate': '0071515601309', } diff --git a/addons/idea/test/test_idea.yml b/addons/idea/test/test_idea.yml new file mode 100644 index 00000000000..bc67bcd49b4 --- /dev/null +++ b/addons/idea/test/test_idea.yml @@ -0,0 +1,94 @@ +- | + In order to test the Idea module in OpenERP, + we will create a full flow, from the idea definition up to the votes and discussions on the idea. +- | + Given that I have an Idea category "Technical". +- + !record {model: idea.category, id: idea_category_technical0}: + name: Technical +- | + I create a New Idea of "Technical presentation for 1 hours in every day" and specify category "Technical". + +- + !record {model: idea.idea, id: idea_idea_0}: + category_id: idea_category_technical0 + description: I want that Technical presentation are arranged for 1 hours in every + day.\nso, on that presentation, we can know all things what improvement and development + are done in our company.\n\n\n\n\n + title: Technical presentation for 1 hours in every day + user_id: base.user_root +- | + I check that idea on draft state. +- + !assert {model: idea.idea, id: idea_idea_0}: + - state == 'draft' +- | + I open this idea by click on "Open" button. +- + !workflow {model: idea.idea, action: idea_open, ref: idea_idea_0} +- | + In order to check voting statistics in real systems I will create 2 new Users "user1" and user2" +- + !record {model: res.users, id: res_users_user0}: + company_id: base.main_company + context_lang: en_US + login: user1 + name: user1 + password: user1 + +- + !record {model: res.users, id: res_users_user1}: + company_id: base.main_company + context_lang: en_US + login: user2 + name: user2 + password: user2 + +- + In order to post vote I connect as user1 and open the idea page + I click on "Vote" wizard and vote the idea as "Normal" +- + !record {model: idea.post.vote, id: idea_post_vote_0}: + vote: 50 +- + !python {model: idea.post.vote}: | + uid = ref('res_users_user0') + self.do_vote(cr, uid, [ref("idea_post_vote_0")], {'active_id': ref('idea_idea_0')}) +- + To add other vote I connect as user2 and open the idea page + I click on "Vote" wizard and vote the idea as "Very Good" +- + !record {model: idea.post.vote, id: idea_post_vote_1}: + vote: 100 + +- + !python {model: idea.post.vote}: | + uid = ref('res_users_user1') + self.do_vote(cr, uid, [ref("idea_post_vote_1")], {'active_id': ref('idea_idea_0')}) + +- + I can see that the Average score changed in "Average score" field with value 75 +- + !record {model: idea.idea, id: idea_idea_0}: + vote_avg: 75 + +- + I put one comment "We can learn many things from technical presentation" for the idea +- + !record {model: idea.idea, id: idea.idea_idea_0}: + comment_ids: + - content: We can learn many things from technical presentation + idea_id: idea.idea_idea_0 + user_id: base.user_root + +- + I close this idea by click on "Close" button. +- + !workflow {model: idea.idea, action: idea_close, ref: idea_idea_0} + +- + I check that the idea's state is now Accepted +- + !assert {model: idea.idea, id: idea_idea_0}: + - state == 'close' + \ No newline at end of file From 361fe501bc9c6e26b335ee698d18eea8abff9355 Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Wed, 21 Apr 2010 20:13:01 +0530 Subject: [PATCH 03/15] [ADD]: crm: Add yaml test case in crm module. bzr revid: atp@tinyerp.co.in-20100421144301-r3prs93ny2jw3qsb --- addons/crm/__openerp__.py | 8 ++ addons/crm/test/test_crm_claim.yml | 38 ++++++++ addons/crm/test/test_crm_fund.yml | 32 +++++++ addons/crm/test/test_crm_helpdesk.yml | 38 ++++++++ addons/crm/test/test_crm_lead.yml | 86 ++++++++++++++++++ addons/crm/test/test_crm_meeting.yml | 109 +++++++++++++++++++++++ addons/crm/test/test_crm_opportunity.yml | 81 +++++++++++++++++ addons/crm/test/test_crm_phonecall.yml | 89 ++++++++++++++++++ 8 files changed, 481 insertions(+) create mode 100644 addons/crm/test/test_crm_claim.yml create mode 100644 addons/crm/test/test_crm_fund.yml create mode 100644 addons/crm/test/test_crm_helpdesk.yml create mode 100644 addons/crm/test/test_crm_lead.yml create mode 100644 addons/crm/test/test_crm_meeting.yml create mode 100644 addons/crm/test/test_crm_opportunity.yml create mode 100644 addons/crm/test/test_crm_phonecall.yml diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index b3e45a33978..9d889799127 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -118,6 +118,14 @@ between mails and Open ERP.""", 'crm_opportunity_demo.xml', 'crm_phonecall_demo.xml' ], + 'test': ['test/test_crm_lead.yml', + 'test/test_crm_meeting.yml', + 'test/test_crm_opportunity.yml', + 'test/test_crm_phonecall.yml', + 'test/test_crm_fund.yml', + 'test/test_crm_claim.yml', + 'test/test_crm_helpdesk.yml', + ], 'installable': True, 'active': False, 'certificate': '0079056041421', diff --git a/addons/crm/test/test_crm_claim.yml b/addons/crm/test/test_crm_claim.yml new file mode 100644 index 00000000000..54ef47a56f5 --- /dev/null +++ b/addons/crm/test/test_crm_claim.yml @@ -0,0 +1,38 @@ +- | + Now I check claims which contain customer claim information about document + related problem, product related problem. +- | + I start by creating new claims for Damaged product as Value Claims with priority High and specify + date of claim at which claim is created. +- + !record {model: crm.claim, id: crm_claim_damagedproduct0}: + categ_id: crm.categ_claim2 + date: '2010-04-21 20:13:00' + email_from: info@balmerinc.be + name: 'Damaged product ' + partner_address_id: base.res_partner_address_1 + partner_id: base.res_partner_9 + priority: '2' + section_id: crm.section_sales_department + +- | + I check that the claims is in 'draft' state. +- + !assert {model: crm.claim, id: crm_claim_damagedproduct0}: + - state == 'draft' +- | + Now I make sure that claim is at "Accepted" stage. +- + !record {model: crm.claim, id: crm.crm_claim_damagedproduct0}: + stage_id: crm.stage_claim1 +- | + I can change that stage by next button right on it +- + !python {model: crm.claim}: | + self.stage_next(cr, uid, [ref('crm_claim_damagedproduct0')]) +- | + I make this claim as Open +- + !python {model: crm.claim}: | + self.case_open(cr, uid, [ref('crm_claim_damagedproduct0')]) + diff --git a/addons/crm/test/test_crm_fund.yml b/addons/crm/test/test_crm_fund.yml new file mode 100644 index 00000000000..4bcacbe148e --- /dev/null +++ b/addons/crm/test/test_crm_fund.yml @@ -0,0 +1,32 @@ +- | + Now I start test Fund Raising which contain information about Donation or charity + given by user. +- | + I start by creating new Funds entry for donation for books to poor school children + with cost 500000.00 and category as "Learning And Education" + I make payment by Cheque so I make sure that the mode on fund is selected as cheque +- + !record {model: crm.fundraising, id: crm_fundraising_donationforbookstopoorschoolchildren0}: + categ_id: crm.categ_fund2 + email_from: info@balmerinc.be + name: Donation for books to poor school children + partner_address_id: base.res_partner_address_1 + partner_id: base.res_partner_9 + planned_cost: 500000.0 + section_id: crm.section_sales_department + type_id: crm.type_fund2 +- | + I check that the Funds is in 'draft' state. +- + !assert {model: crm.fundraising, id: crm_fundraising_donationforbookstopoorschoolchildren0}: + - state == 'draft' +- | + Now I open Funds by click on "Open" button +- + !python {model: crm.fundraising}: | + self.case_open(cr, uid, [ref('crm_fundraising_donationforbookstopoorschoolchildren0')]) +- | + I can close Funds by click on "Done" button. +- + !python {model: crm.fundraising}: | + self.case_close(cr, uid, [ref('crm_fundraising_donationforbookstopoorschoolchildren0')]) diff --git a/addons/crm/test/test_crm_helpdesk.yml b/addons/crm/test/test_crm_helpdesk.yml new file mode 100644 index 00000000000..6d3beb43b41 --- /dev/null +++ b/addons/crm/test/test_crm_helpdesk.yml @@ -0,0 +1,38 @@ +- + | + I start by creating New helpdesk request regarding some functional questions. + I select Date at which helpdesk request is created. +- + !record {model: crm.helpdesk, id: crm_helpdesk_somefunctionalquestion0}: + date: '2010-04-22 10:17:00' + email_from: info@balmerinc.be + name: Some functional question. + partner_address_id: base.res_partner_address_1 + partner_id: base.res_partner_9 + section_id: crm.section_sales_department + +- | + I check that the Helpdesk request is in 'Draft' state. +- + !assert {model: crm.helpdesk, id: crm_helpdesk_somefunctionalquestion0}: + - state == 'draft' +- | + In order to make this helpdesk request to be considered I make it "Open" +- + !python {model: crm.helpdesk}: | + self.case_open(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')]) +- | + I can see that "Send Reminder" button is visible, which is used to send reminder to partner from + responsible person or send reminder to responsible person from partner. +- + #this is not work for yaml. +- +# !python {model: crm.helpdesk}: | +# self.remind_user(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')], context={}, attach=False, destination=True) +- | + After a proper communication for the request via email I make sure that the request is fulfilled and + I close this HelpDesk Request by clicking on "Close" button. +- + !python {model: crm.helpdesk}: | + self.case_close(cr, uid, [ref('crm_helpdesk_somefunctionalquestion0')]) +- diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml new file mode 100644 index 00000000000..f22adf72e82 --- /dev/null +++ b/addons/crm/test/test_crm_lead.yml @@ -0,0 +1,86 @@ +- | + In order to test the CRM in OpenERP, + I will do a customer qualification process that + starts with a fist contact with a customer (a lead), which will be converted to a + business opportunity and a partner. +- | + In order to test the flow, I create a two new users "user_crm" and + I assign the group "salesman". +- + !record {model: res.users, id: res_users_usercrm0}: + company_id: base.main_company + context_lang: en_US + context_section_id: crm.section_sales_department + groups_id: + - crm.group_crm_user + login: user_crm + name: user_crm + password: user_crm + + +- | + I start by creating a new lead "New Customer" and I provide an address to this + new customer, as well as an email "info@mycustomer.com". +- + !record {model: crm.lead, id: crm_lead_newcustomer0}: + email_from: info@mycustomer.com + name: New Customer + partner_name: Stonage IT + phone: (855) 924-4364 + mobile: (333) 715-1450 + section_id: crm.section_sales_department + title: M. +- | + I check that the lead is in 'draft' state, +- + !assert {model: crm.lead, id: crm_lead_newcustomer0, string: Lead in Draft}: + - state == "draft" +- + I open lead by click on "Open" button, +- + !python {model: crm.lead}: | + self.case_open(cr, uid, [ref("crm_lead_newcustomer0")]) + +- | + As the lead seems to be a real business opportunity, I will convert it to a + partner + and a business opportunity by clicking on the "Convert" button. +- + !python {model: crm.lead}: | + lead = self.browse(cr, uid, ref('crm_lead_newcustomer0')) + if not lead.partner_id: + self.convert_opportunity(cr, uid, [ref("crm_lead_newcustomer0")]) +- + #!act_window {target: new, res_model: crm.lead2opportunity, id: action_crm_lead2opportunity, name: Create Opportunity} +- | + I can check that a lead and a business opportunity is now assigned to this + lead. +- | + I check that the partner associated to this lead as the same country, phone number + and name than the opportunity. +- + #Remaining +- + +# !python {model: crm.lead}: | +# lead = self.browse(cr, uid, ref("crm_lead_newcustomer0")) +# print "lead", lead.partner_name +# obj_opportunity = self.pool.get('crm.opportunity') +# ids = obj_opportunity.search(cr, uid, [('name', '=', lead.partner_name)]) +# opportunity = obj_opportunity.browse(cr, uid, ids)[0] +# assert lead.partner_name == opportunity.partner_id.name +# assert lead.phone == opportunity.phone + +- | + I configure with smtp server. +- | + And I communicate with lead through send New mail to Lead using it email address from user which are loged. +- | + I check that communication history generated when send email to lead. +- | + Then, I add a cc which receive copy of future communication between partner and users by mail. + +- | + I Reply to last Email to lead with some document attached.and check that communication history generated or not. + + \ No newline at end of file diff --git a/addons/crm/test/test_crm_meeting.yml b/addons/crm/test/test_crm_meeting.yml new file mode 100644 index 00000000000..bd8142ecabf --- /dev/null +++ b/addons/crm/test/test_crm_meeting.yml @@ -0,0 +1,109 @@ +- | + Now I will test Meetings which may be customer meeting or phonecall meeting or + internal Meeting. +- + I start by creating a new Meeting. +- + For that, I first create alarm. +- + !record {model: res.alarm, id: res_alarm_minituesbefore0}: + name: 40 minutes before + trigger_duration: 40 + trigger_interval: minutes + trigger_occurs: before + trigger_related: start +- + I create Meeting. +- + !record {model: crm.meeting, id: crm_meeting_regardingpresentation0}: + categ_id: crm.categ_meet2 + date: '2010-04-21 16:04:00' + date_deadline: '2010-04-22 00:04:00' + duration: 8.0 + email_from: info@balmerinc.be + location: Ahmedabad + name: Regarding Presentation + partner_address_id: base.res_partner_address_1 + partner_id: base.res_partner_9 + rrule_type: weekly + section_id: crm.section_sales_department +- | + I check that the Meetings is in 'UnConfirmed' state. +- + !assert {model: crm.meeting, id: crm_meeting_regardingpresentation0}: + - state == "draft" +- | + I can set reminder on meeting if I put reminder "40 minutes before" +- + For that, I first create alarm. +- + !record {model: res.alarm, id: res_alarm_minituesbefore0}: + name: 40 minutes before + trigger_duration: 40 + trigger_interval: minutes + trigger_occurs: before + trigger_related: start +- | + Now I will assign this reminder. + +- !python {model: crm.meeting}: | + self.write(cr, uid, [ref('crm_meeting_regardingpresentation0')], {'alarm_id': ref("res_alarm_minituesbefore0")}) +- | + In order to check recurrence on meetings I will set Recurrency to Custom + and I set the fields so that the meeting will occure weekly on Monday and Friday 10 times +- + !record {model: crm.meeting, id: crm_meeting_regardingpresentation0}: + count: 10 + fr: 1 + freq: weekly + mo: 1 + rrule_type: custom + th: 1 + tu: 1 + we: 1 +- | + I can see from the calendar view that the meeting is scheduled on Monday and Friday + for 10 times, + I will search for one of the recurrent event and count the number of events +- + !python {model: crm.meeting}: | + ids = self.search(cr, uid, [('date', '>=', '2010-05-21 00:00:00'), ('date', '<=', '2010-04-21 00:00:00')] ) + assert len(ids) == 9 + +- | + Now If I want to edit meetings information for all occurence I click on "Edit All" button. +- + !python {model: crm.meeting}: | + self.open_meeting(cr, uid, [ref('crm_meeting_regardingpresentation0')]) +- | + I can see that new meeting form is opened with same value + I change some data for meeting and save it + I can see from meeting's calendar view that all meeting occurences are changed accordingly +- + !record {model: crm.meeting, id: crm.crm_meeting_regardingpresentation0}: + alarm_id: base_calendar.alarm9 + rrule_type: weekly + +- | + In order to invite people for this meetings, I click on "Invite People" button + I can invite internal user. +- + !record {model: base_calendar.invite.attendee, id: base_calendar_invite_attendee_0}: + type: internal + partner_id: base.res_partner_9 + user_ids: + - base.user_demo +- | + If I set Send mail boolean as True I can see that an email is send to + specified email address with proper meeting information. +- + #this is not working for send mail boolean as True. +- + !python {model: base_calendar.invite.attendee}: | + self.do_invite(cr, uid, [ref('base_calendar_invite_attendee_0')], {'active_id': ref('crm_meeting_regardingpresentation0'), 'model' : 'crm.meeting', 'attendee_field':'attendee_ids'}) + +- | + After direct/indirect confirmation for meetings I can confirm meeting +- + !python {model: crm.meeting}: | + self.case_open(cr, uid, [ref('crm_meeting_regardingpresentation0')]) diff --git a/addons/crm/test/test_crm_opportunity.yml b/addons/crm/test/test_crm_opportunity.yml new file mode 100644 index 00000000000..4fd0ddace95 --- /dev/null +++ b/addons/crm/test/test_crm_opportunity.yml @@ -0,0 +1,81 @@ +- | + I start by creating a new Opportunity. And I select partner for opportunity. + I can see that after selecting partner his contact and email is automatically filled. +- + !record {model: crm.opportunity, id: crm_opportunity_abcfuelcounits0}: + email_from: info@balmerinc.be + name: 'ABC FUEL CO 829264 - 10002 units ' + partner_address_id: base.res_partner_address_1 + partner_id: base.res_partner_9 + probability: 1.0 + stage_id: crm.stage_oppor1 + categ_id: crm.categ_oppor2 + section_id: crm.section_sales_department + +- | + I check that the opportunity is in 'New' state. +- + !assert {model: crm.opportunity, id: crm_opportunity_abcfuelcounits0}: + - state == "draft" +- | + I open opportunity by click on "Open" button, +- + !python {model: crm.opportunity}: | + self.case_open(cr, uid, [ref("crm_opportunity_abcfuelcounits0")]) + +- | + I schedule Meeting on this current opportunity by clicking on "schedule + Meeting". +- + !python {model: crm.opportunity}: | + self.action_makeMeeting(cr, uid, [ref("crm_opportunity_abcfuelcounits0")]) + +- | + I can see that Meeting's calendar view is shown. + then I click on the date on which I want schedule meeting. + I fill proper data for that meeting and save it +- + !record {model: crm.meeting, id: crm_meeting_abcfuelcounits0}: + alarm_id: base_calendar.alarm3 + date: '2010-04-16 00:00:00' + date_deadline: '2010-04-16 08:00:00' + duration: 8.0 + email_from: info@balmerinc.be + name: 'ABC FUEL CO 829264 - 10002 units ' + opportunity_id: 'crm_opportunity_abcfuelcounits0' + partner_address_id: base.res_partner_address_1 + partner_id: base.res_partner_9 + rrule_type: weekly + section_id: crm.section_sales_department + state: open +- | + In order to schedule a phonecall to the partner + I click on "schedule call" button and select planned date for the call. +- + !record {model: crm.opportunity2phonecall, id: crm_opportunity2phonecall_abcfuelcounits0}: + date: '2010-04-17 11:15:00' + name: 'ABC FUEL CO 829264 - 10002 units ' + section_id: crm.section_sales_department + user_id: base.user_demo +- | + schedule phonecall by apply (action_apply)function of opportunity2phoncall wizard +- + !python {model: crm.opportunity2phonecall}: | + self.action_apply(cr, uid, [ref('crm_opportunity2phonecall_abcfuelcounits0')], {'active_ids': [ref("crm_opportunity_abcfuelcounits0")]}) +- | + I check that phonecall record is created for that opportunity. +- + !python {model: crm.phonecall}: | + ids = self.search(cr, uid, [('name', '=', 'ABC FUEL CO 829264 - 10002 units')]) + assert len(ids) +- + I can see phonecall record after click on "Schedule call" wizard. +- + !record {model: crm.phonecall, id: crm_phonecall_abcfuelcounits0}: + date: '2010-04-17 11:15:00' + duration: 3.0 + name: 'ABC FUEL CO 829264 - 10002 units' + partner_address_id: base.res_partner_address_1 + partner_id: base.res_partner_9 + section_id: crm.section_sales_department + \ No newline at end of file diff --git a/addons/crm/test/test_crm_phonecall.yml b/addons/crm/test/test_crm_phonecall.yml new file mode 100644 index 00000000000..7e6ed56abc5 --- /dev/null +++ b/addons/crm/test/test_crm_phonecall.yml @@ -0,0 +1,89 @@ +- | + I start by creating a new phonecall. +- + !record {model: crm.phonecall, id: crm_phonecall_interviewcall0}: + date: '2010-04-21 18:59:00' + name: Interview call + partner_address_id: base.res_partner_address_1 + partner_id: base.res_partner_9 + partner_mobile: (+32)2 211 34 83 + section_id: crm.section_sales_department + +- | + As the success of phonecall seems to be a real business opportunity, I will convert + it to opportunity by clicking on the "Convert to Opportunity" button. +- +# !python {model: crm.phonecall2opportunity}: | +# self.action_apply(cr, uid, [1], {'active_id': ref('crm_phonecall_interviewcall0')}) + +- + # This is not working, find a way to do that in YAML + +- | + I can see that a business opportunity is now assigned to this phonecall +- | + I check that the partner associated to this as the same country, phone number + and name than the phonecall. +- | + In order to avoid the duplication of similar partner, OpenERP should be able to + detect if the partner exists or if it should be created from the phonecall during the + conversion. +- | + In order to test this, I log as the user "user_crm2" +- | + Then, I create the same phonecall than the preceeding one but I change the name + of the phonecall. But this customer keeps the same email. +- | + This time OpenERP should detect that this customer already exists in the + partner base and I check that in the wizard, proposes me to link to this existing + partner instead of creating another one. +- | + I confirm the conversion wizard. +- | + And I check that the phonecall and the newly created business opportunity is linked + to the partner +- | + I schedule Meeting on this current phonecall by clicking on "schedule + Meeting" +- + !python {model: crm.phonecall}: | + self.action_make_meeting(cr, uid, [ref('crm_phonecall_interviewcall0')]) + +- + I can see that Meeting's calendar view is shown. + then I click on the date on which I want schedule meeting. + I fill proper data for that meeting and save it +- + !record {model: crm.meeting, id: crm_meeting_interviewcall0}: + alarm_id: base_calendar.alarm3 + date: '2010-04-20 00:00:00' + date_deadline: '2010-04-20 08:00:00' + duration: 8.0 + email_from: info@balmerinc.be + name: Interview call + partner_address_id: base.res_partner_address_1 + partner_id: base.res_partner_9 + phonecall_id: 'crm_phonecall_interviewcall0' + rrule_type: weekly + state: open + +- + #This is not working for yaml +- + I can jump to this meeting by "Meetings" shortcut from my phonecall's form view +- + +- | + In order to schedule other phonecall to the partner + I click on "schedule other call" button. and plan for other call + I can see that it will open other phonecall view with some data same as current + phonecall. +- + !record {model: crm.phonecall2phonecall, id: crm_phonecall2phonecall_interviewcall0}: + date: '2010-04-21 19:49:00' + name: Interview call + section_id: crm.section_sales_department + user_id: base.user_root +- + !python {model: crm.phonecall2phonecall}: | + self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_interviewcall0')], {'active_id': ref('crm_phonecall_interviewcall0')}) From 6ebc3c4453cce48118c89c8198c9ba531dab55fa Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Wed, 21 Apr 2010 20:49:11 +0530 Subject: [PATCH 04/15] [IMP]:crm: Improvement in crm meeting yaml bzr revid: atp@tinyerp.co.in-20100421151911-kmach16jn0dhlno4 --- addons/crm/__openerp__.py | 2 +- addons/crm/test/test_crm_meeting.yml | 36 ++++++++++------------------ 2 files changed, 13 insertions(+), 25 deletions(-) diff --git a/addons/crm/__openerp__.py b/addons/crm/__openerp__.py index 9d889799127..e4dea534b65 100644 --- a/addons/crm/__openerp__.py +++ b/addons/crm/__openerp__.py @@ -109,6 +109,7 @@ between mails and Open ERP.""", 'process/crm_configuration_process.xml', ], 'demo_xml': [ + 'test/test_crm_meeting.yml', 'crm_demo.xml', 'crm_claims_demo.xml', 'crm_fund_demo.xml', @@ -119,7 +120,6 @@ between mails and Open ERP.""", 'crm_phonecall_demo.xml' ], 'test': ['test/test_crm_lead.yml', - 'test/test_crm_meeting.yml', 'test/test_crm_opportunity.yml', 'test/test_crm_phonecall.yml', 'test/test_crm_fund.yml', diff --git a/addons/crm/test/test_crm_meeting.yml b/addons/crm/test/test_crm_meeting.yml index bd8142ecabf..6234349a765 100644 --- a/addons/crm/test/test_crm_meeting.yml +++ b/addons/crm/test/test_crm_meeting.yml @@ -1,19 +1,8 @@ - | Now I will test Meetings which may be customer meeting or phonecall meeting or internal Meeting. -- - I start by creating a new Meeting. -- - For that, I first create alarm. -- - !record {model: res.alarm, id: res_alarm_minituesbefore0}: - name: 40 minutes before - trigger_duration: 40 - trigger_interval: minutes - trigger_occurs: before - trigger_related: start -- - I create Meeting. +- + I start by creating a new Meeting. - !record {model: crm.meeting, id: crm_meeting_regardingpresentation0}: categ_id: crm.categ_meet2 @@ -51,20 +40,19 @@ - | In order to check recurrence on meetings I will set Recurrency to Custom and I set the fields so that the meeting will occure weekly on Monday and Friday 10 times -- - !record {model: crm.meeting, id: crm_meeting_regardingpresentation0}: - count: 10 - fr: 1 - freq: weekly - mo: 1 - rrule_type: custom - th: 1 - tu: 1 - we: 1 +- + !python {model: crm.meeting}: | + self.write(cr, uid, [ref("crm_meeting_regardingpresentation0")], {'fr': 1, 'mo': 1, 'th': 1, 'tu': 1, 'we':1, 'count':10, 'interval': 1, 'freq': 'weekly', 'rrule_type': 'custom'}) + - | I can see from the calendar view that the meeting is scheduled on Monday and Friday for 10 times, - I will search for one of the recurrent event and count the number of events + +- + !python {model: crm.meeting}: | + self.fields_view_get(cr, uid, False, 'calendar', context) + + I will search for one of the recurrent event and count the number of meeting. - !python {model: crm.meeting}: | ids = self.search(cr, uid, [('date', '>=', '2010-05-21 00:00:00'), ('date', '<=', '2010-04-21 00:00:00')] ) From 34a3e22250f723efd5603f890304d5229981d17f Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Thu, 22 Apr 2010 10:24:38 +0530 Subject: [PATCH 05/15] [IMP]: lunch: Minor improvement in comment of yaml test case. bzr revid: atp@tinyerp.co.in-20100422045438-z7pjermcnnwzwxs2 --- addons/lunch/test/test_lunch.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/lunch/test/test_lunch.yml b/addons/lunch/test/test_lunch.yml index 01ed21b690a..a415731a04a 100644 --- a/addons/lunch/test/test_lunch.yml +++ b/addons/lunch/test/test_lunch.yml @@ -3,7 +3,7 @@ I will create one lunch order and then check the effect on cashboxes and cashmoves - | - Given that I have a category of lunch products "Sandwich". + Given that I have a category of lunch products "Burger". - !record {model: lunch.category, id: lunch_category_burger0}: name: Burger @@ -60,7 +60,7 @@ - sum_remain == -2.75 - | - I create a new lunch order "LU002" for the "Club" product, at another date. + I create a new lunch order "LU002" for the "Club1" product, at another date. - !record {model: lunch.order, id: lunch_order_1}: date: '2010-04-22' From 63de0de17d970d4218a55bc849719e1ca1a0b547 Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Thu, 22 Apr 2010 10:39:02 +0530 Subject: [PATCH 06/15] [IMP]: crm: Minor Improvement in meeting yaml fiel bzr revid: atp@tinyerp.co.in-20100422050902-i30v1lylj8rrcpfi --- addons/crm/test/test_crm_meeting.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/crm/test/test_crm_meeting.yml b/addons/crm/test/test_crm_meeting.yml index 6234349a765..55db5e84cc7 100644 --- a/addons/crm/test/test_crm_meeting.yml +++ b/addons/crm/test/test_crm_meeting.yml @@ -51,7 +51,7 @@ - !python {model: crm.meeting}: | self.fields_view_get(cr, uid, False, 'calendar', context) - +- I will search for one of the recurrent event and count the number of meeting. - !python {model: crm.meeting}: | From 3db3e385b7fc8af4883cb818e82ead287f8d0189 Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Thu, 22 Apr 2010 17:18:11 +0530 Subject: [PATCH 07/15] [IMP]: Improvement in Yaml test case for idea and lunch bzr revid: atp@tinyerp.co.in-20100422114811-p9edr3awg3wk7xsk --- addons/idea/test/test_idea.yml | 33 ++++++++++++++++++++------------ addons/lunch/test/test_lunch.yml | 12 ++++++++++-- 2 files changed, 31 insertions(+), 14 deletions(-) diff --git a/addons/idea/test/test_idea.yml b/addons/idea/test/test_idea.yml index bc67bcd49b4..48e838e6570 100644 --- a/addons/idea/test/test_idea.yml +++ b/addons/idea/test/test_idea.yml @@ -17,17 +17,20 @@ are done in our company.\n\n\n\n\n title: Technical presentation for 1 hours in every day user_id: base.user_root + - | I check that idea on draft state. - !assert {model: idea.idea, id: idea_idea_0}: - state == 'draft' + - | I open this idea by click on "Open" button. - !workflow {model: idea.idea, action: idea_open, ref: idea_idea_0} + - | - In order to check voting statistics in real systems I will create 2 new Users "user1" and user2" + In order to check voting statistics in real systems I will create 2 new Users "user1". - !record {model: res.users, id: res_users_user0}: company_id: base.main_company @@ -35,7 +38,8 @@ login: user1 name: user1 password: user1 - +- | + And I will also create user2. - !record {model: res.users, id: res_users_user1}: company_id: base.main_company @@ -44,35 +48,41 @@ name: user2 password: user2 -- +- | In order to post vote I connect as user1 and open the idea page I click on "Vote" wizard and vote the idea as "Normal" - !record {model: idea.post.vote, id: idea_post_vote_0}: - vote: 50 -- + vote: 50 +- | + Now I click on "Post Vote" button of wizard. +- !python {model: idea.post.vote}: | uid = ref('res_users_user0') self.do_vote(cr, uid, [ref("idea_post_vote_0")], {'active_id': ref('idea_idea_0')}) -- + +- | To add other vote I connect as user2 and open the idea page I click on "Vote" wizard and vote the idea as "Very Good" -- + +- | !record {model: idea.post.vote, id: idea_post_vote_1}: vote: 100 +- | + I click on "Post Vote" button of this wizard. - !python {model: idea.post.vote}: | uid = ref('res_users_user1') self.do_vote(cr, uid, [ref("idea_post_vote_1")], {'active_id': ref('idea_idea_0')}) -- +- | I can see that the Average score changed in "Average score" field with value 75 - !record {model: idea.idea, id: idea_idea_0}: vote_avg: 75 -- +- | I put one comment "We can learn many things from technical presentation" for the idea - !record {model: idea.idea, id: idea.idea_idea_0}: @@ -80,13 +90,12 @@ - content: We can learn many things from technical presentation idea_id: idea.idea_idea_0 user_id: base.user_root - -- +- | I close this idea by click on "Close" button. - !workflow {model: idea.idea, action: idea_close, ref: idea_idea_0} -- +- | I check that the idea's state is now Accepted - !assert {model: idea.idea, id: idea_idea_0}: diff --git a/addons/lunch/test/test_lunch.yml b/addons/lunch/test/test_lunch.yml index a415731a04a..e44b90c4fa7 100644 --- a/addons/lunch/test/test_lunch.yml +++ b/addons/lunch/test/test_lunch.yml @@ -42,9 +42,12 @@ - !record {model: lunch.order.confirm, id: lunch_order_confirm_0}: confirm_cashbox: 'lunch_cashbox_cashbox0' +- + I click on "Confirm Order" button of this wizard. - !python {model: lunch.order.confirm}: | - self.confirm(cr, uid, [ref('lunch_order_confirm_0')], {'active_ids': [ref('lunch_order_0')]}) + self.confirm(cr, uid, [ref('lunch_order_confirm_0')], {'active_ids': [ref('lunch_order_0')]}) + - | I check that the Cash Moves have been generated with the right box name @@ -73,7 +76,7 @@ - !record {model: lunch.order.confirm, id: lunch_order_confirm_1}: confirm_cashbox: 'lunch_cashbox_cashbox0' -- +- | Now I click on "Confirm Order" button of this wizard. - !python {model: lunch.order.confirm}: | @@ -89,6 +92,8 @@ - !record {model: lunch.cashbox.clean, id: lunch_cashbox_clean_0}: {} +- + Now click on "Set to Zero" button of this wizard. - !python {model: lunch.cashbox.clean, id: lunch_cashbox_clean_0}: | self.set_to_zero(cr, uid, [ref('lunch_cashbox_clean_0')], {'active_ids': [ref('lunch_cashbox_cashbox0')]}) @@ -104,6 +109,9 @@ - !record {model: lunch.order.cancel, id: lunch_order_cancel_0}: {} +- | + I click on "Yes" button of this wizard for cancel order. + - !python {model: lunch.order.cancel}: | self.cancel(cr, uid, [ref('lunch_order_cancel_0')], {'active_ids': [ref('lunch_order_1')]}) From 68a59716361ac4cc018c97bf062fc7742de34e62 Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Thu, 22 Apr 2010 17:37:26 +0530 Subject: [PATCH 08/15] [IMP]: crm: Improvement in yaml test case bzr revid: atp@tinyerp.co.in-20100422120726-myalsad8nbaahdql --- addons/crm/test/test_crm_meeting.yml | 6 +++--- addons/crm/test/test_crm_opportunity.yml | 2 +- addons/crm/test/test_crm_phonecall.yml | 6 ++++-- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/addons/crm/test/test_crm_meeting.yml b/addons/crm/test/test_crm_meeting.yml index 55db5e84cc7..e231115c539 100644 --- a/addons/crm/test/test_crm_meeting.yml +++ b/addons/crm/test/test_crm_meeting.yml @@ -1,7 +1,7 @@ - | Now I will test Meetings which may be customer meeting or phonecall meeting or internal Meeting. -- +- | I start by creating a new Meeting. - !record {model: crm.meeting, id: crm_meeting_regardingpresentation0}: @@ -23,7 +23,7 @@ - state == "draft" - | I can set reminder on meeting if I put reminder "40 minutes before" -- +- | For that, I first create alarm. - !record {model: res.alarm, id: res_alarm_minituesbefore0}: @@ -51,7 +51,7 @@ - !python {model: crm.meeting}: | self.fields_view_get(cr, uid, False, 'calendar', context) -- +- | I will search for one of the recurrent event and count the number of meeting. - !python {model: crm.meeting}: | diff --git a/addons/crm/test/test_crm_opportunity.yml b/addons/crm/test/test_crm_opportunity.yml index 4fd0ddace95..d7118dd0c90 100644 --- a/addons/crm/test/test_crm_opportunity.yml +++ b/addons/crm/test/test_crm_opportunity.yml @@ -68,7 +68,7 @@ !python {model: crm.phonecall}: | ids = self.search(cr, uid, [('name', '=', 'ABC FUEL CO 829264 - 10002 units')]) assert len(ids) -- +- | I can see phonecall record after click on "Schedule call" wizard. - !record {model: crm.phonecall, id: crm_phonecall_abcfuelcounits0}: diff --git a/addons/crm/test/test_crm_phonecall.yml b/addons/crm/test/test_crm_phonecall.yml index 7e6ed56abc5..feb87e0a879 100644 --- a/addons/crm/test/test_crm_phonecall.yml +++ b/addons/crm/test/test_crm_phonecall.yml @@ -49,7 +49,7 @@ !python {model: crm.phonecall}: | self.action_make_meeting(cr, uid, [ref('crm_phonecall_interviewcall0')]) -- +- | I can see that Meeting's calendar view is shown. then I click on the date on which I want schedule meeting. I fill proper data for that meeting and save it @@ -69,7 +69,7 @@ - #This is not working for yaml -- +- | I can jump to this meeting by "Meetings" shortcut from my phonecall's form view - @@ -84,6 +84,8 @@ name: Interview call section_id: crm.section_sales_department user_id: base.user_root +- | + I click on "Schedule" button of this wizard. - !python {model: crm.phonecall2phonecall}: | self.action_apply(cr, uid, [ref('crm_phonecall2phonecall_interviewcall0')], {'active_id': ref('crm_phonecall_interviewcall0')}) From 7a0603d4a6604d0b95d18cf5d00bd94ed978f675 Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Thu, 22 Apr 2010 17:52:19 +0530 Subject: [PATCH 09/15] [IMP]: idea: Minor improvement remove "|" in yaml test case. bzr revid: atp@tinyerp.co.in-20100422122219-zg52iqccm4zxu6ks --- addons/idea/test/test_idea.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/idea/test/test_idea.yml b/addons/idea/test/test_idea.yml index 48e838e6570..b961bb5d921 100644 --- a/addons/idea/test/test_idea.yml +++ b/addons/idea/test/test_idea.yml @@ -65,7 +65,7 @@ To add other vote I connect as user2 and open the idea page I click on "Vote" wizard and vote the idea as "Very Good" -- | +- !record {model: idea.post.vote, id: idea_post_vote_1}: vote: 100 From c33fd4dd3de9bec46d9e0b04d54e1f39f149f30d Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Thu, 22 Apr 2010 18:03:44 +0530 Subject: [PATCH 10/15] [IMP]: Minor Improvement add one tag in meeting yaml test case. bzr revid: atp@tinyerp.co.in-20100422123344-wokzi9f7zjax326a --- addons/crm/test/test_crm_meeting.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/addons/crm/test/test_crm_meeting.yml b/addons/crm/test/test_crm_meeting.yml index e231115c539..6365c913b1f 100644 --- a/addons/crm/test/test_crm_meeting.yml +++ b/addons/crm/test/test_crm_meeting.yml @@ -85,7 +85,9 @@ If I set Send mail boolean as True I can see that an email is send to specified email address with proper meeting information. - - #this is not working for send mail boolean as True. + #This is not working for send mail boolean as True. +- + I click on "Invite" button of "Invite attendee" wizard. - !python {model: base_calendar.invite.attendee}: | self.do_invite(cr, uid, [ref('base_calendar_invite_attendee_0')], {'active_id': ref('crm_meeting_regardingpresentation0'), 'model' : 'crm.meeting', 'attendee_field':'attendee_ids'}) From cd3a5a7619e8f00940a732b4489e998da8fd0fab Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Thu, 22 Apr 2010 19:02:33 +0530 Subject: [PATCH 11/15] [IMP]: lunch: solve problem of assert tag in yaml test case. bzr revid: atp@tinyerp.co.in-20100422133233-tyvx5yz5m3xy3dnx --- addons/lunch/test/test_lunch.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/lunch/test/test_lunch.yml b/addons/lunch/test/test_lunch.yml index e44b90c4fa7..668579a6ee2 100644 --- a/addons/lunch/test/test_lunch.yml +++ b/addons/lunch/test/test_lunch.yml @@ -52,8 +52,8 @@ I check that the Cash Moves have been generated with the right box name - - # !assert {model: lunch.order, id: lunch_order_0}: - # - cashmove != False + !assert {model: lunch.order, id: lunch_order_0}: + - cashmove.id != False - | I check that the Total on the cashbox is -2.75 @@ -120,7 +120,7 @@ I test that the Cash Moves revord have been removed for the order LU002. - !assert {model: lunch.order, id: lunch_order_1}: - - cashmove == False + - cashmove.id == False - | I check that the Total on the cashbox is -2.75 From ec5512954dc8c38687229d608a3896681a34248f Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Fri, 23 Apr 2010 15:09:30 +0530 Subject: [PATCH 12/15] [IMP]: crm: Rename case section by sales team and add list of members (man2many field res.users). bzr revid: atp@tinyerp.co.in-20100423093930-skd91d2nwgy1qfk0 --- addons/crm/crm.py | 12 +++++++----- addons/crm/crm_view.xml | 18 ++++++++++-------- addons/crm/report/crm_report_view.xml | 2 +- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/addons/crm/crm.py b/addons/crm/crm.py index afcc2301883..c6ff5f99159 100644 --- a/addons/crm/crm.py +++ b/addons/crm/crm.py @@ -59,6 +59,7 @@ class crm_case_section(osv.osv): true, it will allow you to hide the sales team without removing it."), 'allow_unlink': fields.boolean('Allow Delete', help="Allows to delete non draft cases"), 'user_id': fields.many2one('res.users', 'Responsible User'), + 'member_ids':fields.many2many('res.users', 'sale_member_rel', 'section_id', 'member_id', 'Team Members'), 'reply_to': fields.char('Reply-To', size=64, help="The email address put \ in the 'Reply-To' of all emails sent by Open ERP about cases in this sales team"), 'parent_id': fields.many2one('crm.case.section', 'Parent Team'), @@ -66,6 +67,7 @@ class crm_case_section(osv.osv): 'resource_calendar_id': fields.many2one('resource.calendar', "Resource's Calendar"), 'server_id':fields.many2one('email.smtpclient', 'Server ID'), 'note': fields.text('Description'), + } _defaults = { @@ -79,14 +81,14 @@ class crm_case_section(osv.osv): def _check_recursion(self, cr, uid, ids): """ - Checks for recursion level for sections + Checks for recursion level for sales team @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, - @param ids: List of section ids + @param ids: List of Sales team ids """ level = 100 - + while len(ids): cr.execute('select distinct parent_id from crm_case_section where id =ANY(%s)', (ids,)) ids = filter(None, map(lambda x: x[0], cr.fetchall())) @@ -97,7 +99,7 @@ class crm_case_section(osv.osv): return True _constraints = [ - (_check_recursion, 'Error ! You cannot create recursive sections.', ['parent_id']) + (_check_recursion, 'Error ! You cannot create recursive Sales team.', ['parent_id']) ] def name_get(self, cr, uid, ids, context=None): @@ -105,7 +107,7 @@ class crm_case_section(osv.osv): @param self: The object pointer @param cr: the current row, from the database cursor, @param uid: the current user’s ID for security checks, - @param ids: List of section ids + @param ids: List of sales team ids """ if not context: context = {} diff --git a/addons/crm/crm_view.xml b/addons/crm/crm_view.xml index 0d4bb763556..5757ccc555d 100644 --- a/addons/crm/crm_view.xml +++ b/addons/crm/crm_view.xml @@ -11,7 +11,7 @@ crm.case.section form - + @@ -19,22 +19,24 @@ - - + + - + - - + + + + @@ -51,7 +53,7 @@ tree child_ids - + @@ -62,7 +64,7 @@ - Sections + Sales Team crm.case.section form diff --git a/addons/crm/report/crm_report_view.xml b/addons/crm/report/crm_report_view.xml index 3cd8b518b5d..5a72758514e 100644 --- a/addons/crm/report/crm_report_view.xml +++ b/addons/crm/report/crm_report_view.xml @@ -160,7 +160,7 @@ From be668996d3f8b5897c5590b0a155781db3767ea3 Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Fri, 23 Apr 2010 18:11:27 +0530 Subject: [PATCH 13/15] [IMP]: Idea: Minor improvement in comment of yaml file in idea module. bzr revid: atp@tinyerp.co.in-20100423124127-x97v61tnxtf93ieg --- addons/idea/test/test_idea.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/idea/test/test_idea.yml b/addons/idea/test/test_idea.yml index b961bb5d921..c1ee6deb80f 100644 --- a/addons/idea/test/test_idea.yml +++ b/addons/idea/test/test_idea.yml @@ -83,15 +83,15 @@ vote_avg: 75 - | - I put one comment "We can learn many things from technical presentation" for the idea + I put one comment "We can learn many things from technical presentation" for the idea. - !record {model: idea.idea, id: idea.idea_idea_0}: comment_ids: - content: We can learn many things from technical presentation idea_id: idea.idea_idea_0 - user_id: base.user_root + user_id: res_users_user1 - | - I close this idea by click on "Close" button. + I connect as Manager and close this idea by click on "Close" button. - !workflow {model: idea.idea, action: idea_close, ref: idea_idea_0} From 2db5f25f2a316b78ee84121d89d281c41d81c455 Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Fri, 23 Apr 2010 18:43:08 +0530 Subject: [PATCH 14/15] [IMP]: lunch: replace cashbox name with Employee cashbox in yaml file. bzr revid: atp@tinyerp.co.in-20100423131308-pb14m0jqejoegfs5 --- addons/lunch/test/test_lunch.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/addons/lunch/test/test_lunch.yml b/addons/lunch/test/test_lunch.yml index 668579a6ee2..97ed41b2abc 100644 --- a/addons/lunch/test/test_lunch.yml +++ b/addons/lunch/test/test_lunch.yml @@ -16,11 +16,11 @@ name: Club1 price: 2.75 - | - Given that I have a cashbox "Cashbox" + Given that I have a cashbox "Employee Cashbox" - !record {model: lunch.cashbox, id: lunch_cashbox_cashbox0}: manager: base.user_root - name: CashBox + name: Employee Cashbox - | I create a lunch order "LU001" for the "Club1" product - | @@ -56,7 +56,7 @@ - cashmove.id != False - | - I check that the Total on the cashbox is -2.75 + I check that the Total on the "Employee Cashbox" is -2.75 - !assert {model: lunch.cashbox, id: lunch_cashbox_cashbox0}: @@ -72,7 +72,7 @@ user_id: base.user_root - | - I confirm this order.open wizard and select cashbox. + I confirm this order.open wizard and select "Employee Cashbox". - !record {model: lunch.order.confirm, id: lunch_order_confirm_1}: confirm_cashbox: 'lunch_cashbox_cashbox0' @@ -83,12 +83,12 @@ self.confirm(cr, uid, [ref('lunch_order_confirm_1')], {'active_ids': [ref('lunch_order_1')]}) - | - I check that the Total on the cashbox is -5.50 + I check that the Total on the "Employee Cashbox" is -5.50 - !assert {model: lunch.cashbox, id: lunch_cashbox_cashbox0}: - sum_remain == -5.50 - | - I reset the cashbox to zero using the "Set CashBox to Zero" wizard. + I reset the "Employee Cashbox" to zero using the "Set CashBox to Zero" wizard. - !record {model: lunch.cashbox.clean, id: lunch_cashbox_clean_0}: {} @@ -99,7 +99,7 @@ self.set_to_zero(cr, uid, [ref('lunch_cashbox_clean_0')], {'active_ids': [ref('lunch_cashbox_cashbox0')]}) - | - I check that the Total on the cashbox is 0.0 + I check that the Total on the "Employee Cashbox" is 0.0 - !assert {model: lunch.cashbox, id: lunch_cashbox_cashbox0}: - sum_remain == 0.00 @@ -123,7 +123,7 @@ - cashmove.id == False - | - I check that the Total on the cashbox is -2.75 + I check that the Total on the "Employee Cashbox" is -2.75 - !assert {model: lunch.cashbox, id: lunch_cashbox_cashbox0}: - sum_remain == -2.75 From 66224c872fe8b644a2f85d4d2efe51695ce63508 Mon Sep 17 00:00:00 2001 From: "atp (Open ERP)" Date: Tue, 27 Apr 2010 12:33:53 +0530 Subject: [PATCH 15/15] [IMP]: crm: add yamlcode for convert to opportunity wizard in crm lead yaml test case. bzr revid: atp@tinyerp.co.in-20100427070353-0w3paur8jx2ng5y1 --- addons/crm/test/test_crm_lead.yml | 57 +++++++++++++++++++++++-------- 1 file changed, 42 insertions(+), 15 deletions(-) diff --git a/addons/crm/test/test_crm_lead.yml b/addons/crm/test/test_crm_lead.yml index f22adf72e82..22fdfffca1b 100644 --- a/addons/crm/test/test_crm_lead.yml +++ b/addons/crm/test/test_crm_lead.yml @@ -25,10 +25,11 @@ !record {model: crm.lead, id: crm_lead_newcustomer0}: email_from: info@mycustomer.com name: New Customer - partner_name: Stonage IT + partner_name: Sandip zala phone: (855) 924-4364 mobile: (333) 715-1450 section_id: crm.section_sales_department + referred: False title: M. - | I check that the lead is in 'draft' state, @@ -49,28 +50,54 @@ !python {model: crm.lead}: | lead = self.browse(cr, uid, ref('crm_lead_newcustomer0')) if not lead.partner_id: - self.convert_opportunity(cr, uid, [ref("crm_lead_newcustomer0")]) -- - #!act_window {target: new, res_model: crm.lead2opportunity, id: action_crm_lead2opportunity, name: Create Opportunity} + self.convert_opportunity(cr, uid, [ref("crm_lead_newcustomer0")], {'active_ids': [ref("crm_lead_newcustomer0")]}) +- + | + Now, select "create a new partner" option in this wizard. +- + !record {model: crm.lead2opportunity.partner, id: crm_lead2opportunity_partner_create_0}: + action: 'create' +- + I click on "Continue" button of this wizard. +- + !python {model: crm.lead2opportunity.partner}: | + self.make_partner(cr, uid, [ref("crm_lead2opportunity_partner_create_0")], {'active_ids': [ref("crm_lead_newcustomer0")]}) +- + Now, I give value to this wizard field. +- + !record {model: crm.lead2opportunity, id: crm_lead2opportunity_stonage_0}: + name: Sandip zala + planned_revenue: 0.00 + probability: 0.00 +- + Then, Click on "Create Opportunity" button of this wizard. +- + !python {model: crm.lead2opportunity}: | + self.action_apply(cr, uid, [ref('crm_lead2opportunity_stonage_0')], {'active_id': ref('crm_lead_newcustomer0')}) + - | I can check that a lead and a business opportunity is now assigned to this lead. +- + # !python {model: crm.lead, id: crm_lead_newcustomer0}: + # - opportunity_id.id != False + - | I check that the partner associated to this lead as the same country, phone number and name than the opportunity. -- - #Remaining - + !python {model: crm.lead}: | + lead = self.browse(cr, uid, ref("crm_lead_newcustomer0")) + print "lead", lead.partner_name + obj_opportunity = self.pool.get('crm.opportunity') + ids = obj_opportunity.search(cr, uid, [('name', '=', lead.partner_name)]) + opportunity = obj_opportunity.browse(cr, uid, ids)[0] + assert lead.partner_name == opportunity.partner_id.name + assert lead.phone == opportunity.phone +- + | + # yaml is also not working smpt server and send new email. -# !python {model: crm.lead}: | -# lead = self.browse(cr, uid, ref("crm_lead_newcustomer0")) -# print "lead", lead.partner_name -# obj_opportunity = self.pool.get('crm.opportunity') -# ids = obj_opportunity.search(cr, uid, [('name', '=', lead.partner_name)]) -# opportunity = obj_opportunity.browse(cr, uid, ids)[0] -# assert lead.partner_name == opportunity.partner_id.name -# assert lead.phone == opportunity.phone - - | I configure with smtp server. - |