diff --git a/addons/claim_from_delivery/__openerp__.py b/addons/claim_from_delivery/__openerp__.py index 9c4395927af..9e3f7f59ca2 100644 --- a/addons/claim_from_delivery/__openerp__.py +++ b/addons/claim_from_delivery/__openerp__.py @@ -30,7 +30,9 @@ Create a claim from a delivery order. Adds a Claim link to the delivery order. """, - 'data' : ['claim_delivery_view.xml'], + 'data' : [ + 'claim_delivery_view.xml', + 'claim_delivery_data.xml',], 'auto_install': False, 'installable': True, 'certificate' : '001101649349223746957', diff --git a/addons/claim_from_delivery/claim_delivery_data.xml b/addons/claim_from_delivery/claim_delivery_data.xml new file mode 100644 index 00000000000..1b69087d4b8 --- /dev/null +++ b/addons/claim_from_delivery/claim_delivery_data.xml @@ -0,0 +1,11 @@ + + + + + + Delivery Order + stock.picking.out + + + + diff --git a/addons/claim_from_delivery/claim_delivery_view.xml b/addons/claim_from_delivery/claim_delivery_view.xml index f345484b4a9..9187b1d11ca 100644 --- a/addons/claim_from_delivery/claim_delivery_view.xml +++ b/addons/claim_from_delivery/claim_delivery_view.xml @@ -1,11 +1,27 @@ - + + Claim From Delivery + crm.claim + form + + {'default_ref': 'stock.picking.out,'+str(context.get('active_id', False))} + [('ref','=','stock.picking.out,'+str(context.get('active_id',False)))] + + + + crm.claim.from_delivery.form + stock.picking.out + + + +
+
+
+
+
diff --git a/addons/delivery/delivery_view.xml b/addons/delivery/delivery_view.xml index 6a68d1a979f..deb59983ef2 100644 --- a/addons/delivery/delivery_view.xml +++ b/addons/delivery/delivery_view.xml @@ -259,10 +259,10 @@ stock.picking_withweight.internal.move.form.view - stock.picking - + stock.move + - + @@ -306,7 +306,7 @@ stock.picking.out.form - stock.picking + stock.picking.out diff --git a/addons/mrp/board_manufacturing_view.xml b/addons/mrp/board_manufacturing_view.xml index cae1fea07dc..6bd07c2648b 100644 --- a/addons/mrp/board_manufacturing_view.xml +++ b/addons/mrp/board_manufacturing_view.xml @@ -30,7 +30,8 @@ icon="terp-graph" id="menu_board_manufacturing" parent="base.menu_reporting_dashboard" - sequence="30"/> + sequence="30" + groups="group_mrp_manager"/> diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py index ec1dc4b26fb..842f9ec27fa 100644 --- a/addons/procurement/procurement.py +++ b/addons/procurement/procurement.py @@ -554,7 +554,7 @@ class stock_warehouse_orderpoint(osv.osv): 'logic': fields.selection([('max','Order to Max'),('price','Best price (not yet active!)')], 'Reordering Mode', required=True), 'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True, ondelete="cascade"), 'location_id': fields.many2one('stock.location', 'Location', required=True, ondelete="cascade"), - 'product_id': fields.many2one('product.product', 'Product', required=True, ondelete='cascade', domain=[('type','=','product')]), + 'product_id': fields.many2one('product.product', 'Product', required=True, ondelete='cascade', domain=[('type','!=','service')]), 'product_uom': fields.many2one('product.uom', 'Product Unit of Measure', required=True), 'product_min_qty': fields.float('Minimum Quantity', required=True, help="When the virtual stock goes below the Min Quantity specified for this field, OpenERP generates "\ diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 1f6279af3ad..e982930d69e 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -548,6 +548,7 @@ class purchase_order(osv.osv): 'partner_id': order.dest_address_id.id or order.partner_id.id, 'move_dest_id': order_line.move_dest_id.id, 'state': 'draft', + 'type':'in', 'purchase_line_id': order_line.id, 'company_id': order.company_id.id, 'price_unit': order_line.price_unit diff --git a/addons/purchase/stock_view.xml b/addons/purchase/stock_view.xml index b522618ed2e..21c52b4d2ec 100644 --- a/addons/purchase/stock_view.xml +++ b/addons/purchase/stock_view.xml @@ -31,7 +31,7 @@ - + diff --git a/addons/sale/sale.py b/addons/sale/sale.py index c288d4fc67e..6b3a9bd0598 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -883,6 +883,7 @@ class sale_order(osv.osv): 'sale_line_id': line.id, 'tracking_id': False, 'state': 'draft', + 'type':'out', #'state': 'waiting', 'note': '\n'.join(line.name.split('\n')[1:]), 'company_id': order.company_id.id, diff --git a/addons/sale/stock_view.xml b/addons/sale/stock_view.xml index eb0f1e415f5..0eb64f98e9b 100644 --- a/addons/sale/stock_view.xml +++ b/addons/sale/stock_view.xml @@ -9,9 +9,6 @@ - diff --git a/addons/stock/board_warehouse_view.xml b/addons/stock/board_warehouse_view.xml index b223e731e8f..839a99c1fa7 100644 --- a/addons/stock/board_warehouse_view.xml +++ b/addons/stock/board_warehouse_view.xml @@ -61,7 +61,7 @@ parent="base.menu_reporting_dashboard" action="open_board_warehouse" sequence="25" - groups="group_stock_manager"/> + groups="stock.group_stock_user"/> diff --git a/addons/stock/report/report_stock_move_view.xml b/addons/stock/report/report_stock_move_view.xml index a78a506cefe..4c911dd6e7c 100644 --- a/addons/stock/report/report_stock_move_view.xml +++ b/addons/stock/report/report_stock_move_view.xml @@ -6,7 +6,8 @@ id="stock.next_id_61" name="Warehouse" sequence="15" - parent="base.menu_reporting"/> + parent="base.menu_reporting" + groups="group_stock_manager"/> report.stock.move.tree diff --git a/addons/stock/security/ir.model.access.csv b/addons/stock/security/ir.model.access.csv index f56696bcbaa..b0ae333a9ef 100644 --- a/addons/stock/security/ir.model.access.csv +++ b/addons/stock/security/ir.model.access.csv @@ -21,11 +21,11 @@ access_stock_production_lot_manager,stock.production.lot manager,model_stock_pro access_stock_production_lot_user,stock.production.lot user,model_stock_production_lot,stock.group_stock_user,1,1,1,1 access_stock_production_lot_revision,stock.production.lot.revision,model_stock_production_lot_revision,stock.group_stock_user,1,1,1,1 access_stock_move_manager,stock.move manager,model_stock_move,stock.group_stock_manager,1,1,0,0 -access_stock_move_user,stock.move user,model_stock_move,stock.group_stock_user,1,0,0,0 +access_stock_move_user,stock.move user,model_stock_move,stock.group_stock_user,1,1,1,0 access_stock_move_warehouse_manager,stock.move.manager,model_stock_move,stock.group_stock_manager,1,1,1,1 -access_stock_inventory_user,stock.inventory user,model_stock_inventory,stock.group_stock_user,1,0,0,0 +access_stock_inventory_user,stock.inventory user,model_stock_inventory,stock.group_stock_user,1,1,1,0 access_stock_inventory_manager,stock.inventory manager,model_stock_inventory,stock.group_stock_manager,1,1,1,1 -access_stock_inventory_line_user,stock.inventory.line user,model_stock_inventory_line,stock.group_stock_user,1,0,0,0 +access_stock_inventory_line_user,stock.inventory.line user,model_stock_inventory_line,stock.group_stock_user,1,1,1,0 access_stock_inventory_line_manager,stock.inventory.line manager,model_stock_inventory_line,stock.group_stock_manager,1,1,1,1 access_stock_report_prodlots,stock.report.prodlots,model_stock_report_prodlots,stock.group_stock_manager,1,0,0,0 access_stock_location_sale_manager,stock.location sale manager,model_stock_location,base.group_sale_manager,1,0,0,0 @@ -61,3 +61,4 @@ access_product_group_res_partner_stock_manager,res_partner group_stock_manager,b access_product_pricelist_version_stock_manager,product.pricelist.version stock_manager,product.model_product_pricelist_version,stock.group_stock_manager,1,1,1,1 access_product_pricelist_item_stock_manager,product.pricelist.item stock_manager,product.model_product_pricelist_item,stock.group_stock_manager,1,1,1,1 access_account_account_stock_manager,account.account stock manager,account.model_account_account,stock.group_stock_manager,1,0,0,0 +access_board_stock_user,board.board user,board.model_board_board,stock.group_stock_user,1,1,0,0 diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 31d5a68c9fe..041950df281 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1659,6 +1659,7 @@ class stock_move(osv.osv): # used for colors in tree views: 'scrapped': fields.related('location_dest_id','scrap_location',type='boolean',relation='stock.location',string='Scrapped', readonly=True), + 'type': fields.related('picking_id', 'type', type='selection', selection=[('out', 'Sending Goods'), ('in', 'Getting Goods'), ('internal', 'Internal')], string='Shipping Type'), } def _check_location(self, cr, uid, ids, context=None): for record in self.browse(cr, uid, ids, context=context): @@ -1738,10 +1739,25 @@ class stock_move(osv.osv): user = self.pool.get('res.users').browse(cr, uid, uid, context=context) return user.company_id.partner_id.id + def _default_move_type(self, cr, uid, context=None): + """ Gets default type of move + @return: type + """ + if context is None: + context = {} + picking_type = context.get('picking_type') + type = 'internal' + if picking_type == 'in': + type = 'in' + elif picking_type == 'out': + type = 'out' + return type + _defaults = { 'location_id': _default_location_source, 'location_dest_id': _default_location_destination, 'partner_id': _default_destination_address, + 'type': _default_move_type, 'state': 'draft', 'priority': '1', 'product_qty': 1.0, @@ -1895,6 +1911,32 @@ class stock_move(osv.osv): result['location_dest_id'] = loc_dest_id return {'value': result} + def onchange_move_type(self, cr, uid, ids, type, context=None): + """ On change of move type gives sorce and destination location. + @param type: Move Type + @return: Dictionary of values + """ + mod_obj = self.pool.get('ir.model.data') + location_source_id = False + location_dest_id = False + if type == 'in': + location_source_id = 'stock_location_suppliers' + location_dest_id = 'stock_location_stock' + elif type == 'out': + location_source_id = 'stock_location_stock' + location_dest_id = 'stock_location_customers' + if location_source_id: + try: + location_model, location_source_id = mod_obj.get_object_reference(cr, uid, 'stock', location_source_id) + except ValueError, e: + location_source_id = False + if location_dest_id: + try: + location_model, location_dest_id = mod_obj.get_object_reference(cr, uid, 'stock', location_dest_id) + except ValueError, e: + location_dest_id = False + return {'value':{'location_id': location_source_id, 'location_dest_id': location_dest_id}} + def onchange_date(self, cr, uid, ids, date, date_expected, context=None): """ On change of Scheduled Date gives a Move date. @param date_expected: Scheduled Date diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml index 154927a2f19..de4913d01d1 100644 --- a/addons/stock/stock_view.xml +++ b/addons/stock/stock_view.xml @@ -106,13 +106,16 @@
-
+
+
@@ -231,9 +234,9 @@ -