From 67bcf36f137c2834965f9b55350db174b7c96b04 Mon Sep 17 00:00:00 2001 From: "Randhir Mayatra (OpenERP)" Date: Thu, 22 Aug 2013 18:21:50 +0530 Subject: [PATCH 1/4] [IMP] place lifo_price yml into complex_routs and make changes bzr revid: rma@tinyerp.com-20130822125150-zdj1lo96axkwor0e --- addons/purchase/__openerp__.py | 28 +++++++------- addons/stock_complex_routes/__openerp__.py | 2 +- .../test/lifo_price.yml | 37 +++++++++++-------- 3 files changed, 37 insertions(+), 30 deletions(-) rename addons/{purchase => stock_complex_routes}/test/lifo_price.yml (76%) diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py index 56512be09da..36df07a95bd 100644 --- a/addons/purchase/__openerp__.py +++ b/addons/purchase/__openerp__.py @@ -67,20 +67,20 @@ Dashboard / Reports for Purchase Management will include: 'res_config_view.xml', ], 'test': [ - 'test/fifo_price.yml', - 'test/fifo_returns.yml', - #'test/costmethodchange.yml', - 'test/process/cancel_order.yml', - 'test/process/rfq2order2done.yml', - 'test/process/generate_invoice_from_reception.yml', - 'test/process/run_scheduler.yml', - 'test/process/merge_order.yml', - 'test/process/edi_purchase_order.yml', - 'test/process/invoice_on_poline.yml', - 'test/ui/print_report.yml', - 'test/ui/duplicate_order.yml', - 'test/ui/delete_order.yml', - 'test/average_price.yml', +# 'test/fifo_price.yml', +# 'test/fifo_returns.yml', +# #'test/costmethodchange.yml', +# 'test/process/cancel_order.yml', +# 'test/process/rfq2order2done.yml', +# 'test/process/generate_invoice_from_reception.yml', +# 'test/process/run_scheduler.yml', +# 'test/process/merge_order.yml', +# 'test/process/edi_purchase_order.yml', +# 'test/process/invoice_on_poline.yml', +# 'test/ui/print_report.yml', +# 'test/ui/duplicate_order.yml', +# 'test/ui/delete_order.yml', +# 'test/average_price.yml', 'test/lifo_price.yml', ], 'demo': [ diff --git a/addons/stock_complex_routes/__openerp__.py b/addons/stock_complex_routes/__openerp__.py index 5426e2c7aca..c9bdff7c7a8 100644 --- a/addons/stock_complex_routes/__openerp__.py +++ b/addons/stock_complex_routes/__openerp__.py @@ -38,7 +38,7 @@ This adds a route on the sales order and sales order line (mini module) 'init_xml': [], 'update_xml': ['stock_complex_routes.xml'], 'demo_xml': [], - 'test': [], + 'test': ['lifo_price.yml'], 'installable': True, 'auto_install': True, } diff --git a/addons/purchase/test/lifo_price.yml b/addons/stock_complex_routes/test/lifo_price.yml similarity index 76% rename from addons/purchase/test/lifo_price.yml rename to addons/stock_complex_routes/test/lifo_price.yml index ea30317b996..5c3aa5bb3b6 100644 --- a/addons/purchase/test/lifo_price.yml +++ b/addons/stock_complex_routes/test/lifo_price.yml @@ -1,8 +1,15 @@ +- + For check product removal create removal strategy "LIFO" +- + !record {model: product.removal, id: product_removal_lifo}: + product_categ_id: product.product_category_1 + method: lifo + location_id: stock.stock_location_stock - - Set product category removal strategy as LIFO + Set product category removal strategy as LIFO - !record {model: product.category, id: product.product_category_1}: - removal_strategy: lifo + removal_strategy_ids: product_removal_lifo - Set a product as using lifo price - @@ -58,10 +65,9 @@ - Process the reception of purchase order 1 - - !python {model: stock.partial.picking}: | - pick_ids = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_lifo1")).picking_ids - partial_id = self.create(cr, uid, {}, context={'active_model': 'stock.picking','active_ids': [pick_ids[0].id]}) - self.do_partial(cr, uid, [partial_id]) + !python {model: stock.picking}: | + order = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_lifo1")).picking_ids[0] + order.do_partial(context=context) - Check the standard price of the product (lifo icecream) - @@ -74,10 +80,9 @@ - Process the reception of purchase order 2 - - !python {model: stock.partial.picking}: | - pick_ids = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_lifo2")).picking_ids - partial_id = self.create(cr, uid, {}, context={'active_model': 'stock.picking','active_ids': [pick_ids[0].id]}) - self.do_partial(cr, uid, [partial_id]) + !python {model: stock.picking}: | + order = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_lifo2")).picking_ids[0] + order.do_partial(context=context) - Check the standard price should not have changed - @@ -87,7 +92,7 @@ Let us send some goods - !record {model: stock.picking, id: outgoing_lifo_shipment}: - type: out + picking_type_id: stock.picking_type_out - Picking needs movement from stock - @@ -95,8 +100,10 @@ picking_id: outgoing_lifo_shipment product_id: product_lifo_icecream product_uom: product.product_uom_kgm + location_id: stock.stock_location_stock + location_dest_id: stock.stock_location_customers product_qty: 20.0 - type: out + picking_type_id: stock.picking_type_out - I assign this outgoing shipment - @@ -105,9 +112,9 @@ - Process the delivery of the outgoing shipment - - !python {model: stock.partial.picking}: | - partial_id = self.create(cr, uid, {}, context={'active_model': 'stock.picking','active_ids': [ref("outgoing_lifo_shipment")], 'default_type':'out'}) - self.do_partial(cr, uid, [partial_id]) + !python {model: stock.picking}: | + pick_order = self.pool.get('stock.picking').browse(cr, uid, ref("outgoing_lifo_shipment")) + pick_order.do_partial(context=context) - Check standard price became 80 euro - From 15ac070679805fc4834d5d3bba30114e9b2f2218 Mon Sep 17 00:00:00 2001 From: "Randhir Mayatra (OpenERP)" Date: Fri, 23 Aug 2013 12:20:53 +0530 Subject: [PATCH 2/4] [IMP] improve code for lifo_price_yml bzr revid: rma@tinyerp.com-20130823065053-phiq6p3tccck61fv --- addons/stock_complex_routes/__openerp__.py | 2 +- addons/stock_complex_routes/test/lifo_price.yml | 15 ++++++--------- addons/stock_location/stock_location.py | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) diff --git a/addons/stock_complex_routes/__openerp__.py b/addons/stock_complex_routes/__openerp__.py index c9bdff7c7a8..872f42d98b5 100644 --- a/addons/stock_complex_routes/__openerp__.py +++ b/addons/stock_complex_routes/__openerp__.py @@ -38,7 +38,7 @@ This adds a route on the sales order and sales order line (mini module) 'init_xml': [], 'update_xml': ['stock_complex_routes.xml'], 'demo_xml': [], - 'test': ['lifo_price.yml'], + 'test': ['test/lifo_price.yml'], 'installable': True, 'auto_install': True, } diff --git a/addons/stock_complex_routes/test/lifo_price.yml b/addons/stock_complex_routes/test/lifo_price.yml index 5c3aa5bb3b6..8365eb79f48 100644 --- a/addons/stock_complex_routes/test/lifo_price.yml +++ b/addons/stock_complex_routes/test/lifo_price.yml @@ -1,15 +1,12 @@ -- - For check product removal create removal strategy "LIFO" -- - !record {model: product.removal, id: product_removal_lifo}: - product_categ_id: product.product_category_1 - method: lifo - location_id: stock.stock_location_stock - Set product category removal strategy as LIFO - - !record {model: product.category, id: product.product_category_1}: - removal_strategy_ids: product_removal_lifo + !record {model: product.category, id: product.product_category_001}: + name : Lifo Category + removal_strategy_ids: + - product_categ_id: product.product_category_1 + method: lifo + location_id: stock.stock_location_stock - Set a product as using lifo price - diff --git a/addons/stock_location/stock_location.py b/addons/stock_location/stock_location.py index 7f27496ff0d..8a389721733 100644 --- a/addons/stock_location/stock_location.py +++ b/addons/stock_location/stock_location.py @@ -215,7 +215,7 @@ class product_category(osv.osv): _inherit = 'product.category' _columns = { 'route_ids': fields.many2many('stock.location.route', 'stock_location_route_categ', 'categ_id', 'route_id', 'Routes'), - #'removal_strategy_ids': fields.one2many('product.removal', 'product_categ_id', 'Removal Strategies'), + 'removal_strategy_ids': fields.one2many('product.removal', 'product_categ_id', 'Removal Strategies'), #'putaway_strategy_ids': fields.one2many('product.putaway', 'product_categ_id', 'Put Away Strategies'), } From 290af983bc110f8f2fc4da167d89857bfadb25a0 Mon Sep 17 00:00:00 2001 From: "Randhir Mayatra (OpenERP)" Date: Fri, 23 Aug 2013 15:40:39 +0530 Subject: [PATCH 3/4] [IMP] remove extra changes bzr revid: rma@tinyerp.com-20130823101039-ibhn7qz3t3ta288g --- addons/purchase/__openerp__.py | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/addons/purchase/__openerp__.py b/addons/purchase/__openerp__.py index 36df07a95bd..56512be09da 100644 --- a/addons/purchase/__openerp__.py +++ b/addons/purchase/__openerp__.py @@ -67,20 +67,20 @@ Dashboard / Reports for Purchase Management will include: 'res_config_view.xml', ], 'test': [ -# 'test/fifo_price.yml', -# 'test/fifo_returns.yml', -# #'test/costmethodchange.yml', -# 'test/process/cancel_order.yml', -# 'test/process/rfq2order2done.yml', -# 'test/process/generate_invoice_from_reception.yml', -# 'test/process/run_scheduler.yml', -# 'test/process/merge_order.yml', -# 'test/process/edi_purchase_order.yml', -# 'test/process/invoice_on_poline.yml', -# 'test/ui/print_report.yml', -# 'test/ui/duplicate_order.yml', -# 'test/ui/delete_order.yml', -# 'test/average_price.yml', + 'test/fifo_price.yml', + 'test/fifo_returns.yml', + #'test/costmethodchange.yml', + 'test/process/cancel_order.yml', + 'test/process/rfq2order2done.yml', + 'test/process/generate_invoice_from_reception.yml', + 'test/process/run_scheduler.yml', + 'test/process/merge_order.yml', + 'test/process/edi_purchase_order.yml', + 'test/process/invoice_on_poline.yml', + 'test/ui/print_report.yml', + 'test/ui/duplicate_order.yml', + 'test/ui/delete_order.yml', + 'test/average_price.yml', 'test/lifo_price.yml', ], 'demo': [ From b412701b94e016c78d31120e94703a0fc3c86d61 Mon Sep 17 00:00:00 2001 From: "Randhir Mayatra (OpenERP)" Date: Fri, 23 Aug 2013 15:43:59 +0530 Subject: [PATCH 4/4] [IMP] improve code bzr revid: rma@tinyerp.com-20130823101359-989r7eriohaey3xo --- addons/stock_complex_routes/test/lifo_price.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/stock_complex_routes/test/lifo_price.yml b/addons/stock_complex_routes/test/lifo_price.yml index 8365eb79f48..4bf1922c251 100644 --- a/addons/stock_complex_routes/test/lifo_price.yml +++ b/addons/stock_complex_routes/test/lifo_price.yml @@ -1,7 +1,7 @@ - Set product category removal strategy as LIFO - - !record {model: product.category, id: product.product_category_001}: + !record {model: product.category, id: product.product_category_001}: name : Lifo Category removal_strategy_ids: - product_categ_id: product.product_category_1