From db0f75705c99e2fa2f61ca125b6e3a891bb14203 Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Fri, 7 Jan 2011 17:45:07 +0530 Subject: [PATCH 1/5] [ADD] purchase_double_validation:Add yml for Double validation bzr revid: aag@tinyerp.co.in-20110107121507-yqcn0cusopw2fu57 --- .../purchase_double_validation/__openerp__.py | 3 + .../test/purchase_double_validation_test.yml | 117 ++++++++++++++++++ 2 files changed, 120 insertions(+) create mode 100644 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 ca21dfc6077..18f5b4a80b9 100644 --- a/addons/purchase_double_validation/__openerp__.py +++ b/addons/purchase_double_validation/__openerp__.py @@ -35,6 +35,9 @@ 'purchase_double_validation_installer.xml' ], 'demo_xml': [], + 'test': [ + 'test/purchase_double_validation_test.yml', + ], '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 100644 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 6dde01f003b5845bdfca633a22a55ce3041288e5 Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Tue, 11 Jan 2011 16:37:29 +0530 Subject: [PATCH 2/5] [FIX] purchase_requisition:Permissions on procurement lp bug: https://launchpad.net/bugs/699784 fixed bzr revid: aag@tinyerp.co.in-20110111110729-m0h3yqcvalxkbxwt --- addons/purchase_requisition/security/ir.model.access.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase_requisition/security/ir.model.access.csv b/addons/purchase_requisition/security/ir.model.access.csv index 4e14688ecc5..d990afcb536 100644 --- a/addons/purchase_requisition/security/ir.model.access.csv +++ b/addons/purchase_requisition/security/ir.model.access.csv @@ -3,5 +3,5 @@ "access_purchase_requisition_line","purchase.requisition.line","model_purchase_requisition_line","purchase.group_purchase_user",1,1,1,1 "access_purchase_requisition_manager","purchase.requisition manager","model_purchase_requisition","purchase.group_purchase_manager",1,0,0,0 "access_purchase_requisition_line_manager","purchase.requisition.line manager","model_purchase_requisition_line","purchase.group_purchase_manager",1,0,0,0 -"access_purchase_requisition","purchase.requisition","model_purchase_requisition","stock.group_stock_manager",1,0,1,0 +"access_purchase_requisition_stock_manager","purchase.requisition","model_purchase_requisition","stock.group_stock_manager",1,0,1,0 "access_purchase_requisition_line","purchase.requisition.line","model_purchase_requisition_line","stock.group_stock_manager",1,0,1,0 From c1190d6289252ee8469c24b2d98b521f251f92dd Mon Sep 17 00:00:00 2001 From: "aag (OpenERP)" Date: Wed, 12 Jan 2011 16:16:53 +0530 Subject: [PATCH 3/5] [FIX] STOCK:Create invoice button is visible when picking is set to be invoiced lp bug: https://launchpad.net/bugs/701389 fixed bzr revid: aag@tinyerp.co.in-20110112104653-kdpk3hs5j8875f53 --- addons/stock/stock_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 85c1231b75a..550aab9b1c7 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -1189,7 +1189,7 @@