[MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 10025 rev-id odo@openerp...
[odoo/odoo.git] / addons / stock / product.py
index 5db1e1b..1cd9322 100644 (file)
@@ -206,7 +206,6 @@ class product_product(osv.osv):
         
         location_obj = self.pool.get('stock.location')
         warehouse_obj = self.pool.get('stock.warehouse')
-        shop_obj = self.pool.get('sale.shop')
         
         states = context.get('states',[])
         what = context.get('what',())
@@ -216,11 +215,6 @@ class product_product(osv.osv):
         if not ids:
             return res
 
-        if context.get('shop', False):
-            warehouse_id = shop_obj.read(cr, uid, int(context['shop']), ['warehouse_id'])['warehouse_id'][0]
-            if warehouse_id:
-                context['warehouse'] = warehouse_id
-
         if context.get('warehouse', False):
             lot_id = warehouse_obj.read(cr, uid, int(context['warehouse']), ['lot_stock_id'])['lot_stock_id'][0]
             if lot_id:
@@ -373,7 +367,6 @@ class product_product(osv.osv):
                  "In a context with a single Warehouse, this includes "
                  "goods stored in the Stock Location of this Warehouse, or any "
                  "of its children.\n"
-                 "In a context with a single Shop, this includes goods "
                  "stored in the Stock Location of the Warehouse of this Shop, "
                  "or any of its children.\n"
                  "Otherwise, this includes goods stored in any Stock Location "
@@ -388,9 +381,6 @@ class product_product(osv.osv):
                  "In a context with a single Warehouse, this includes "
                  "goods stored in the Stock Location of this Warehouse, or any "
                  "of its children.\n"
-                 "In a context with a single Shop, this includes goods "
-                 "stored in the Stock Location of the Warehouse of this Shop, "
-                 "or any of its children.\n"
                  "Otherwise, this includes goods stored in any Stock Location "
                  "with 'internal' type."),
         'incoming_qty': fields.function(_product_available, multi='qty_available',
@@ -402,9 +392,6 @@ class product_product(osv.osv):
                  "In a context with a single Warehouse, this includes "
                  "goods arriving to the Stock Location of this Warehouse, or "
                  "any of its children.\n"
-                 "In a context with a single Shop, this includes goods "
-                 "arriving to the Stock Location of the Warehouse of this "
-                 "Shop, or any of its children.\n"
                  "Otherwise, this includes goods arriving to any Stock "
                  "Location with 'internal' type."),
         'outgoing_qty': fields.function(_product_available, multi='qty_available',
@@ -416,9 +403,6 @@ class product_product(osv.osv):
                  "In a context with a single Warehouse, this includes "
                  "goods leaving the Stock Location of this Warehouse, or "
                  "any of its children.\n"
-                 "In a context with a single Shop, this includes goods "
-                 "leaving the Stock Location of the Warehouse of this "
-                 "Shop, or any of its children.\n"
                  "Otherwise, this includes goods leaving any Stock "
                  "Location with 'internal' type."),
         'track_production': fields.boolean('Track Manufacturing Lots', help="Forces to specify a Serial Number for all moves containing this product and generated by a Manufacturing Order"),
@@ -480,44 +464,39 @@ class product_product(osv.osv):
                         res['fields']['qty_available']['string'] = _('Produced Qty')
         return res
 
-product_product()
 
 class product_template(osv.osv):
     _name = 'product.template'
     _inherit = 'product.template'
     _columns = {
         'property_stock_procurement': fields.property(
-            'stock.location',
             type='many2one',
             relation='stock.location',
             string="Procurement Location",
-            view_load=True,
             domain=[('usage','like','procurement')],
             help="This stock location will be used, instead of the default one, as the source location for stock moves generated by procurements."),
         'property_stock_production': fields.property(
-            'stock.location',
             type='many2one',
             relation='stock.location',
             string="Production Location",
-            view_load=True,
             domain=[('usage','like','production')],
             help="This stock location will be used, instead of the default one, as the source location for stock moves generated by manufacturing orders."),
         'property_stock_inventory': fields.property(
-            'stock.location',
             type='many2one',
             relation='stock.location',
             string="Inventory Location",
-            view_load=True,
             domain=[('usage','like','inventory')],
             help="This stock location will be used, instead of the default one, as the source location for stock moves generated when you do an inventory."),
-        'property_stock_account_input': fields.property('account.account',
-            type='many2one', relation='account.account',
-            string='Stock Input Account', view_load=True,
+        'property_stock_account_input': fields.property(
+            type='many2one',
+            relation='account.account',
+            string='Stock Input Account',
             help="When doing real-time inventory valuation, counterpart journal items for all incoming stock moves will be posted in this account, unless "
                  "there is a specific valuation account set on the source location. When not set on the product, the one from the product category is used."),
-        'property_stock_account_output': fields.property('account.account',
-            type='many2one', relation='account.account',
-            string='Stock Output Account', view_load=True,
+        'property_stock_account_output': fields.property(
+            type='many2one',
+            relation='account.account',
+            string='Stock Output Account',
             help="When doing real-time inventory valuation, counterpart journal items for all outgoing stock moves will be posted in this account, unless "
                  "there is a specific valuation account set on the destination location. When not set on the product, the one from the product category is used."),
         'sale_delay': fields.float('Customer Lead Time', help="The average delay in days between the confirmation of the customer order and the delivery of the finished products. It's the time you promise to your customers."),
@@ -529,36 +508,36 @@ class product_template(osv.osv):
     _defaults = {
         'sale_delay': 7,
     }
-product_template()
 
 class product_category(osv.osv):
 
     _inherit = 'product.category'
     _columns = {
-        'property_stock_journal': fields.property('account.journal',
-            relation='account.journal', type='many2one',
-            string='Stock Journal', view_load=True,
+        'property_stock_journal': fields.property(
+            relation='account.journal',
+            type='many2one',
+            string='Stock Journal',
             help="When doing real-time inventory valuation, this is the Accounting Journal in which entries will be automatically posted when stock moves are processed."),
-        'property_stock_account_input_categ': fields.property('account.account',
-            type='many2one', relation='account.account',
-            string='Stock Input Account', view_load=True,
+        'property_stock_account_input_categ': fields.property(
+            type='many2one',
+            relation='account.account',
+            string='Stock Input Account',
             help="When doing real-time inventory valuation, counterpart journal items for all incoming stock moves will be posted in this account, unless "
                  "there is a specific valuation account set on the source location. This is the default value for all products in this category. It "
                  "can also directly be set on each product"),
-        'property_stock_account_output_categ': fields.property('account.account',
-            type='many2one', relation='account.account',
-            string='Stock Output Account', view_load=True,
+        'property_stock_account_output_categ': fields.property(
+            type='many2one',
+            relation='account.account',
+            string='Stock Output Account',
             help="When doing real-time inventory valuation, counterpart journal items for all outgoing stock moves will be posted in this account, unless "
                  "there is a specific valuation account set on the destination location. This is the default value for all products in this category. It "
                  "can also directly be set on each product"),
-        'property_stock_valuation_account_id': fields.property('account.account',
+        'property_stock_valuation_account_id': fields.property(
             type='many2one',
             relation='account.account',
             string="Stock Valuation Account",
-            view_load=True,
             help="When real-time inventory valuation is enabled on a product, this account will hold the current value of the products.",),
     }
 
-product_category()
 
 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: