From 614477f6e92ed35b379b46a74395737b46cd7236 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Mon, 18 Jul 2011 19:11:25 +0530 Subject: [PATCH 01/31] [AAD]purchase_double_validation: add yml for purchase_double_validation_installer.py bzr revid: aag@tinyerp.com-20110718134125-cimkcz05krvlxrfy --- .../purchase_double_validation/__openerp__.py | 1 + .../test/purchase_double_validation_test.yml | 117 ++++++++++++++++++ 2 files changed, 118 insertions(+) create mode 100755 addons/purchase_double_validation/test/purchase_double_validation_test.yml diff --git a/addons/purchase_double_validation/__openerp__.py b/addons/purchase_double_validation/__openerp__.py index 1a10fb5c0ce..803b48a59c0 100644 --- a/addons/purchase_double_validation/__openerp__.py +++ b/addons/purchase_double_validation/__openerp__.py @@ -39,6 +39,7 @@ that exceeds minimum amount set by configuration wizard. 'purchase_double_validation_workflow.xml', 'purchase_double_validation_installer.xml' ], + 'test': ['test/purchase_double_validation_test.yml'], 'demo_xml': [], 'installable': True, 'active': False, diff --git a/addons/purchase_double_validation/test/purchase_double_validation_test.yml b/addons/purchase_double_validation/test/purchase_double_validation_test.yml new file mode 100755 index 00000000000..ecc8d08a493 --- /dev/null +++ b/addons/purchase_double_validation/test/purchase_double_validation_test.yml @@ -0,0 +1,117 @@ +- + I Create new limit amount from Configure Limit Amount for Purchase wizard. +- + !record {model: purchase.double.validation.installer, id: purchase_double_validation_installer_1}: + limit_amount: 3000 +- + Then I set the Limit Amount +- + !python {model: purchase.double.validation.installer}: | + self.execute(cr, uid, [ref("purchase_double_validation_installer_1")]) +- + In order to test the purchase double validation flow,I start by creating a new product 'MOB1' +- + !record {model: product.product, id: product_product_mob1}: + categ_id: 'product.product_category_3' + cost_method: standard + mes_type: fixed + name: MOB1 + price_margin: 2.0 + procure_method: make_to_stock + property_stock_inventory: stock.location_inventory + property_stock_procurement: stock.location_procurement + property_stock_production: stock.location_production + seller_delay: '1' + standard_price: 2000.0 + supply_method: buy + type: product + uom_id: product.product_uom_unit + uom_po_id: product.product_uom_unit + volume: 0.0 + warranty: 0.0 + weight: 0.0 + weight_net: 0.0 +- + In order to test the purchase double validation flow,I create a new record where "invoice_method" is From Order. +- + Test for purchase double validation in which Total > = Limit Amount. +- + I create purchase order for MOB1 for 3 quantity. +- + !record {model: purchase.order, id: purchase_order_po11}: + company_id: base.main_company + date_order: '2011-01-1' + invoice_method: order + location_id: stock.stock_location_stock + order_line: + - date_planned: '2011-01-11' + name: MOB1 + price_unit: 2000.0 + product_id: 'product_product_mob1' + product_qty: 3.0 + product_uom: product.product_uom_unit + state: draft + partner_address_id: base.res_partner_address_7 + partner_id: base.res_partner_4 + pricelist_id: purchase.list0 +- + Initially purchase order is in the draft state. +- + !assert {model: purchase.order, id: purchase_order_po11}: + - state == 'draft' +- + I confirm the purchase order for MOB1. +- + !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po11} +- + I check that the order which was initially in the draft state has transmit to confirm state for double validation. +- + !assert {model: purchase.order, id: purchase_order_po11}: + - state == 'confirmed' +- + I Approved purchase order by Supplier for MOB1. +- + !workflow {model: purchase.order, action: purchase_approve, ref: purchase_order_po11} +- + I check that the order which was initially in the confirmed state has transmit to approved state. +- + !assert {model: purchase.order, id: purchase_order_po11}: + - state == 'approved' +- + Test for purchase double validation in which Total < Limit Amount. +- + I create purchase order for MOB1 for 1 quantity. +- + !record {model: purchase.order, id: purchase_order_po12}: + company_id: base.main_company + date_order: '2011-01-02' + invoice_method: order + location_id: stock.stock_location_stock + order_line: + - date_planned: '2011-01-12' + name: MOB1 + price_unit: 2000.0 + product_id: 'product_product_mob1' + product_qty: 1.0 + product_uom: product.product_uom_unit + state: draft + partner_address_id: base.res_partner_address_7 + partner_id: base.res_partner_4 + pricelist_id: purchase.list0 +- + Initially purchase order is in the draft state. +- + !assert {model: purchase.order, id: purchase_order_po12}: + - state == 'draft' +- + I confirm the purchase order for MOB1. +- + !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po12} +- + I check that the order which was initially in the draft state has transmit to approved state. +- + !assert {model: purchase.order, id: purchase_order_po12}: + - state == 'approved' + + + \ No newline at end of file From 3e29dbf440d5d70a00391f441683a532122e370e Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Tue, 19 Jul 2011 11:15:33 +0530 Subject: [PATCH 02/31] [AAD]purchase_requisition: add yml purchase_requisition_test.yml for cover more functionality of module bzr revid: aag@tinyerp.com-20110719054533-64qd1znwp3opsqc2 --- addons/purchase_requisition/__openerp__.py | 4 +- .../test/purchase_requisition_test.yml | 174 ++++++++++++++++++ 2 files changed, 177 insertions(+), 1 deletion(-) create mode 100755 addons/purchase_requisition/test/purchase_requisition_test.yml diff --git a/addons/purchase_requisition/__openerp__.py b/addons/purchase_requisition/__openerp__.py index 5fd224b14f9..7e15c585803 100644 --- a/addons/purchase_requisition/__openerp__.py +++ b/addons/purchase_requisition/__openerp__.py @@ -42,7 +42,9 @@ This new object will regroup and will allow you to easily keep track and order a "security/ir.model.access.csv","purchase_requisition_sequence.xml" ], "active": False, - "test":['test/purchase_requisition_report.yml'], + "test":['test/purchase_requisition_report.yml', + 'test/purchase_requisition_test.yml', + ], "installable": True, "certificate" : "001023264099823179629", } diff --git a/addons/purchase_requisition/test/purchase_requisition_test.yml b/addons/purchase_requisition/test/purchase_requisition_test.yml new file mode 100755 index 00000000000..3cc0a4bb065 --- /dev/null +++ b/addons/purchase_requisition/test/purchase_requisition_test.yml @@ -0,0 +1,174 @@ +- + In order to test the purchase requisition flow,I start by creating a new product 'MOB1' +- + !record {model: product.product, id: product_product_mob1}: + name: MOB1 + categ_id: product.product_category_3 + cost_method: standard + mes_type: fixed + price_margin: 2.0 + procure_method: make_to_stock + property_stock_inventory: stock.location_inventory + property_stock_procurement: stock.location_procurement + property_stock_production: stock.location_production + seller_delay: '1' + standard_price: 2000.0 + supply_method: buy + type: product + uom_id: product.product_uom_unit + uom_po_id: product.product_uom_unit + volume: 0.0 + warranty: 0.0 + weight: 0.0 + weight_net: 0.0 +- + I create purchase requisition for MOB1 for 1 quantity. +- + !record {model: purchase.requisition, id: purchase_requisition_te0}: + company_id: base.main_company + exclusive: multiple + line_ids: + - company_id: base.main_company + product_id: product_product_mob1 + product_qty: 10.0 + product_uom_id: product.product_uom_unit + name: TE00009 +- + Initially purchase requisition is in draft state. +- + !assert {model: purchase.requisition, id: purchase_requisition_te0}: + - state == 'draft' +- + I confirm the purchase requisition for MOB1. +- + !python {model: purchase.requisition}: | + self.tender_in_progress(cr, uid, [ref("purchase_requisition_te0")]) +- + I check that the purchase requisition which was initially in the draft state has transmit to In Progress after confirm it. +- + !assert {model: purchase.requisition, id: purchase_requisition_te0}: + - state == 'in_progress' +- + I Create a Purchase Order for the supplier 'Axelor'. +- + !record {model: purchase.requisition.partner, id: purchase_requisition_partner_0}: + partner_address_id: base.res_partner_address_7 + partner_id: base.res_partner_desertic_hispafuentes +- + I create Quotations For supplier 'Axelor'. +- + !python {model: purchase.requisition.partner}: | + self.create_order(cr, uid, [ref("purchase_requisition_partner_0")], {"active_model": "purchase.requisition", + "active_ids": [ref("purchase_requisition_te0")],"active_id": ref("purchase_requisition_te0"), }) +- + I confirm the purchase order of Axelor. +- + !python {model: purchase.order}: | + req_obj = self.pool.get('purchase.requisition') + ids =req_obj.search(cr, uid, [('name','=','TE00009')]) + purchase_id= self.search(cr, uid, [('requisition_id','in',ids)]) + import netsvc + wf_service = netsvc.LocalService("workflow") + if purchase_id: + wf_service.trg_validate(uid, 'purchase.order',purchase_id[0],'purchase_confirm', cr) + wf_service.trg_validate(uid, 'purchase.order',purchase_id[0],'purchase_approve', cr) +- + I check that Quotation of Axelor is Approved. +- + !python {model: purchase.order}: | + req_obj = self.pool.get('purchase.requisition') + ids =req_obj.search(cr, uid,[('name','=','TE00009')]) + purchase_id= self.search(cr, uid, [('requisition_id','in',ids)])[0] + state=self.browse(cr,uid,purchase_id).state + assert (state=='approved') +- + I click on Done button +- + !python {model: purchase.requisition}: | + self.tender_done(cr, uid, [ref("purchase_requisition_te0")],) +- + I check that after click on Done button state is in done. +- + !assert {model: purchase.requisition, id: purchase_requisition_te0}: + - state == 'done' +- + In order to test the purchase requisition flow for Requisition Type is exclusive +- + I create purchase requisition for Requisition Type is exclusive +- + !record {model: purchase.requisition, id: purchase_requisition_ex1}: + company_id: base.main_company + exclusive: exclusive + line_ids: + - company_id: base.main_company + product_id: product_product_mob1 + product_qty: 10.0 + product_uom_id: product.product_uom_unit + name: TE000010 +- + I Create a First Purchase Order for the supplier 'DistriPC'. +- + !record {model: purchase.requisition.partner, id: purchase_requisition_partner_1}: + partner_address_id: base.res_partner_address_7 + partner_id: base.res_partner_4 +- + I create Quotations For supplier 'DistriPC'. +- + !python {model: purchase.requisition.partner}: | + self.create_order(cr, uid, [ref("purchase_requisition_partner_1")], {"active_model": "purchase.requisition", + "active_ids": [ref("purchase_requisition_ex1")],"active_id": ref("purchase_requisition_ex1"), }) +- + I Create a Second Purchase Order for the supplier ASUStek. +- + !record {model: purchase.requisition.partner, id: purchase_requisition_partner_2}: + partner_address_id: base.res_partner_address_7 + partner_id: base.res_partner_asus +- + I create Quotations For supplier 'ASUStek'. +- + !python {model: purchase.requisition.partner}: | + self.create_order(cr, uid, [ref("purchase_requisition_partner_2")], {"active_model": "purchase.requisition", + "active_ids": [ref("purchase_requisition_ex1")],"active_id": ref("purchase_requisition_ex1"), }) +- + I check that Initially purchase requisition is draft state. +- + !assert {model: purchase.requisition, id: purchase_requisition_ex1}: + - state == 'draft' +- + I confirm the Second purchase order of ASUStek. +- + !python {model: purchase.order}: | + partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','ASUStek')])[0] + req_obj = self.pool.get('purchase.requisition') + ids =req_obj.search(cr, uid, [('name','=','TE000010')]) + purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','in',ids)]) + import netsvc + wf_service = netsvc.LocalService("workflow") + if purchase_id: + wf_service.trg_validate(uid, 'purchase.order',purchase_id[0],'purchase_confirm', cr) + wf_service.trg_validate(uid, 'purchase.order',purchase_id[0],'purchase_approve', cr) +- + I check that Quotation of ASUStek is Approved. +- + !python {model: purchase.order}: | + partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','ASUStek')])[0] + req_obj = self.pool.get('purchase.requisition') + ids =req_obj.search(cr, uid,[('name','=','TE000010')]) + purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','in',ids)])[0] + state=self.browse(cr,uid,purchase_id).state + assert (state=='approved') +- + I check that Quotation of DistriPC is cancelled. +- + !python {model: purchase.order}: | + partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','Distrib PC')])[0] + req_obj = self.pool.get('purchase.requisition') + ids =req_obj.search(cr, uid,[('name','=','TE000010')]) + purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','in',ids)])[0] + state=self.browse(cr,uid,purchase_id).state + assert (state=='cancel') +- + I check that Purchase Requisition is Done. +- + !assert {model: purchase.requisition, id: purchase_requisition_ex1}: + - state == 'done' \ No newline at end of file From 6dc6b8dddc246c05afc4254bfcdde8a68bc0415e Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 21 Jul 2011 17:28:17 +0530 Subject: [PATCH 03/31] [AAD]purchase: add yml purchase_order_merge.yml for cover more functionality of merging PO bzr revid: aag@tinyerp.com-20110721115817-io4fomevc9v8egwk --- addons/purchase/__openerp__.py | 1 + addons/purchase/test/purchase_order_merge.yml | 85 +++++++++++++++++++ 2 files changed, 86 insertions(+) create mode 100644 addons/purchase/test/purchase_order_merge.yml diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py index 1fb49198404..d52c84ceedf 100644 --- a/addons/purchase/__openerp__.py +++ b/addons/purchase/__openerp__.py @@ -65,6 +65,7 @@ Dashboard for purchase management that includes: 'purchase_unit_test.xml', 'test/procurement_buy.yml', 'test/purchase_report.yml', + 'test/purchase_order_merge.yml' ], 'demo': ['purchase_demo.xml'], 'installable': True, diff --git a/addons/purchase/test/purchase_order_merge.yml b/addons/purchase/test/purchase_order_merge.yml new file mode 100644 index 00000000000..fab75f63037 --- /dev/null +++ b/addons/purchase/test/purchase_order_merge.yml @@ -0,0 +1,85 @@ +- + In order to test to merge two purchase order,I start by creating a new product 'Nokia3110c' +- + !record {model: product.product, id: product_product_nokia3110c}: + categ_id: 'product.product_category_3' + cost_method: standard + mes_type: fixed + name: NOKIA 3110c + price_margin: 1.0 + procure_method: make_to_order + property_stock_inventory: stock.location_inventory + property_stock_procurement: stock.location_procurement + property_stock_production: stock.location_production + seller_delay: '1' + standard_price: 5000.0 + supply_method: buy + type: product + uom_id: product.product_uom_unit + uom_po_id: product.product_uom_unit + volume: 0.0 + warranty: 0.0 + weight: 0.0 + weight_net: 0.0 +- + In order to test the merge purchase order flow,I create a new record where "invoice_method" is From Order. +- + I create first purchase order for Nokia3110c. +- + !record {model: purchase.order, id: purchase_order_po_nokia1}: + company_id: base.main_company + date_order: !eval time.strftime('%Y-%m-%d') + invoice_method: order + location_id: stock.stock_location_stock + order_line: + - date_planned: !eval time.strftime('%Y-%m-%d') + name: NOKIA 3110c + price_unit: 100.0 + product_id: 'product_product_nokia3110c' + product_qty: 10.0 + product_uom: product.product_uom_unit + state: draft + partner_address_id: base.res_partner_address_7 + partner_id: base.res_partner_4 + pricelist_id: purchase.list0 +- + Initially first purchase order is in the draft state. +- + !assert {model: purchase.order, id: purchase_order_po_nokia1}: + - state == 'draft' +- + I create second purchase order for Nokia3110c with same supplier,have same stock location, same pricelist as First Purchase order of Nokia3110. +- + !record {model: purchase.order, id: purchase_order_po_nokia2}: + company_id: base.main_company + date_order: !eval time.strftime('%Y-%m-%d') + invoice_method: order + location_id: stock.stock_location_stock + order_line: + - date_planned: !eval time.strftime('%Y-%m-%d') + name: NOKIA 3110c + price_unit: 100.0 + product_id: 'product_product_nokia3110c' + product_qty: 20.0 + product_uom: product.product_uom_unit + state: draft + partner_address_id: base.res_partner_address_7 + partner_id: base.res_partner_4 + pricelist_id: purchase.list0 +- + Initially second purchase order is in the draft state. +- + !assert {model: purchase.order, id: purchase_order_po_nokia2}: + - state == 'draft' +- + I have merged first and second purchase order which are in draft state, belong to the same supplier,have same stock location, same pricelist. +- + !python {model: purchase.order.group}: | + pur_obj=self.pool.get('purchase.order') + pur_id11=pur_obj.browse(cr, uid, ref("purchase_order_po_nokia1")) + pur_id1=pur_id11.id + pur_id22=pur_obj.browse(cr, uid, ref("purchase_order_po_nokia2")) + pur_id2=pur_id22.id + ids = [pur_id1,pur_id2] + self.fields_view_get(cr, uid, context={'active_ids': ids}) + self.merge_orders(cr, uid, [1], context={'active_ids': ids}) From 5b9d4e1c76cd7f48ca29c80563f883490c422191 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 28 Jul 2011 15:10:42 +0530 Subject: [PATCH 04/31] [IMP]purchase: Change Expected Date in Purchase order . bzr revid: aag@tinyerp.com-20110728094042-8k06xmajr9xp1w5x --- addons/purchase/test/purchase_from_order.yml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/addons/purchase/test/purchase_from_order.yml b/addons/purchase/test/purchase_from_order.yml index 3acc68cb51b..cb2fe88f841 100644 --- a/addons/purchase/test/purchase_from_order.yml +++ b/addons/purchase/test/purchase_from_order.yml @@ -51,6 +51,17 @@ I confirm the purchase order for iPod. - !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po0} +- + I changed Expected Date to Next Day. +- + !python {model: purchase.order}: | + from tools.translate import _ + import time + from datetime import datetime + from dateutil.relativedelta import relativedelta + next_day = datetime.today() + relativedelta(days=1) + purod_id=self.browse(cr, uid, ref("purchase_order_po0")) + self._set_minimum_planned_date(cr, uid, purod_id.id, 'minimum_planned_date', next_day.strftime('%Y-%m-%d'),None ) - I check that the order which was initially in the draft state has transit to confirm state. - From 9f104b52e3dc16400b2f0ec7d25a1ec9e03e0d30 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 28 Jul 2011 18:38:00 +0530 Subject: [PATCH 05/31] [ADD]purchase: Add yml for Purchase Order cancel from Aproved state. bzr revid: aag@tinyerp.com-20110728130800-ti3360jmmncbg8jh --- addons/purchase/__openerp__.py | 5 +- .../test/purchase_order_cancel_draft.yml | 94 +++++++++++++++++++ 2 files changed, 97 insertions(+), 2 deletions(-) create mode 100644 addons/purchase/test/purchase_order_cancel_draft.yml diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py index d52c84ceedf..827d2a4971e 100644 --- a/addons/purchase/__openerp__.py +++ b/addons/purchase/__openerp__.py @@ -65,8 +65,9 @@ Dashboard for purchase management that includes: 'purchase_unit_test.xml', 'test/procurement_buy.yml', 'test/purchase_report.yml', - 'test/purchase_order_merge.yml' - ], + 'test/purchase_order_merge.yml', + 'test/purchase_order_cancel_draft.yml' + ], 'demo': ['purchase_demo.xml'], 'installable': True, 'active': False, diff --git a/addons/purchase/test/purchase_order_cancel_draft.yml b/addons/purchase/test/purchase_order_cancel_draft.yml new file mode 100644 index 00000000000..b1c8b6ef938 --- /dev/null +++ b/addons/purchase/test/purchase_order_cancel_draft.yml @@ -0,0 +1,94 @@ +- + In order to test to Cancel purchase order from Approved State,I start by creating a new product 'Pen Drive1' +- + !record {model: product.product, id: product_product_pendrive1}: + categ_id: 'product.product_category_3' + cost_method: standard + mes_type: fixed + name: Pen Drive + price_margin: 1.0 + procure_method: make_to_order + property_stock_inventory: stock.location_inventory + property_stock_procurement: stock.location_procurement + property_stock_production: stock.location_production + seller_delay: '1' + standard_price: 500.0 + supply_method: buy + type: product + uom_id: product.product_uom_unit + uom_po_id: product.product_uom_unit + volume: 0.0 + warranty: 0.0 + weight: 0.0 + weight_net: 0.0 +- + In order to test the purchase order flow,I create a new record where "invoice_method" is From Order. +- + I create first purchase order for Pen Drive1. +- + !record {model: purchase.order, id: purchase_order_pendrive1}: + company_id: base.main_company + date_order: !eval time.strftime('%Y-%m-%d') + invoice_method: order + location_id: stock.stock_location_stock + order_line: + - date_planned: !eval time.strftime('%Y-%m-%d') + name: Pen Drive + price_unit: 100.0 + product_id: 'product_product_pendrive1' + product_qty: 10.0 + product_uom: product.product_uom_unit + state: draft + partner_address_id: base.res_partner_address_7 + partner_id: base.res_partner_4 + pricelist_id: purchase.list0 +- + Initially purchase order is in the draft state. +- + !assert {model: purchase.order, id: purchase_order_pendrive1}: + - state == 'draft' +- + I confirm the purchase order for Pen Drive1. +- + !workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_pendrive1} +- + I check that the order which was initially in the draft state has transmit to confirm state. +- + !assert {model: purchase.order, id: purchase_order_pendrive1}: + - state == 'approved' +- + I have to first cancel Picking of Approved Perchase order . +- + !python {model: stock.picking}: | + from tools.translate import _ + pur_ord=self.pool.get( 'purchase.order') + name = pur_ord.browse(cr, uid, ref("purchase_order_pendrive1")).name + search_ids=self.search(cr, uid, [('origin', '=', name) ]) + self.action_cancel(cr, uid, search_ids) +- + Now I have to cancel confirm purchase order for Pen Drive1. +- + !python {model: purchase.order}: | + from tools.translate import _ + ids = [] + ids.append(ref("purchase_order_pendrive1")) + self.action_cancel(cr, uid, ids) +- + I check that the order which was in approved state has transmit to cancel state. +- + !assert {model: purchase.order, id: purchase_order_pendrive1}: + - state == 'cancel' +- + Now again set purchase order for Pen Drive1 to draft state. +- + !python {model: purchase.order}: | + from tools.translate import _ + ids = [] + ids.append(ref("purchase_order_pendrive1")) + self.action_cancel_draft(cr, uid, ids) +- + I check that the order which was in cancel state has transmit to draft state. +- + !assert {model: purchase.order, id: purchase_order_pendrive1}: + - state == 'draft' + \ No newline at end of file From 30c2c2e997f4f716b7e154adcc420b31eb9d8e1c Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Fri, 29 Jul 2011 16:15:40 +0530 Subject: [PATCH 06/31] [IMP]purchase: Add Functionality to test onchange Warehouse id , product_id, uom_id bzr revid: aag@tinyerp.com-20110729104540-9a2pvv34rw1rm8yk --- .../test/purchase_order_cancel_draft.yml | 44 +++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/addons/purchase/test/purchase_order_cancel_draft.yml b/addons/purchase/test/purchase_order_cancel_draft.yml index b1c8b6ef938..ad8eb1d3508 100644 --- a/addons/purchase/test/purchase_order_cancel_draft.yml +++ b/addons/purchase/test/purchase_order_cancel_draft.yml @@ -21,6 +21,29 @@ warranty: 0.0 weight: 0.0 weight_net: 0.0 +- + Create second new product 'Pen Drive2' +- + !record {model: product.product, id: product_product_pendrive2}: + categ_id: 'product.product_category_3' + cost_method: standard + mes_type: fixed + name: Pen Drive 2 + price_margin: 1.0 + procure_method: make_to_order + property_stock_inventory: stock.location_inventory + property_stock_procurement: stock.location_procurement + property_stock_production: stock.location_production + seller_delay: '1' + standard_price: 500.0 + supply_method: buy + type: product + uom_id: product.product_uom_unit + uom_po_id: product.product_uom_unit + volume: 0.0 + warranty: 0.0 + weight: 0.0 + weight_net: 0.0 - In order to test the purchase order flow,I create a new record where "invoice_method" is From Order. - @@ -47,6 +70,27 @@ - !assert {model: purchase.order, id: purchase_order_pendrive1}: - state == 'draft' +- + I test onchanged on Wharehouse ,Product , Uom . +- + !python {model: purchase.order}: | + from tools.translate import _ + ids = [] + ids.append(ref("purchase_order_pendrive1")) + self.onchange_warehouse_id(cr, uid, ids , 1) + part_obj = self.pool.get('res.partner') + price_obj = self.pool.get('product.pricelist') + product_obj = self.pool.get('product.product') + addrss_obj = self.pool.get('res.partner.address') + po_line_obj = self.pool.get('purchase.order.line') + uom_obj = self.pool.get('product.uom') + price_id = price_obj.search(cr, uid, [('name','=','Default Purchase Pricelist')]) + product_id = product_obj.search(cr, uid, [('name','=','Pen Drive 2')]) + uom_id = uom_obj.search(cr, uid, [('name','=','PCE')]) + part_ids = part_obj.search(cr, uid, [('name','=','Distrib PC')]) + line_id = po_line_obj.search(cr, uid, [('order_id','=',ids[0])]) + po_line_obj.product_id_change(cr, uid, line_id[0], price_id[0], product_id[0], 10, uom_id[0], part_ids[0]) + po_line_obj.product_uom_change(cr, uid, line_id[0], price_id[0], product_id[0], 10, uom_id[0], part_ids[0]) - I confirm the purchase order for Pen Drive1. - From e34cb5bc84d3cef25a1544e93ff1a1a59caebea4 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Fri, 29 Jul 2011 16:36:41 +0530 Subject: [PATCH 07/31] [IMP]purchase: Add Functionality to test onchange Destination Address and Unlink PO bzr revid: aag@tinyerp.com-20110729110641-g37tzvesaidhy2uq --- addons/purchase/test/purchase_order_cancel_draft.yml | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/addons/purchase/test/purchase_order_cancel_draft.yml b/addons/purchase/test/purchase_order_cancel_draft.yml index ad8eb1d3508..0bae780348c 100644 --- a/addons/purchase/test/purchase_order_cancel_draft.yml +++ b/addons/purchase/test/purchase_order_cancel_draft.yml @@ -71,7 +71,7 @@ !assert {model: purchase.order, id: purchase_order_pendrive1}: - state == 'draft' - - I test onchanged on Wharehouse ,Product , Uom . + I test onchanged on Wharehouse ,Product, Uom, Destination Address . - !python {model: purchase.order}: | from tools.translate import _ @@ -91,6 +91,8 @@ line_id = po_line_obj.search(cr, uid, [('order_id','=',ids[0])]) po_line_obj.product_id_change(cr, uid, line_id[0], price_id[0], product_id[0], 10, uom_id[0], part_ids[0]) po_line_obj.product_uom_change(cr, uid, line_id[0], price_id[0], product_id[0], 10, uom_id[0], part_ids[0]) + address_id = addrss_obj.search(cr, uid, [('partner_id','=',part_ids)]) + self.onchange_dest_address_id(cr, uid, ids, address_id[0]) - I confirm the purchase order for Pen Drive1. - @@ -135,4 +137,12 @@ - !assert {model: purchase.order, id: purchase_order_pendrive1}: - state == 'draft' +- + I test for Delete Perchase order in Draft state. +- + !python {model: purchase.order}: | + from tools.translate import _ + ids = [] + ids.append(ref("purchase_order_pendrive1")) + self.unlink(cr, uid, ids) \ No newline at end of file From 4564c11b9948439ec4ce502c6378aaa07bfb6160 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Fri, 29 Jul 2011 17:00:46 +0530 Subject: [PATCH 08/31] [IMP]purchase: Add Functionality to test copy Purchase order bzr revid: aag@tinyerp.com-20110729113046-s9gcm17noc4snu9y --- addons/purchase/test/purchase_order_cancel_draft.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/addons/purchase/test/purchase_order_cancel_draft.yml b/addons/purchase/test/purchase_order_cancel_draft.yml index 0bae780348c..662467b8bfb 100644 --- a/addons/purchase/test/purchase_order_cancel_draft.yml +++ b/addons/purchase/test/purchase_order_cancel_draft.yml @@ -138,11 +138,12 @@ !assert {model: purchase.order, id: purchase_order_pendrive1}: - state == 'draft' - - I test for Delete Perchase order in Draft state. + I test for Copy and Delete Perchase order in Draft state. - !python {model: purchase.order}: | from tools.translate import _ ids = [] ids.append(ref("purchase_order_pendrive1")) + self.copy(cr, uid, ids[0]) self.unlink(cr, uid, ids) \ No newline at end of file From abb387c4cf74991ec79ff3b565b5369e8fac9503 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Fri, 12 Aug 2011 16:39:12 +0530 Subject: [PATCH 09/31] [IMP] Purchase: Optimize Purcase Code for merging PO bzr revid: aag@tinyerp.com-20110812110912-7iqg5lu5s3xw183f --- addons/purchase/test/purchase_order_merge.yml | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/addons/purchase/test/purchase_order_merge.yml b/addons/purchase/test/purchase_order_merge.yml index fab75f63037..61555806d88 100644 --- a/addons/purchase/test/purchase_order_merge.yml +++ b/addons/purchase/test/purchase_order_merge.yml @@ -75,11 +75,6 @@ I have merged first and second purchase order which are in draft state, belong to the same supplier,have same stock location, same pricelist. - !python {model: purchase.order.group}: | - pur_obj=self.pool.get('purchase.order') - pur_id11=pur_obj.browse(cr, uid, ref("purchase_order_po_nokia1")) - pur_id1=pur_id11.id - pur_id22=pur_obj.browse(cr, uid, ref("purchase_order_po_nokia2")) - pur_id2=pur_id22.id - ids = [pur_id1,pur_id2] + ids = [ref("purchase_order_po_nokia1"),ref("purchase_order_po_nokia2")] self.fields_view_get(cr, uid, context={'active_ids': ids}) self.merge_orders(cr, uid, [1], context={'active_ids': ids}) From cbb1d53ac8178f5211da46e6b91fcc2adbcf8083 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Fri, 12 Aug 2011 16:44:24 +0530 Subject: [PATCH 10/31] [IMP] Purchase: Optimize Purcase Code for From Order yml bzr revid: aag@tinyerp.com-20110812111424-37eumzycikt8jdk8 --- addons/purchase/test/purchase_from_order.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/purchase/test/purchase_from_order.yml b/addons/purchase/test/purchase_from_order.yml index cb2fe88f841..4e72079b3be 100644 --- a/addons/purchase/test/purchase_from_order.yml +++ b/addons/purchase/test/purchase_from_order.yml @@ -60,8 +60,7 @@ from datetime import datetime from dateutil.relativedelta import relativedelta next_day = datetime.today() + relativedelta(days=1) - purod_id=self.browse(cr, uid, ref("purchase_order_po0")) - self._set_minimum_planned_date(cr, uid, purod_id.id, 'minimum_planned_date', next_day.strftime('%Y-%m-%d'),None ) + self._set_minimum_planned_date(cr, uid, ref("purchase_order_po0"), 'minimum_planned_date', next_day.strftime('%Y-%m-%d'),None ) - I check that the order which was initially in the draft state has transit to confirm state. - From 9013acbe9033d3ae2c86caa43c20f494431a68a4 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Fri, 12 Aug 2011 17:00:22 +0530 Subject: [PATCH 11/31] [IMP] Purchase: Optimize purchase_order_cancel_draft yml bzr revid: aag@tinyerp.com-20110812113022-9bvodza62zjt1j6d --- .../purchase/test/purchase_order_cancel_draft.yml | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/addons/purchase/test/purchase_order_cancel_draft.yml b/addons/purchase/test/purchase_order_cancel_draft.yml index 662467b8bfb..6065e34994f 100644 --- a/addons/purchase/test/purchase_order_cancel_draft.yml +++ b/addons/purchase/test/purchase_order_cancel_draft.yml @@ -116,9 +116,7 @@ - !python {model: purchase.order}: | from tools.translate import _ - ids = [] - ids.append(ref("purchase_order_pendrive1")) - self.action_cancel(cr, uid, ids) + self.action_cancel(cr, uid, [ref("purchase_order_pendrive1")]) - I check that the order which was in approved state has transmit to cancel state. - @@ -129,9 +127,7 @@ - !python {model: purchase.order}: | from tools.translate import _ - ids = [] - ids.append(ref("purchase_order_pendrive1")) - self.action_cancel_draft(cr, uid, ids) + self.action_cancel_draft(cr, uid, [ref("purchase_order_pendrive1")]) - I check that the order which was in cancel state has transmit to draft state. - @@ -142,8 +138,6 @@ - !python {model: purchase.order}: | from tools.translate import _ - ids = [] - ids.append(ref("purchase_order_pendrive1")) - self.copy(cr, uid, ids[0]) - self.unlink(cr, uid, ids) + self.copy(cr, uid, ref("purchase_order_pendrive1")) + self.unlink(cr, uid, [ref("purchase_order_pendrive1")]) \ No newline at end of file From 9e5c84fd2ae393a5d68d7e9bf74c1bcd8c649fbc Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Fri, 12 Aug 2011 17:14:12 +0530 Subject: [PATCH 12/31] [IMP] Purchase: Optimize purchase_order_cancel_draft yml Again bzr revid: aag@tinyerp.com-20110812114412-1zi5v8ueg4jxx0d6 --- addons/purchase/test/purchase_order_cancel_draft.yml | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/addons/purchase/test/purchase_order_cancel_draft.yml b/addons/purchase/test/purchase_order_cancel_draft.yml index 6065e34994f..c31ba7ce68c 100644 --- a/addons/purchase/test/purchase_order_cancel_draft.yml +++ b/addons/purchase/test/purchase_order_cancel_draft.yml @@ -75,9 +75,7 @@ - !python {model: purchase.order}: | from tools.translate import _ - ids = [] - ids.append(ref("purchase_order_pendrive1")) - self.onchange_warehouse_id(cr, uid, ids , 1) + self.onchange_warehouse_id(cr, uid, [ref("purchase_order_pendrive1")], 1) part_obj = self.pool.get('res.partner') price_obj = self.pool.get('product.pricelist') product_obj = self.pool.get('product.product') @@ -88,11 +86,11 @@ product_id = product_obj.search(cr, uid, [('name','=','Pen Drive 2')]) uom_id = uom_obj.search(cr, uid, [('name','=','PCE')]) part_ids = part_obj.search(cr, uid, [('name','=','Distrib PC')]) - line_id = po_line_obj.search(cr, uid, [('order_id','=',ids[0])]) + line_id = po_line_obj.search(cr, uid, [('order_id','=',ref("purchase_order_pendrive1"))]) po_line_obj.product_id_change(cr, uid, line_id[0], price_id[0], product_id[0], 10, uom_id[0], part_ids[0]) po_line_obj.product_uom_change(cr, uid, line_id[0], price_id[0], product_id[0], 10, uom_id[0], part_ids[0]) address_id = addrss_obj.search(cr, uid, [('partner_id','=',part_ids)]) - self.onchange_dest_address_id(cr, uid, ids, address_id[0]) + self.onchange_dest_address_id(cr, uid, [ref("purchase_order_pendrive1")], address_id[0]) - I confirm the purchase order for Pen Drive1. - From c95fc748a33a560b88556cbc74b8b8c56592a77e Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 25 Aug 2011 11:51:29 +0530 Subject: [PATCH 13/31] [IMP] Purchase: Optimize purchase_order_cancel_draft.yml bzr revid: aag@tinyerp.com-20110825062129-g0kr3dmpkto5960s --- addons/purchase/test/purchase_order_cancel_draft.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/purchase/test/purchase_order_cancel_draft.yml b/addons/purchase/test/purchase_order_cancel_draft.yml index c31ba7ce68c..8b15b285948 100644 --- a/addons/purchase/test/purchase_order_cancel_draft.yml +++ b/addons/purchase/test/purchase_order_cancel_draft.yml @@ -101,13 +101,11 @@ !assert {model: purchase.order, id: purchase_order_pendrive1}: - state == 'approved' - - I have to first cancel Picking of Approved Perchase order . + I have to first cancel Picking of Approved Purchase order . - !python {model: stock.picking}: | from tools.translate import _ - pur_ord=self.pool.get( 'purchase.order') - name = pur_ord.browse(cr, uid, ref("purchase_order_pendrive1")).name - search_ids=self.search(cr, uid, [('origin', '=', name) ]) + search_ids=self.search(cr, uid, [('purchase_id', '=', ref("purchase_order_pendrive1"))]) self.action_cancel(cr, uid, search_ids) - Now I have to cancel confirm purchase order for Pen Drive1. From 9c939e3024786b276b07a59a8651da4c5d202192 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 25 Aug 2011 13:51:16 +0530 Subject: [PATCH 14/31] [IMP] Purchase: write on purchase order instead of manually calling _set_minimum_planned_date bzr revid: aag@tinyerp.com-20110825082116-iwo2zlhox65bsk8q --- addons/purchase/test/purchase_from_order.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/addons/purchase/test/purchase_from_order.yml b/addons/purchase/test/purchase_from_order.yml index 4e72079b3be..5863483f2dc 100644 --- a/addons/purchase/test/purchase_from_order.yml +++ b/addons/purchase/test/purchase_from_order.yml @@ -56,11 +56,10 @@ - !python {model: purchase.order}: | from tools.translate import _ - import time from datetime import datetime from dateutil.relativedelta import relativedelta next_day = datetime.today() + relativedelta(days=1) - self._set_minimum_planned_date(cr, uid, ref("purchase_order_po0"), 'minimum_planned_date', next_day.strftime('%Y-%m-%d'),None ) + self.write(cr, uid, [ref("purchase_order_po0")], {'minimum_planned_date': next_day}) - I check that the order which was initially in the draft state has transit to confirm state. - From 5a382e6167823157c329e46ac0421bffa00fb354 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 25 Aug 2011 14:00:50 +0530 Subject: [PATCH 15/31] [IMP] Purchase: Remove statement from yml bzr revid: aag@tinyerp.com-20110825083050-js34gvqlaijoku37 --- addons/purchase/test/purchase_order_cancel_draft.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/purchase/test/purchase_order_cancel_draft.yml b/addons/purchase/test/purchase_order_cancel_draft.yml index 8b15b285948..14ab437110e 100644 --- a/addons/purchase/test/purchase_order_cancel_draft.yml +++ b/addons/purchase/test/purchase_order_cancel_draft.yml @@ -45,9 +45,7 @@ weight: 0.0 weight_net: 0.0 - - In order to test the purchase order flow,I create a new record where "invoice_method" is From Order. -- - I create first purchase order for Pen Drive1. + I create first purchase order for Pen Drive1 where "invoice_method" is From Order. - !record {model: purchase.order, id: purchase_order_pendrive1}: company_id: base.main_company From 293b63f4d8888abbee0d4940774d9341f1e13d44 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 25 Aug 2011 14:04:49 +0530 Subject: [PATCH 16/31] [IMP] Purchase: Remove from tools.translate import _ bzr revid: aag@tinyerp.com-20110825083449-sx2xqf4rwimee0nh --- addons/purchase/test/purchase_order_cancel_draft.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/purchase/test/purchase_order_cancel_draft.yml b/addons/purchase/test/purchase_order_cancel_draft.yml index 14ab437110e..1bdb5aaa578 100644 --- a/addons/purchase/test/purchase_order_cancel_draft.yml +++ b/addons/purchase/test/purchase_order_cancel_draft.yml @@ -109,7 +109,6 @@ Now I have to cancel confirm purchase order for Pen Drive1. - !python {model: purchase.order}: | - from tools.translate import _ self.action_cancel(cr, uid, [ref("purchase_order_pendrive1")]) - I check that the order which was in approved state has transmit to cancel state. From 03d68cc44b4d2b2e0745b033fdbdd102a9089dff Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 25 Aug 2011 14:05:53 +0530 Subject: [PATCH 17/31] [IMP] Purchase: Remove from tools.translate import _ bzr revid: aag@tinyerp.com-20110825083553-3a6xrnpsbpp6wzgy --- addons/purchase/test/purchase_order_cancel_draft.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/addons/purchase/test/purchase_order_cancel_draft.yml b/addons/purchase/test/purchase_order_cancel_draft.yml index 1bdb5aaa578..2ce246bb7e4 100644 --- a/addons/purchase/test/purchase_order_cancel_draft.yml +++ b/addons/purchase/test/purchase_order_cancel_draft.yml @@ -119,7 +119,6 @@ Now again set purchase order for Pen Drive1 to draft state. - !python {model: purchase.order}: | - from tools.translate import _ self.action_cancel_draft(cr, uid, [ref("purchase_order_pendrive1")]) - I check that the order which was in cancel state has transmit to draft state. From bb6508040dfa8e70a1d4a74d17333e807aa8c638 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 25 Aug 2011 14:20:38 +0530 Subject: [PATCH 18/31] [IMP] Purchase: change the tag bzr revid: aag@tinyerp.com-20110825085038-reiitbn3rjxz4y22 --- addons/purchase/test/purchase_order_cancel_draft.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/test/purchase_order_cancel_draft.yml b/addons/purchase/test/purchase_order_cancel_draft.yml index 2ce246bb7e4..78208166e41 100644 --- a/addons/purchase/test/purchase_order_cancel_draft.yml +++ b/addons/purchase/test/purchase_order_cancel_draft.yml @@ -121,7 +121,7 @@ !python {model: purchase.order}: | self.action_cancel_draft(cr, uid, [ref("purchase_order_pendrive1")]) - - I check that the order which was in cancel state has transmit to draft state. + I check that the order is in draft state. - !assert {model: purchase.order, id: purchase_order_pendrive1}: - state == 'draft' From b6534076a3af746f2ca87013dae96288c7be33ca Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 25 Aug 2011 14:33:19 +0530 Subject: [PATCH 19/31] [IMP] Purchase: Remove Duplicate Record bzr revid: aag@tinyerp.com-20110825090319-0scigeqn4beeehrk --- addons/purchase/test/purchase_order_cancel_draft.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/purchase/test/purchase_order_cancel_draft.yml b/addons/purchase/test/purchase_order_cancel_draft.yml index 78208166e41..da4961d7ae7 100644 --- a/addons/purchase/test/purchase_order_cancel_draft.yml +++ b/addons/purchase/test/purchase_order_cancel_draft.yml @@ -130,6 +130,6 @@ - !python {model: purchase.order}: | from tools.translate import _ - self.copy(cr, uid, ref("purchase_order_pendrive1")) - self.unlink(cr, uid, [ref("purchase_order_pendrive1")]) + copy_id = self.copy(cr, uid, ref("purchase_order_pendrive1")) + self.unlink(cr, uid, [copy_id]) \ No newline at end of file From e4244b640518384443d6b6414dc48524ccb4774a Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 25 Aug 2011 14:50:26 +0530 Subject: [PATCH 20/31] [IMP] Purchase: Add new optimize code for Merging PO bzr revid: aag@tinyerp.com-20110825092026-3vuc4x2x78s8ont2 --- .../test/purchase_order_cancel_draft.yml | 34 ++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/addons/purchase/test/purchase_order_cancel_draft.yml b/addons/purchase/test/purchase_order_cancel_draft.yml index da4961d7ae7..35872418f84 100644 --- a/addons/purchase/test/purchase_order_cancel_draft.yml +++ b/addons/purchase/test/purchase_order_cancel_draft.yml @@ -121,7 +121,7 @@ !python {model: purchase.order}: | self.action_cancel_draft(cr, uid, [ref("purchase_order_pendrive1")]) - - I check that the order is in draft state. + I check that the First purchase order is in draft state. - !assert {model: purchase.order, id: purchase_order_pendrive1}: - state == 'draft' @@ -132,4 +132,36 @@ from tools.translate import _ copy_id = self.copy(cr, uid, ref("purchase_order_pendrive1")) self.unlink(cr, uid, [copy_id]) +- + I create Second purchase order for Pen Drive1 where "invoice_method" is From Order. +- + !record {model: purchase.order, id: purchase_order_pendrive2}: + company_id: base.main_company + date_order: !eval time.strftime('%Y-%m-%d') + invoice_method: order + location_id: stock.stock_location_stock + order_line: + - date_planned: !eval time.strftime('%Y-%m-%d') + name: Pen Drive + price_unit: 100.0 + product_id: 'product_product_pendrive1' + product_qty: 10.0 + product_uom: product.product_uom_unit + state: draft + partner_address_id: base.res_partner_address_7 + partner_id: base.res_partner_4 + pricelist_id: purchase.list0 +- + Initially Second purchase order is in the draft state. +- + !assert {model: purchase.order, id: purchase_order_pendrive2}: + - state == 'draft' +- + I have merged first and second purchase order which are in draft state, belong to the same supplier,have same stock location, same pricelist. +- + !python {model: purchase.order.group}: | + ids = [ref("purchase_order_pendrive1"),ref("purchase_order_pendrive2")] + self.fields_view_get(cr, uid, context={'active_ids': ids}) + self.merge_orders(cr, uid, [1], context={'active_ids': ids}) + \ No newline at end of file From c0f3cc7a71b1e7e9ee06e7b499aeb3e0e571ef34 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 25 Aug 2011 14:55:45 +0530 Subject: [PATCH 21/31] [REM] Purchase: Remove purchase/test/purchase_order_merge.yml file bzr revid: aag@tinyerp.com-20110825092545-on6o4ujyyn8g2cmc --- addons/purchase/__openerp__.py | 1 - addons/purchase/test/purchase_order_merge.yml | 80 ------------------- 2 files changed, 81 deletions(-) delete mode 100644 addons/purchase/test/purchase_order_merge.yml diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py index 20efb26d3d2..cc009386f67 100644 --- a/addons/purchase/__openerp__.py +++ b/addons/purchase/__openerp__.py @@ -66,7 +66,6 @@ Dashboard for purchase management that includes: 'purchase_unit_test.xml', 'test/procurement_buy.yml', 'test/purchase_report.yml', - 'test/purchase_order_merge.yml', 'test/purchase_order_cancel_draft.yml' ], 'demo': ['purchase_demo.xml'], diff --git a/addons/purchase/test/purchase_order_merge.yml b/addons/purchase/test/purchase_order_merge.yml deleted file mode 100644 index 61555806d88..00000000000 --- a/addons/purchase/test/purchase_order_merge.yml +++ /dev/null @@ -1,80 +0,0 @@ -- - In order to test to merge two purchase order,I start by creating a new product 'Nokia3110c' -- - !record {model: product.product, id: product_product_nokia3110c}: - categ_id: 'product.product_category_3' - cost_method: standard - mes_type: fixed - name: NOKIA 3110c - price_margin: 1.0 - procure_method: make_to_order - property_stock_inventory: stock.location_inventory - property_stock_procurement: stock.location_procurement - property_stock_production: stock.location_production - seller_delay: '1' - standard_price: 5000.0 - supply_method: buy - type: product - uom_id: product.product_uom_unit - uom_po_id: product.product_uom_unit - volume: 0.0 - warranty: 0.0 - weight: 0.0 - weight_net: 0.0 -- - In order to test the merge purchase order flow,I create a new record where "invoice_method" is From Order. -- - I create first purchase order for Nokia3110c. -- - !record {model: purchase.order, id: purchase_order_po_nokia1}: - company_id: base.main_company - date_order: !eval time.strftime('%Y-%m-%d') - invoice_method: order - location_id: stock.stock_location_stock - order_line: - - date_planned: !eval time.strftime('%Y-%m-%d') - name: NOKIA 3110c - price_unit: 100.0 - product_id: 'product_product_nokia3110c' - product_qty: 10.0 - product_uom: product.product_uom_unit - state: draft - partner_address_id: base.res_partner_address_7 - partner_id: base.res_partner_4 - pricelist_id: purchase.list0 -- - Initially first purchase order is in the draft state. -- - !assert {model: purchase.order, id: purchase_order_po_nokia1}: - - state == 'draft' -- - I create second purchase order for Nokia3110c with same supplier,have same stock location, same pricelist as First Purchase order of Nokia3110. -- - !record {model: purchase.order, id: purchase_order_po_nokia2}: - company_id: base.main_company - date_order: !eval time.strftime('%Y-%m-%d') - invoice_method: order - location_id: stock.stock_location_stock - order_line: - - date_planned: !eval time.strftime('%Y-%m-%d') - name: NOKIA 3110c - price_unit: 100.0 - product_id: 'product_product_nokia3110c' - product_qty: 20.0 - product_uom: product.product_uom_unit - state: draft - partner_address_id: base.res_partner_address_7 - partner_id: base.res_partner_4 - pricelist_id: purchase.list0 -- - Initially second purchase order is in the draft state. -- - !assert {model: purchase.order, id: purchase_order_po_nokia2}: - - state == 'draft' -- - I have merged first and second purchase order which are in draft state, belong to the same supplier,have same stock location, same pricelist. -- - !python {model: purchase.order.group}: | - ids = [ref("purchase_order_po_nokia1"),ref("purchase_order_po_nokia2")] - self.fields_view_get(cr, uid, context={'active_ids': ids}) - self.merge_orders(cr, uid, [1], context={'active_ids': ids}) From 3d4e04d904a86d5f5294c60780ddadab4c4eb826 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 25 Aug 2011 15:08:05 +0530 Subject: [PATCH 22/31] [REM] Purchase: Remove Onchange function call bzr revid: aag@tinyerp.com-20110825093805-5wptnyuya7n7qfzq --- .../test/purchase_order_cancel_draft.yml | 21 ------------------- 1 file changed, 21 deletions(-) diff --git a/addons/purchase/test/purchase_order_cancel_draft.yml b/addons/purchase/test/purchase_order_cancel_draft.yml index 35872418f84..1cd37b8d87f 100644 --- a/addons/purchase/test/purchase_order_cancel_draft.yml +++ b/addons/purchase/test/purchase_order_cancel_draft.yml @@ -68,27 +68,6 @@ - !assert {model: purchase.order, id: purchase_order_pendrive1}: - state == 'draft' -- - I test onchanged on Wharehouse ,Product, Uom, Destination Address . -- - !python {model: purchase.order}: | - from tools.translate import _ - self.onchange_warehouse_id(cr, uid, [ref("purchase_order_pendrive1")], 1) - part_obj = self.pool.get('res.partner') - price_obj = self.pool.get('product.pricelist') - product_obj = self.pool.get('product.product') - addrss_obj = self.pool.get('res.partner.address') - po_line_obj = self.pool.get('purchase.order.line') - uom_obj = self.pool.get('product.uom') - price_id = price_obj.search(cr, uid, [('name','=','Default Purchase Pricelist')]) - product_id = product_obj.search(cr, uid, [('name','=','Pen Drive 2')]) - uom_id = uom_obj.search(cr, uid, [('name','=','PCE')]) - part_ids = part_obj.search(cr, uid, [('name','=','Distrib PC')]) - line_id = po_line_obj.search(cr, uid, [('order_id','=',ref("purchase_order_pendrive1"))]) - po_line_obj.product_id_change(cr, uid, line_id[0], price_id[0], product_id[0], 10, uom_id[0], part_ids[0]) - po_line_obj.product_uom_change(cr, uid, line_id[0], price_id[0], product_id[0], 10, uom_id[0], part_ids[0]) - address_id = addrss_obj.search(cr, uid, [('partner_id','=',part_ids)]) - self.onchange_dest_address_id(cr, uid, [ref("purchase_order_pendrive1")], address_id[0]) - I confirm the purchase order for Pen Drive1. - From d8f1410505b154e7a99a40e77c9fefb35158fd7e Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 25 Aug 2011 15:44:48 +0530 Subject: [PATCH 23/31] [IMP]: use datetime.timedelta instead of relativedelta bzr revid: aag@tinyerp.com-20110825101448-o3ndugu3zfduv0zf --- addons/purchase/test/purchase_from_order.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/addons/purchase/test/purchase_from_order.yml b/addons/purchase/test/purchase_from_order.yml index 5863483f2dc..8e46899f8a0 100644 --- a/addons/purchase/test/purchase_from_order.yml +++ b/addons/purchase/test/purchase_from_order.yml @@ -55,10 +55,8 @@ I changed Expected Date to Next Day. - !python {model: purchase.order}: | - from tools.translate import _ - from datetime import datetime - from dateutil.relativedelta import relativedelta - next_day = datetime.today() + relativedelta(days=1) + import datetime + next_day = (datetime.date.today()+datetime.timedelta(days=1)) self.write(cr, uid, [ref("purchase_order_po0")], {'minimum_planned_date': next_day}) - I check that the order which was initially in the draft state has transit to confirm state. From a7c80240cb0d4380b56dd609dbf0db54fa4900e2 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 25 Aug 2011 16:29:14 +0530 Subject: [PATCH 24/31] [REM] purchase_requisition: Remove Static code from yml bzr revid: aag@tinyerp.com-20110825105914-3aq90dc5h72g4z03 --- .../test/purchase_requisition_test.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/addons/purchase_requisition/test/purchase_requisition_test.yml b/addons/purchase_requisition/test/purchase_requisition_test.yml index 3cc0a4bb065..82bb3d86f89 100755 --- a/addons/purchase_requisition/test/purchase_requisition_test.yml +++ b/addons/purchase_requisition/test/purchase_requisition_test.yml @@ -64,9 +64,7 @@ I confirm the purchase order of Axelor. - !python {model: purchase.order}: | - req_obj = self.pool.get('purchase.requisition') - ids =req_obj.search(cr, uid, [('name','=','TE00009')]) - purchase_id= self.search(cr, uid, [('requisition_id','in',ids)]) + purchase_id= self.search(cr, uid, [('requisition_id','=',ref("purchase_requisition_te0"))]) import netsvc wf_service = netsvc.LocalService("workflow") if purchase_id: @@ -76,9 +74,7 @@ I check that Quotation of Axelor is Approved. - !python {model: purchase.order}: | - req_obj = self.pool.get('purchase.requisition') - ids =req_obj.search(cr, uid,[('name','=','TE00009')]) - purchase_id= self.search(cr, uid, [('requisition_id','in',ids)])[0] + purchase_id= self.search(cr, uid, [('requisition_id','=',ref("purchase_requisition_te0"))])[0] state=self.browse(cr,uid,purchase_id).state assert (state=='approved') - From d62df3ae923e090f8faeb104a68aecc0e8ef6e4c Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 25 Aug 2011 16:35:35 +0530 Subject: [PATCH 25/31] [REM] purchase_requisition: Remove Static code from yml bzr revid: aag@tinyerp.com-20110825110535-rclb0ldd9dcj8l2r --- .../purchase_requisition/test/purchase_requisition_test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/purchase_requisition/test/purchase_requisition_test.yml b/addons/purchase_requisition/test/purchase_requisition_test.yml index 82bb3d86f89..385f93ae33d 100755 --- a/addons/purchase_requisition/test/purchase_requisition_test.yml +++ b/addons/purchase_requisition/test/purchase_requisition_test.yml @@ -135,9 +135,7 @@ - !python {model: purchase.order}: | partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','ASUStek')])[0] - req_obj = self.pool.get('purchase.requisition') - ids =req_obj.search(cr, uid, [('name','=','TE000010')]) - purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','in',ids)]) + purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','=',ref("purchase_requisition_ex1"))]) import netsvc wf_service = netsvc.LocalService("workflow") if purchase_id: From ca82be04a99d2b0d98e9944c1199ea34fe056cb0 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 25 Aug 2011 16:40:04 +0530 Subject: [PATCH 26/31] [REM] purchase_requisition: Remove Static code from yml bzr revid: aag@tinyerp.com-20110825111004-qqw4akeen0caiibz --- .../purchase_requisition/test/purchase_requisition_test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/purchase_requisition/test/purchase_requisition_test.yml b/addons/purchase_requisition/test/purchase_requisition_test.yml index 385f93ae33d..1ffd11a5ec1 100755 --- a/addons/purchase_requisition/test/purchase_requisition_test.yml +++ b/addons/purchase_requisition/test/purchase_requisition_test.yml @@ -146,9 +146,7 @@ - !python {model: purchase.order}: | partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','ASUStek')])[0] - req_obj = self.pool.get('purchase.requisition') - ids =req_obj.search(cr, uid,[('name','=','TE000010')]) - purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','in',ids)])[0] + purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','=',ref("purchase_requisition_ex1"))])[0] state=self.browse(cr,uid,purchase_id).state assert (state=='approved') - From 53b441bb845e97d2836582149e206d02b7170c61 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 25 Aug 2011 16:43:44 +0530 Subject: [PATCH 27/31] [REM] purchase_requisition: Remove Static code from yml bzr revid: aag@tinyerp.com-20110825111344-on8euk2slev36pmt --- .../purchase_requisition/test/purchase_requisition_test.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/addons/purchase_requisition/test/purchase_requisition_test.yml b/addons/purchase_requisition/test/purchase_requisition_test.yml index 1ffd11a5ec1..5aaa8e22123 100755 --- a/addons/purchase_requisition/test/purchase_requisition_test.yml +++ b/addons/purchase_requisition/test/purchase_requisition_test.yml @@ -154,9 +154,7 @@ - !python {model: purchase.order}: | partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','Distrib PC')])[0] - req_obj = self.pool.get('purchase.requisition') - ids =req_obj.search(cr, uid,[('name','=','TE000010')]) - purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','in',ids)])[0] + purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','=',ref("purchase_requisition_ex1"))])[0] state=self.browse(cr,uid,purchase_id).state assert (state=='cancel') - From 4923de9a822c540647dcef62f1a732cedda778d7 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Thu, 25 Aug 2011 17:25:19 +0530 Subject: [PATCH 28/31] [IMP]: purchase_requisition:Add code for copy ,confirm, Done requsitions bzr revid: aag@tinyerp.com-20110825115519-06mn72wvm30bg80s --- .../test/purchase_requisition_test.yml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/addons/purchase_requisition/test/purchase_requisition_test.yml b/addons/purchase_requisition/test/purchase_requisition_test.yml index 5aaa8e22123..1cab8ff8f2d 100755 --- a/addons/purchase_requisition/test/purchase_requisition_test.yml +++ b/addons/purchase_requisition/test/purchase_requisition_test.yml @@ -38,6 +38,15 @@ - !assert {model: purchase.requisition, id: purchase_requisition_te0}: - state == 'draft' +- + Copy purchase requisition which is in draft state than confirm and Done it. +- + !python {model: purchase.requisition}: | + copy_id = self.copy(cr, uid, ref("purchase_requisition_te0")) + self.tender_cancel(cr, uid, [copy_id], context=None) + self.tender_reset(cr, uid, [copy_id], context=None) + self.tender_in_progress(cr, uid, [copy_id], context=None) + self.tender_done(cr, uid, [copy_id], context=None) - I confirm the purchase requisition for MOB1. - From 23e08671e0f6d82565c07a92b843190c07a03748 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Wed, 21 Sep 2011 16:28:26 +0530 Subject: [PATCH 29/31] [IMP] Purchase,purchase_requisition :Remove some hardcode and Optimize code bzr revid: aag@tinyerp.com-20110921105826-mu74twcgrfun2pac --- .../test/purchase_order_cancel_draft.yml | 35 ++----------------- .../test/purchase_requisition_test.yml | 26 ++++++-------- 2 files changed, 12 insertions(+), 49 deletions(-) diff --git a/addons/purchase/test/purchase_order_cancel_draft.yml b/addons/purchase/test/purchase_order_cancel_draft.yml index 1cd37b8d87f..fb96647d66b 100644 --- a/addons/purchase/test/purchase_order_cancel_draft.yml +++ b/addons/purchase/test/purchase_order_cancel_draft.yml @@ -17,33 +17,6 @@ type: product uom_id: product.product_uom_unit uom_po_id: product.product_uom_unit - volume: 0.0 - warranty: 0.0 - weight: 0.0 - weight_net: 0.0 -- - Create second new product 'Pen Drive2' -- - !record {model: product.product, id: product_product_pendrive2}: - categ_id: 'product.product_category_3' - cost_method: standard - mes_type: fixed - name: Pen Drive 2 - price_margin: 1.0 - procure_method: make_to_order - property_stock_inventory: stock.location_inventory - property_stock_procurement: stock.location_procurement - property_stock_production: stock.location_production - seller_delay: '1' - standard_price: 500.0 - supply_method: buy - type: product - uom_id: product.product_uom_unit - uom_po_id: product.product_uom_unit - volume: 0.0 - warranty: 0.0 - weight: 0.0 - weight_net: 0.0 - I create first purchase order for Pen Drive1 where "invoice_method" is From Order. - @@ -55,11 +28,10 @@ order_line: - date_planned: !eval time.strftime('%Y-%m-%d') name: Pen Drive - price_unit: 100.0 + price_unit: 500.0 product_id: 'product_product_pendrive1' product_qty: 10.0 product_uom: product.product_uom_unit - state: draft partner_address_id: base.res_partner_address_7 partner_id: base.res_partner_4 pricelist_id: purchase.list0 @@ -81,7 +53,6 @@ I have to first cancel Picking of Approved Purchase order . - !python {model: stock.picking}: | - from tools.translate import _ search_ids=self.search(cr, uid, [('purchase_id', '=', ref("purchase_order_pendrive1"))]) self.action_cancel(cr, uid, search_ids) - @@ -108,7 +79,6 @@ I test for Copy and Delete Perchase order in Draft state. - !python {model: purchase.order}: | - from tools.translate import _ copy_id = self.copy(cr, uid, ref("purchase_order_pendrive1")) self.unlink(cr, uid, [copy_id]) - @@ -122,11 +92,10 @@ order_line: - date_planned: !eval time.strftime('%Y-%m-%d') name: Pen Drive - price_unit: 100.0 + price_unit: 500.0 product_id: 'product_product_pendrive1' product_qty: 10.0 product_uom: product.product_uom_unit - state: draft partner_address_id: base.res_partner_address_7 partner_id: base.res_partner_4 pricelist_id: purchase.list0 diff --git a/addons/purchase_requisition/test/purchase_requisition_test.yml b/addons/purchase_requisition/test/purchase_requisition_test.yml index 1cab8ff8f2d..6ea54ff1343 100755 --- a/addons/purchase_requisition/test/purchase_requisition_test.yml +++ b/addons/purchase_requisition/test/purchase_requisition_test.yml @@ -61,7 +61,7 @@ I Create a Purchase Order for the supplier 'Axelor'. - !record {model: purchase.requisition.partner, id: purchase_requisition_partner_0}: - partner_address_id: base.res_partner_address_7 + partner_address_id: base.res_partner_address_3000 partner_id: base.res_partner_desertic_hispafuentes - I create Quotations For supplier 'Axelor'. @@ -111,13 +111,13 @@ product_uom_id: product.product_uom_unit name: TE000010 - - I Create a First Purchase Order for the supplier 'DistriPC'. + I Create a First Purchase Order for the supplier 'Distrib PC'. - !record {model: purchase.requisition.partner, id: purchase_requisition_partner_1}: partner_address_id: base.res_partner_address_7 partner_id: base.res_partner_4 - - I create Quotations For supplier 'DistriPC'. + I create Quotations For supplier 'Distrib PC'. - !python {model: purchase.requisition.partner}: | self.create_order(cr, uid, [ref("purchase_requisition_partner_1")], {"active_model": "purchase.requisition", @@ -126,7 +126,7 @@ I Create a Second Purchase Order for the supplier ASUStek. - !record {model: purchase.requisition.partner, id: purchase_requisition_partner_2}: - partner_address_id: base.res_partner_address_7 + partner_address_id: base.res_partner_address_tang partner_id: base.res_partner_asus - I create Quotations For supplier 'ASUStek'. @@ -140,26 +140,20 @@ !assert {model: purchase.requisition, id: purchase_requisition_ex1}: - state == 'draft' - - I confirm the Second purchase order of ASUStek. + I confirm the Second purchase order of ASUStek, than check that Quotation is Approved. - !python {model: purchase.order}: | - partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','ASUStek')])[0] - purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','=',ref("purchase_requisition_ex1"))]) + purchase_id= self.search(cr, uid, [('partner_id','=',ref("base.res_partner_asus")),('requisition_id','=',ref("purchase_requisition_ex1"))]) import netsvc wf_service = netsvc.LocalService("workflow") if purchase_id: wf_service.trg_validate(uid, 'purchase.order',purchase_id[0],'purchase_confirm', cr) wf_service.trg_validate(uid, 'purchase.order',purchase_id[0],'purchase_approve', cr) + state=self.browse(cr,uid,purchase_id[0]).state + assert (state=='approved') + - - I check that Quotation of ASUStek is Approved. -- - !python {model: purchase.order}: | - partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','ASUStek')])[0] - purchase_id= self.search(cr, uid, [('partner_id','=',partner_id),('requisition_id','=',ref("purchase_requisition_ex1"))])[0] - state=self.browse(cr,uid,purchase_id).state - assert (state=='approved') -- - I check that Quotation of DistriPC is cancelled. + I check that Quotation of Distrib PC is cancelled. - !python {model: purchase.order}: | partner_id=self.pool.get('res.partner').search(cr,uid,[('name','=','Distrib PC')])[0] From 4eee5c93fdd8660dc4f43ca86b218cb359c3a934 Mon Sep 17 00:00:00 2001 From: "Atik Agewan (OpenERP)" Date: Wed, 21 Sep 2011 18:53:26 +0530 Subject: [PATCH 30/31] [IMP] Product :optimize code bzr revid: aag@tinyerp.com-20110921132326-0kwg5y0d6g03uxki --- addons/purchase/test/purchase_order_cancel_draft.yml | 1 - addons/purchase_requisition/test/purchase_requisition_test.yml | 1 - 2 files changed, 2 deletions(-) diff --git a/addons/purchase/test/purchase_order_cancel_draft.yml b/addons/purchase/test/purchase_order_cancel_draft.yml index fb96647d66b..6a06ad164b2 100644 --- a/addons/purchase/test/purchase_order_cancel_draft.yml +++ b/addons/purchase/test/purchase_order_cancel_draft.yml @@ -11,7 +11,6 @@ property_stock_inventory: stock.location_inventory property_stock_procurement: stock.location_procurement property_stock_production: stock.location_production - seller_delay: '1' standard_price: 500.0 supply_method: buy type: product diff --git a/addons/purchase_requisition/test/purchase_requisition_test.yml b/addons/purchase_requisition/test/purchase_requisition_test.yml index 6ea54ff1343..e9653e6efa0 100755 --- a/addons/purchase_requisition/test/purchase_requisition_test.yml +++ b/addons/purchase_requisition/test/purchase_requisition_test.yml @@ -11,7 +11,6 @@ property_stock_inventory: stock.location_inventory property_stock_procurement: stock.location_procurement property_stock_production: stock.location_production - seller_delay: '1' standard_price: 2000.0 supply_method: buy type: product From 93c491aa51b18022fba554794ffa3c2b256439ea Mon Sep 17 00:00:00 2001 From: "Rucha (Open ERP)" Date: Mon, 10 Oct 2011 17:20:02 +0530 Subject: [PATCH 31/31] [IMP]: purchase_requisition: Improved statements in yml bzr revid: rpa@tinyerp.com-20111010115002-9xe5knmpmq7u05et --- .../purchase_requisition/test/purchase_requisition_test.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/purchase_requisition/test/purchase_requisition_test.yml b/addons/purchase_requisition/test/purchase_requisition_test.yml index e9653e6efa0..403eaca04fc 100755 --- a/addons/purchase_requisition/test/purchase_requisition_test.yml +++ b/addons/purchase_requisition/test/purchase_requisition_test.yml @@ -57,13 +57,13 @@ !assert {model: purchase.requisition, id: purchase_requisition_te0}: - state == 'in_progress' - - I Create a Purchase Order for the supplier 'Axelor'. + In order to create a purchase order for 'Axelor', i click on the wizard 'Request a Quotation' and create record for wizard. - !record {model: purchase.requisition.partner, id: purchase_requisition_partner_0}: partner_address_id: base.res_partner_address_3000 partner_id: base.res_partner_desertic_hispafuentes - - I create Quotations For supplier 'Axelor'. + I click on 'Create Quotation' for creating PO. - !python {model: purchase.requisition.partner}: | self.create_order(cr, uid, [ref("purchase_requisition_partner_0")], {"active_model": "purchase.requisition", @@ -163,4 +163,4 @@ I check that Purchase Requisition is Done. - !assert {model: purchase.requisition, id: purchase_requisition_ex1}: - - state == 'done' \ No newline at end of file + - state == 'done'