From ed6a30946e8f3b7898c1328bc0e8a23cb23455d2 Mon Sep 17 00:00:00 2001 From: "Jitendra Prajapati (OpenERP)" Date: Fri, 6 Dec 2013 19:14:16 +0530 Subject: [PATCH 1/8] [IMP/FIX]create demo data. No Rule matching this procurement. remove brim warehouse and Birmingham shop location bzr revid: prajapatijitendra7969@gmail.com-20131206134416-9ian7wk7ipqev4fn --- addons/purchase/purchase_demo.xml | 24 +++ addons/stock/stock_demo.xml | 16 +- addons/stock/stock_demo.yml | 249 ++++++++++++++++++++-- addons/stock/stock_location_demo_cpu1.xml | 1 + 4 files changed, 252 insertions(+), 38 deletions(-) diff --git a/addons/purchase/purchase_demo.xml b/addons/purchase/purchase_demo.xml index c68ee8775bb..b1b1f808cba 100644 --- a/addons/purchase/purchase_demo.xml +++ b/addons/purchase/purchase_demo.xml @@ -17,6 +17,30 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/stock/stock_demo.xml b/addons/stock/stock_demo.xml index 6579628f83f..f10248d27a4 100644 --- a/addons/stock/stock_demo.xml +++ b/addons/stock/stock_demo.xml @@ -226,14 +226,7 @@ Your Company, Chicago shop - - - - - internal - - Your Company, Birmingham shop - + @@ -249,13 +242,6 @@ Chic - - Birmingham Warehouse - - - - Birm - diff --git a/addons/stock/stock_demo.yml b/addons/stock/stock_demo.yml index 0f365382f69..b71040f0f3b 100644 --- a/addons/stock/stock_demo.yml +++ b/addons/stock/stock_demo.yml @@ -1,16 +1,23 @@ - - !record {model: stock.location, id: location_refrigerator}: - name: Refrigerator - usage: internal -- - !record {model: stock.location, id: location_delivery_counter}: - name: Delivery Counter - usage: internal + !python {model: ir.model.data}: | + main_warehouse = self.pool.get('stock.warehouse').browse(cr, uid, ref('stock_warehouse_shop0'), context=context) + + #create xml ids for demo data that are widely used in tests or in other codes, for more convenience + xml_references = [ + {'name':'chi_picking_type_in','module':'stock', 'model':'stock.picking.type','res_id':main_warehouse.in_type_id.id}, + {'name':'chi_picking_type_out','module':'stock', 'model':'stock.picking.type','res_id':main_warehouse.out_type_id.id}, + ] + for xml_record in xml_references: + xml_ids = self.search(cr, uid, [('module', '=', xml_record['module']), ('model', '=', xml_record['model']), ('name', '=', xml_record['name'])], context=context) + if not xml_ids: + self.create(cr, uid, xml_record, context=context) + #avoid the xml id and the associated resource being dropped by the orm by manually making a hit on it + self._update_dummy(cr, uid, xml_record['model'], xml_record['module'], xml_record['name']) - !record {model: stock.location, id: location_refrigerator_small}: name: Small Refrigerator usage: internal - location_id: location_refrigerator + location_id: stock_location_14 - !record {model: stock.location, id: location_opening}: name: opening @@ -19,12 +26,6 @@ !record {model: stock.location, id: location_convenience_shop}: name: Convenient Store usage: supplier -- - !record {model: stock.warehouse, id: warehouse_icecream}: - name: Ice Cream Shop - code: ICE - lot_stock_id: location_refrigerator - code: Cream - !record {model: product.product, id: product_icecream}: default_code: 001 @@ -56,7 +57,7 @@ inventory_id: stock_inventory_icecream product_qty: 50.0 prod_lot_id: lot_icecream_0 - location_id: location_refrigerator + location_id: stock_location_14 - !record {model: stock.inventory.line, id: stock_inventory_line_icecream_lot1}: product_id: product_icecream @@ -64,16 +65,61 @@ inventory_id: stock_inventory_icecream product_qty: 40.0 prod_lot_id: lot_icecream_1 - location_id: location_refrigerator + location_id: stock_location_14 - Create STOCK_MOVE for OUT - - !record {model: stock.move, id: outgoing_shipment_icecream}: - product_id: product_icecream - product_uom: product.product_uom_kgm - product_uom_qty: 130.0 - location_id: location_refrigerator - location_dest_id: location_delivery_counter + !record {model: stock.picking, id: outgoing_shipment_main_warehouse}: + picking_type_id: stock.picking_type_out + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_27 + product_uom: product.product_uom_unit + product_uom_qty: 15.0 + picking_type_id: stock.picking_type_out + location_id: stock.stock_location_stock + location_dest_id: stock.stock_location_customers +- + !record {model: stock.picking, id: outgoing_shipment_main_warehouse1}: + picking_type_id: stock.picking_type_out + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_6 + product_uom: product.product_uom_unit + product_uom_qty: 180.0 + picking_type_id: stock.picking_type_out + location_id: stock.stock_location_stock + location_dest_id: stock.stock_location_customers + pack_operation_ids: + - product_id: product.product_product_48 + product_qty: 100 + product_uom_id: product.product_uom_unit +- + !record {model: stock.picking, id: outgoing_shipment_main_warehouse2}: + picking_type_id: stock.picking_type_out + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_31 + product_uom: product.product_uom_unit + product_uom_qty: 45.0 + picking_type_id: stock.picking_type_out + location_id: stock.stock_location_stock + location_dest_id: stock.stock_location_customers +- + !record {model: stock.picking, id: outgoing_shipment_main_warehouse3}: + picking_type_id: stock.picking_type_out + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_5 + product_uom: product.product_uom_unit + product_uom_qty: 75.0 + picking_type_id: stock.picking_type_out + location_id: stock.stock_location_stock + location_dest_id: stock.stock_location_customers - Create STOCK_PICKING for IN - @@ -88,4 +134,161 @@ product_uom_qty: 50.0 picking_type_id: stock.picking_type_in location_id: location_convenience_shop - location_dest_id: location_refrigerator + location_dest_id: stock_location_14 +- + !record {model: stock.picking, id: incomming_shipment1}: + picking_type_id: stock.picking_type_in + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_48 + product_uom: product.product_uom_unit + product_uom_qty: 35.0 + picking_type_id: stock.picking_type_in + location_id: stock.stock_location_suppliers + location_dest_id: stock.stock_location_stock +- + !record {model: stock.picking, id: incomming_shipment2}: + picking_type_id: stock.picking_type_in + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_22 + product_uom: product.product_uom_unit + product_uom_qty: 125.0 + picking_type_id: stock.picking_type_in + location_id: stock.stock_location_suppliers + location_dest_id: stock.stock_location_stock +- + !record {model: stock.picking, id: incomming_shipment3}: + picking_type_id: stock.picking_type_in + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_10 + product_uom: product.product_uom_unit + product_uom_qty: 120.0 + picking_type_id: stock.picking_type_in + location_id: stock.stock_location_suppliers + location_dest_id: stock.stock_location_stock +- + !record {model: stock.picking, id: incomming_shipment4}: + picking_type_id: stock.picking_type_in + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_31 + product_uom: product.product_uom_unit + product_uom_qty: 50.0 + picking_type_id: stock.picking_type_in + location_id: stock.stock_location_suppliers + location_dest_id: stock.stock_location_stock +- + Create STOCK_PICKING_IN for Chicago Warehouse +- + !record {model: stock.picking, id: incomming_chicago_warehouse}: + picking_type_id: chi_picking_type_in + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_9 + product_uom: product.product_uom_unit + product_uom_qty: 25.0 + picking_type_id: chi_picking_type_in + location_id: stock.stock_location_suppliers + location_dest_id: stock.stock_location_stock +- + !record {model: stock.picking, id: incomming_chicago_warehouse1}: + picking_type_id: chi_picking_type_in + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_48 + product_uom: product.product_uom_unit + product_uom_qty: 180.0 + picking_type_id: chi_picking_type_in + location_id: stock.stock_location_suppliers + location_dest_id: stock.stock_location_stock + state: done + pack_operation_ids: + - product_id: product.product_product_48 + product_qty: 100 + product_uom_id: product.product_uom_unit +- + !record {model: stock.picking, id: incomming_chicago_warehouse2}: + picking_type_id: chi_picking_type_in + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_32 + product_uom: product.product_uom_unit + product_uom_qty: 45.0 + picking_type_id: chi_picking_type_in + location_id: stock.stock_location_suppliers + location_dest_id: stock.stock_location_stock +- + !record {model: stock.picking, id: incomming_chicago_warehouse3}: + picking_type_id: chi_picking_type_in + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_22 + product_uom: product.product_uom_unit + product_uom_qty: 75.0 + picking_type_id: chi_picking_type_in + location_id: stock.stock_location_suppliers + location_dest_id: stock.stock_location_stock +- + Create STOCK_PICKING_OUT for Chicago Warehouse +- + !record {model: stock.picking, id: outgoing_chicago_warehouse}: + picking_type_id: chi_picking_type_out + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_27 + product_uom: product.product_uom_unit + product_uom_qty: 15.0 + picking_type_id: chi_picking_type_out + location_id: stock.stock_location_stock + location_dest_id: stock.stock_location_customers +- + !record {model: stock.picking, id: outgoing_chicago_warehouse1}: + picking_type_id: chi_picking_type_out + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_6 + product_uom: product.product_uom_unit + product_uom_qty: 180.0 + picking_type_id: chi_picking_type_out + location_id: stock.stock_location_stock + location_dest_id: stock.stock_location_customers + pack_operation_ids: + - product_id: product.product_product_48 + product_qty: 100 + product_uom_id: product.product_uom_unit +- + !record {model: stock.picking, id: outgoing_chicago_warehouse2}: + picking_type_id: chi_picking_type_out + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_31 + product_uom: product.product_uom_unit + product_uom_qty: 45.0 + picking_type_id: chi_picking_type_out + location_id: stock.stock_location_stock + location_dest_id: stock.stock_location_customers +- + !record {model: stock.picking, id: outgoing_chicago_warehouse3}: + picking_type_id: chi_picking_type_out + origin: 'back' + partner_id: base.res_partner_6 + move_lines: + - product_id: product.product_product_5 + product_uom: product.product_uom_unit + product_uom_qty: 75.0 + picking_type_id: chi_picking_type_out + location_id: stock.stock_location_stock + location_dest_id: stock.stock_location_customers \ No newline at end of file diff --git a/addons/stock/stock_location_demo_cpu1.xml b/addons/stock/stock_location_demo_cpu1.xml index f738f1e4faa..f23df5bf78c 100644 --- a/addons/stock/stock_location_demo_cpu1.xml +++ b/addons/stock/stock_location_demo_cpu1.xml @@ -6,6 +6,7 @@ Quality Location + True From d34ccfebb9e53609b9ff4307e58008113d8bfd40 Mon Sep 17 00:00:00 2001 From: "Jitendra Prajapati (OpenERP)" Date: Fri, 6 Dec 2013 19:36:59 +0530 Subject: [PATCH 2/8] [IMP]improve code bzr revid: prajapatijitendra7969@gmail.com-20131206140659-v20o352qjlb8p5s8 --- addons/purchase/purchase_stock_demo.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/purchase/purchase_stock_demo.yml b/addons/purchase/purchase_stock_demo.yml index eee20f7c2bc..a483c8301c6 100644 --- a/addons/purchase/purchase_stock_demo.yml +++ b/addons/purchase/purchase_stock_demo.yml @@ -1,7 +1,7 @@ - !python {model: stock.warehouse}: | pull_obj = self.pool.get('procurement.rule') - wh_to_assign = ['stock_warehouse_shop0','stock_warehouse_shop1','warehouse_icecream'] + wh_to_assign = ['stock_warehouse_shop0'] for wh_ref in wh_to_assign: warehouse = self.browse(cr, uid, ref('stock.' + wh_ref), context=context) #Force the rewriting of route and rule From 2db0d707f3c2295f5b86dced8ffb7ebb3e4ee7c2 Mon Sep 17 00:00:00 2001 From: "Jitendra Prajapati (OpenERP)" Date: Mon, 9 Dec 2013 15:30:05 +0530 Subject: [PATCH 3/8] [IMP]picking done bzr revid: prajapatijitendra7969@gmail.com-20131209100005-etewhv2si2gupr8v --- addons/purchase/purchase_demo.xml | 23 ---------------- addons/stock/stock_demo.yml | 46 ++++++++++++++++++------------- 2 files changed, 27 insertions(+), 42 deletions(-) diff --git a/addons/purchase/purchase_demo.xml b/addons/purchase/purchase_demo.xml index b1b1f808cba..982b192a67e 100644 --- a/addons/purchase/purchase_demo.xml +++ b/addons/purchase/purchase_demo.xml @@ -18,29 +18,6 @@ - - - - - - - - - - - - - - - - - - - - - - - diff --git a/addons/stock/stock_demo.yml b/addons/stock/stock_demo.yml index b71040f0f3b..79bd8a2fcb4 100644 --- a/addons/stock/stock_demo.yml +++ b/addons/stock/stock_demo.yml @@ -71,7 +71,7 @@ - !record {model: stock.picking, id: outgoing_shipment_main_warehouse}: picking_type_id: stock.picking_type_out - origin: 'back' + origin: 'outgoing shipment main_warehouse' partner_id: base.res_partner_6 move_lines: - product_id: product.product_product_27 @@ -83,7 +83,7 @@ - !record {model: stock.picking, id: outgoing_shipment_main_warehouse1}: picking_type_id: stock.picking_type_out - origin: 'back' + origin: 'outgoing shipment' partner_id: base.res_partner_6 move_lines: - product_id: product.product_product_6 @@ -93,13 +93,13 @@ location_id: stock.stock_location_stock location_dest_id: stock.stock_location_customers pack_operation_ids: - - product_id: product.product_product_48 + - product_id: product.product_product_6 product_qty: 100 product_uom_id: product.product_uom_unit - !record {model: stock.picking, id: outgoing_shipment_main_warehouse2}: picking_type_id: stock.picking_type_out - origin: 'back' + origin: 'outgoing shipment your_company warehouse' partner_id: base.res_partner_6 move_lines: - product_id: product.product_product_31 @@ -111,7 +111,7 @@ - !record {model: stock.picking, id: outgoing_shipment_main_warehouse3}: picking_type_id: stock.picking_type_out - origin: 'back' + origin: 'your company warehouse' partner_id: base.res_partner_6 move_lines: - product_id: product.product_product_5 @@ -138,7 +138,7 @@ - !record {model: stock.picking, id: incomming_shipment1}: picking_type_id: stock.picking_type_in - origin: 'back' + origin: 'incomming_shipment' partner_id: base.res_partner_6 move_lines: - product_id: product.product_product_48 @@ -150,7 +150,7 @@ - !record {model: stock.picking, id: incomming_shipment2}: picking_type_id: stock.picking_type_in - origin: 'back' + origin: 'incomming_shipment main_warehouse' partner_id: base.res_partner_6 move_lines: - product_id: product.product_product_22 @@ -162,7 +162,7 @@ - !record {model: stock.picking, id: incomming_shipment3}: picking_type_id: stock.picking_type_in - origin: 'back' + origin: 'incomming_shipment your_company warehouse' partner_id: base.res_partner_6 move_lines: - product_id: product.product_product_10 @@ -174,7 +174,7 @@ - !record {model: stock.picking, id: incomming_shipment4}: picking_type_id: stock.picking_type_in - origin: 'back' + origin: 'incomming_shipment_main_warehouse' partner_id: base.res_partner_6 move_lines: - product_id: product.product_product_31 @@ -188,7 +188,7 @@ - !record {model: stock.picking, id: incomming_chicago_warehouse}: picking_type_id: chi_picking_type_in - origin: 'back' + origin: 'incomming_chicago_warehouse' partner_id: base.res_partner_6 move_lines: - product_id: product.product_product_9 @@ -200,7 +200,7 @@ - !record {model: stock.picking, id: incomming_chicago_warehouse1}: picking_type_id: chi_picking_type_in - origin: 'back' + origin: 'incomming_shipment_chicago_warehouse' partner_id: base.res_partner_6 move_lines: - product_id: product.product_product_48 @@ -217,7 +217,7 @@ - !record {model: stock.picking, id: incomming_chicago_warehouse2}: picking_type_id: chi_picking_type_in - origin: 'back' + origin: 'incomming_shipment chicago_warehouse' partner_id: base.res_partner_6 move_lines: - product_id: product.product_product_32 @@ -229,7 +229,7 @@ - !record {model: stock.picking, id: incomming_chicago_warehouse3}: picking_type_id: chi_picking_type_in - origin: 'back' + origin: 'chicago_warehouse' partner_id: base.res_partner_6 move_lines: - product_id: product.product_product_22 @@ -243,7 +243,7 @@ - !record {model: stock.picking, id: outgoing_chicago_warehouse}: picking_type_id: chi_picking_type_out - origin: 'back' + origin: 'outgoing_chicago_warehouse' partner_id: base.res_partner_6 move_lines: - product_id: product.product_product_27 @@ -255,7 +255,7 @@ - !record {model: stock.picking, id: outgoing_chicago_warehouse1}: picking_type_id: chi_picking_type_out - origin: 'back' + origin: 'outgoing_shipment_chicago_warehouse' partner_id: base.res_partner_6 move_lines: - product_id: product.product_product_6 @@ -265,13 +265,13 @@ location_id: stock.stock_location_stock location_dest_id: stock.stock_location_customers pack_operation_ids: - - product_id: product.product_product_48 + - product_id: product.product_product_6 product_qty: 100 product_uom_id: product.product_uom_unit - !record {model: stock.picking, id: outgoing_chicago_warehouse2}: picking_type_id: chi_picking_type_out - origin: 'back' + origin: 'chicago_warehouse' partner_id: base.res_partner_6 move_lines: - product_id: product.product_product_31 @@ -283,7 +283,7 @@ - !record {model: stock.picking, id: outgoing_chicago_warehouse3}: picking_type_id: chi_picking_type_out - origin: 'back' + origin: 'outgoing chicago warehouse' partner_id: base.res_partner_6 move_lines: - product_id: product.product_product_5 @@ -291,4 +291,12 @@ product_uom_qty: 75.0 picking_type_id: chi_picking_type_out location_id: stock.stock_location_stock - location_dest_id: stock.stock_location_customers \ No newline at end of file + location_dest_id: stock.stock_location_customers +- + !python {model: stock.picking}: | + self.action_confirm(cr, uid, [ref('outgoing_shipment_main_warehouse'),ref('outgoing_shipment_main_warehouse1'),ref('incomming_shipment2'),ref('incomming_shipment1'),ref('incomming_shipment3'),ref('outgoing_chicago_warehouse3'),ref('outgoing_chicago_warehouse2'),ref('outgoing_chicago_warehouse1'),ref('incomming_chicago_warehouse1'),ref('incomming_chicago_warehouse2'),ref('incomming_chicago_warehouse3')], context=context) + record = self.browse(cr, uid, ref('outgoing_shipment_main_warehouse1'), context=context) + record_chi_in = self.browse(cr, uid, ref('incomming_chicago_warehouse1'), context=context) + record_chi_out = self.browse(cr, uid, ref('outgoing_chicago_warehouse1'), context=context) + if record.state != 'done' and record_chi_in.state != 'done' and record_chi_out.state != 'done': + self.do_transfer(cr, uid, [ref('outgoing_shipment_main_warehouse1'),ref('incomming_chicago_warehouse1'),ref('outgoing_chicago_warehouse1')], context=context) \ No newline at end of file From 9e6beb401ab8bc01263cb2988b5770aeb41cd1f7 Mon Sep 17 00:00:00 2001 From: "Jitendra Prajapati (OpenERP)" Date: Mon, 9 Dec 2013 17:46:42 +0530 Subject: [PATCH 4/8] [IMP]display data for sparkline tooltip and set date bzr revid: prajapatijitendra7969@gmail.com-20131209121642-6iznd4pcywclfe8w --- addons/stock/stock.py | 7 ++++++- addons/stock/stock_demo.yml | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index d67f98d8f6b..bcde852e71f 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -3425,6 +3425,11 @@ class stock_picking_type(osv.osv): group_begin_date = datetime.strptime(group['__domain'][0][2], tools.DEFAULT_SERVER_DATE_FORMAT) month_delta = relativedelta.relativedelta(month_begin, group_begin_date) section_result[10 - (month_delta.months + 1)] = {'value': group.get(value_field, 0), 'tooltip': group_begin_date.strftime('%B')} + inner_groupby = (group.get('__context', {})).get('group_by',[]) + if inner_groupby: + groupby_picking = obj.read_group(cr, uid, group.get('__domain'), read_fields, inner_groupby, context=context) + for groupby in groupby_picking: + section_result[10 - (month_delta.months + 1)]['value'] = groupby.get(value_field, 0) return section_result def _get_picking_data(self, cr, uid, ids, field_name, arg, context=None): @@ -3440,7 +3445,7 @@ class stock_picking_type(osv.osv): ('date', '>=', groupby_begin), ('date', '<', groupby_end), ] - res[id] = self.__get_bar_values(cr, uid, obj, created_domain, ['date'], 'picking_type_id_count', 'date', context=context) + res[id] = self.__get_bar_values(cr, uid, obj, created_domain, ['date','picking_type_id'], 'picking_type_id_count', ['date','picking_type_id'], context=context) return res def _get_picking_count(self, cr, uid, ids, field_names, arg, context=None): diff --git a/addons/stock/stock_demo.yml b/addons/stock/stock_demo.yml index 79bd8a2fcb4..24b17863949 100644 --- a/addons/stock/stock_demo.yml +++ b/addons/stock/stock_demo.yml @@ -85,6 +85,7 @@ picking_type_id: stock.picking_type_out origin: 'outgoing shipment' partner_id: base.res_partner_6 + date: !eval "'%s-%s-15' %(datetime.now().year,datetime.now().month-2)" move_lines: - product_id: product.product_product_6 product_uom: product.product_uom_unit @@ -101,6 +102,7 @@ picking_type_id: stock.picking_type_out origin: 'outgoing shipment your_company warehouse' partner_id: base.res_partner_6 + date: !eval "'%s-%s-15' %(datetime.now().year,datetime.now().month-1)" move_lines: - product_id: product.product_product_31 product_uom: product.product_uom_unit @@ -231,6 +233,7 @@ picking_type_id: chi_picking_type_in origin: 'chicago_warehouse' partner_id: base.res_partner_6 + date: !eval "'%s-%s-2' %(datetime.now().year,datetime.now().month-1)" move_lines: - product_id: product.product_product_22 product_uom: product.product_uom_unit @@ -299,4 +302,5 @@ record_chi_in = self.browse(cr, uid, ref('incomming_chicago_warehouse1'), context=context) record_chi_out = self.browse(cr, uid, ref('outgoing_chicago_warehouse1'), context=context) if record.state != 'done' and record_chi_in.state != 'done' and record_chi_out.state != 'done': + self.force_assign(cr, uid, [ref('outgoing_shipment_main_warehouse'),ref('outgoing_chicago_warehouse3'),ref('outgoing_shipment_main_warehouse2')], context=context) self.do_transfer(cr, uid, [ref('outgoing_shipment_main_warehouse1'),ref('incomming_chicago_warehouse1'),ref('outgoing_chicago_warehouse1')], context=context) \ No newline at end of file From 73046d5674c8c2478c9498238aeb7c4088e16efb Mon Sep 17 00:00:00 2001 From: "Jitendra Prajapati (OpenERP)" Date: Tue, 10 Dec 2013 11:41:06 +0530 Subject: [PATCH 5/8] [FIX/IMP]runbot and No Rule matching this procurement. add access rights bzr revid: prajapatijitendra7969@gmail.com-20131210061106-5uqo57njddem6tld --- .../test/workcenter_operations.yml | 1 + addons/purchase/purchase_demo.xml | 23 +++++++++++++++++++ addons/sale_stock/test/sale_stock_users.yml | 1 + addons/stock/security/stock_security.xml | 13 +++++------ 4 files changed, 31 insertions(+), 7 deletions(-) diff --git a/addons/mrp_operations/test/workcenter_operations.yml b/addons/mrp_operations/test/workcenter_operations.yml index 5355c9a989d..6e9beafa156 100644 --- a/addons/mrp_operations/test/workcenter_operations.yml +++ b/addons/mrp_operations/test/workcenter_operations.yml @@ -13,6 +13,7 @@ !record {model: res.users, id: res_mrp_operation_user}: groups_id: - mrp.group_mrp_user + - stock.group_stock_user - In order to test mrp_operations with OpenERP, I refer created production order of PC Assemble SC349 with routing - Manual Component's Assembly to test complete production process with respect of workcenter with giving access rights of MRP User. diff --git a/addons/purchase/purchase_demo.xml b/addons/purchase/purchase_demo.xml index 982b192a67e..b1b1f808cba 100644 --- a/addons/purchase/purchase_demo.xml +++ b/addons/purchase/purchase_demo.xml @@ -18,6 +18,29 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/addons/sale_stock/test/sale_stock_users.yml b/addons/sale_stock/test/sale_stock_users.yml index 34e00147c15..04152b43c9a 100644 --- a/addons/sale_stock/test/sale_stock_users.yml +++ b/addons/sale_stock/test/sale_stock_users.yml @@ -28,6 +28,7 @@ !record {model: res.users, id: res_sale_stock_salesman}: groups_id: - base.group_sale_salesman_all_leads + - stock.group_stock_user - Create a user as 'Stock User' - diff --git a/addons/stock/security/stock_security.xml b/addons/stock/security/stock_security.xml index 5f8d4a391a4..f90f0e3e07f 100644 --- a/addons/stock/security/stock_security.xml +++ b/addons/stock/security/stock_security.xml @@ -2,10 +2,15 @@ + + Manage Multiple Locations and Warehouses + + + User - + Manager @@ -29,12 +34,6 @@ - - Manage Push and Pull inventory flows - - - - Manage Different Stock Owners From 711be2f8a9bf2d5ebc1d8d0cf35de04aa6634cbe Mon Sep 17 00:00:00 2001 From: "Jitendra Prajapati (OpenERP)" Date: Wed, 11 Dec 2013 10:42:52 +0530 Subject: [PATCH 6/8] [IMP]improve code bzr revid: prajapatijitendra7969@gmail.com-20131211051252-bd4abmcsxfa9ccie --- addons/stock/security/stock_security.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/stock/security/stock_security.xml b/addons/stock/security/stock_security.xml index f90f0e3e07f..f53350fee1c 100644 --- a/addons/stock/security/stock_security.xml +++ b/addons/stock/security/stock_security.xml @@ -29,9 +29,9 @@ - - Manage Multiple Locations and Warehouses - + + Manage Push and Pull inventory flows + From ff68dceedbf402b8195b3ebac762966f8f6586a8 Mon Sep 17 00:00:00 2001 From: "Jitendra Prajapati (OpenERP)" Date: Wed, 11 Dec 2013 10:47:17 +0530 Subject: [PATCH 7/8] [MISC] bzr revid: prajapatijitendra7969@gmail.com-20131211051717-x1pfhml0kedmax50 --- addons/stock/security/stock_security.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/stock/security/stock_security.xml b/addons/stock/security/stock_security.xml index f53350fee1c..78d57242aec 100644 --- a/addons/stock/security/stock_security.xml +++ b/addons/stock/security/stock_security.xml @@ -30,8 +30,8 @@ - Manage Push and Pull inventory flows - + Manage Push and Pull inventory flows + From 7130496dcbdf86e092f72a961bc1d9d5829fec0c Mon Sep 17 00:00:00 2001 From: "Quentin (OpenERP)" Date: Thu, 12 Dec 2013 10:55:12 +0100 Subject: [PATCH 8/8] [FIX] stock: removed unecessary demo data for company2 (Brimingham), stock locations + fixed location used in stock move bzr revid: qdp-launchpad@openerp.com-20131212095512-4af332hwtht0865e --- addons/mrp/tests/test_multicompany.py | 2 +- addons/stock/stock_demo.xml | 47 --------------------------- addons/stock/stock_demo.yml | 37 +++++++++------------ 3 files changed, 16 insertions(+), 70 deletions(-) diff --git a/addons/mrp/tests/test_multicompany.py b/addons/mrp/tests/test_multicompany.py index 5d1a0a50bcb..1996136130d 100644 --- a/addons/mrp/tests/test_multicompany.py +++ b/addons/mrp/tests/test_multicompany.py @@ -35,7 +35,7 @@ class TestMrpMulticompany(common.TransactionCase): model, group_user_id = self.registry('ir.model.data').get_object_reference(cr, uid, 'base', 'group_user') model, group_stock_manager_id = self.registry('ir.model.data').get_object_reference(cr, uid, 'stock', 'group_stock_manager') - model, company_2_id = self.registry('ir.model.data').get_object_reference(cr, uid, 'stock', 'res_company_2') + model, company_2_id = self.registry('ir.model.data').get_object_reference(cr, uid, 'stock', 'res_company_1') self.multicompany_user_id = self.res_users.create(cr, uid, {'name': 'multicomp', 'login': 'multicomp', 'groups_id': [(6, 0, [group_user_id, group_stock_manager_id])], diff --git a/addons/stock/stock_demo.xml b/addons/stock/stock_demo.xml index f10248d27a4..252e860aefa 100644 --- a/addons/stock/stock_demo.xml +++ b/addons/stock/stock_demo.xml @@ -188,53 +188,6 @@ Your Company, Chicago shop - - - Your Company, Birmingham shop - - - - 1 - 82-85 Academy Avenue - Birmingham - B46 3AG - - +44 121 690 4596 - birmingham@yourcompany.com - www.yourcompany.com - - - - Donald Thompson - - - - - - - - - Your Company, Birmingham shop - - - - - - - - internal - - Your Company, Chicago shop - - - - - - transit - Internal Shippings - - - Chicago Warehouse diff --git a/addons/stock/stock_demo.yml b/addons/stock/stock_demo.yml index 24b17863949..3b90afe52b3 100644 --- a/addons/stock/stock_demo.yml +++ b/addons/stock/stock_demo.yml @@ -1,11 +1,12 @@ - !python {model: ir.model.data}: | - main_warehouse = self.pool.get('stock.warehouse').browse(cr, uid, ref('stock_warehouse_shop0'), context=context) + chicago_warehouse = self.pool.get('stock.warehouse').browse(cr, uid, ref('stock_warehouse_shop0'), context=context) #create xml ids for demo data that are widely used in tests or in other codes, for more convenience xml_references = [ - {'name':'chi_picking_type_in','module':'stock', 'model':'stock.picking.type','res_id':main_warehouse.in_type_id.id}, - {'name':'chi_picking_type_out','module':'stock', 'model':'stock.picking.type','res_id':main_warehouse.out_type_id.id}, + {'name':'chi_picking_type_in','module':'stock', 'model':'stock.picking.type','res_id': chicago_warehouse.in_type_id.id}, + {'name':'chi_picking_type_out','module':'stock', 'model':'stock.picking.type','res_id': chicago_warehouse.out_type_id.id}, + {'name':'stock_location_shop0','module':'stock', 'model':'stock.location','res_id': chicago_warehouse.lot_stock_id.id}, ] for xml_record in xml_references: xml_ids = self.search(cr, uid, [('module', '=', xml_record['module']), ('model', '=', xml_record['model']), ('name', '=', xml_record['name'])], context=context) @@ -18,14 +19,6 @@ name: Small Refrigerator usage: internal location_id: stock_location_14 -- - !record {model: stock.location, id: location_opening}: - name: opening - usage: inventory -- - !record {model: stock.location, id: location_convenience_shop}: - name: Convenient Store - usage: supplier - !record {model: product.product, id: product_icecream}: default_code: 001 @@ -36,7 +29,7 @@ standard_price: 70.0 uom_id: product.product_uom_kgm uom_po_id: product.product_uom_kgm - property_stock_inventory: location_opening + property_stock_inventory: location_inventory description: Ice cream can be mass-produced and thus is widely available in developed parts of the world. Ice cream can be purchased in large cartons (vats and squrounds) from supermarkets and grocery stores, in smaller quantities from ice cream shops, convenience stores, and milk bars, and in individual servings from small carts or vans at public events. - !record {model: stock.production.lot, id: lot_icecream_0}: @@ -135,7 +128,7 @@ product_uom: product.product_uom_kgm product_uom_qty: 50.0 picking_type_id: stock.picking_type_in - location_id: location_convenience_shop + location_id: stock_location_suppliers location_dest_id: stock_location_14 - !record {model: stock.picking, id: incomming_shipment1}: @@ -198,7 +191,7 @@ product_uom_qty: 25.0 picking_type_id: chi_picking_type_in location_id: stock.stock_location_suppliers - location_dest_id: stock.stock_location_stock + location_dest_id: stock.stock_location_shop0 - !record {model: stock.picking, id: incomming_chicago_warehouse1}: picking_type_id: chi_picking_type_in @@ -210,7 +203,7 @@ product_uom_qty: 180.0 picking_type_id: chi_picking_type_in location_id: stock.stock_location_suppliers - location_dest_id: stock.stock_location_stock + location_dest_id: stock.stock_location_shop0 state: done pack_operation_ids: - product_id: product.product_product_48 @@ -227,7 +220,7 @@ product_uom_qty: 45.0 picking_type_id: chi_picking_type_in location_id: stock.stock_location_suppliers - location_dest_id: stock.stock_location_stock + location_dest_id: stock.stock_location_shop0 - !record {model: stock.picking, id: incomming_chicago_warehouse3}: picking_type_id: chi_picking_type_in @@ -240,7 +233,7 @@ product_uom_qty: 75.0 picking_type_id: chi_picking_type_in location_id: stock.stock_location_suppliers - location_dest_id: stock.stock_location_stock + location_dest_id: stock.stock_location_shop0 - Create STOCK_PICKING_OUT for Chicago Warehouse - @@ -253,7 +246,7 @@ product_uom: product.product_uom_unit product_uom_qty: 15.0 picking_type_id: chi_picking_type_out - location_id: stock.stock_location_stock + location_id: stock.stock_location_shop0 location_dest_id: stock.stock_location_customers - !record {model: stock.picking, id: outgoing_chicago_warehouse1}: @@ -265,7 +258,7 @@ product_uom: product.product_uom_unit product_uom_qty: 180.0 picking_type_id: chi_picking_type_out - location_id: stock.stock_location_stock + location_id: stock.stock_location_shop0 location_dest_id: stock.stock_location_customers pack_operation_ids: - product_id: product.product_product_6 @@ -281,7 +274,7 @@ product_uom: product.product_uom_unit product_uom_qty: 45.0 picking_type_id: chi_picking_type_out - location_id: stock.stock_location_stock + location_id: stock.stock_location_shop0 location_dest_id: stock.stock_location_customers - !record {model: stock.picking, id: outgoing_chicago_warehouse3}: @@ -293,7 +286,7 @@ product_uom: product.product_uom_unit product_uom_qty: 75.0 picking_type_id: chi_picking_type_out - location_id: stock.stock_location_stock + location_id: stock.stock_location_shop0 location_dest_id: stock.stock_location_customers - !python {model: stock.picking}: | @@ -303,4 +296,4 @@ record_chi_out = self.browse(cr, uid, ref('outgoing_chicago_warehouse1'), context=context) if record.state != 'done' and record_chi_in.state != 'done' and record_chi_out.state != 'done': self.force_assign(cr, uid, [ref('outgoing_shipment_main_warehouse'),ref('outgoing_chicago_warehouse3'),ref('outgoing_shipment_main_warehouse2')], context=context) - self.do_transfer(cr, uid, [ref('outgoing_shipment_main_warehouse1'),ref('incomming_chicago_warehouse1'),ref('outgoing_chicago_warehouse1')], context=context) \ No newline at end of file + self.do_transfer(cr, uid, [ref('outgoing_shipment_main_warehouse1'),ref('incomming_chicago_warehouse1'),ref('outgoing_chicago_warehouse1')], context=context)