).
#
@@ -15,7 +15,7 @@
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
+# along with this program. If not, see .
#
##############################################################################
@@ -23,29 +23,27 @@ from osv import fields, osv
import ir
class res_partner(osv.osv):
- _name = 'res.partner'
_inherit = 'res.partner'
_columns = {
'property_stock_customer': fields.property(
'stock.location',
- type='many2one',
- relation='stock.location',
- string="Customer Location",
+ type='many2one',
+ relation='stock.location',
+ string="Customer Location",
method=True,
view_load=True,
help="This stock location will be used, instead of the default one, as the destination location for goods you send to this partner"),
+
'property_stock_supplier': fields.property(
'stock.location',
- type='many2one',
- relation='stock.location',
- string="Supplier Location",
+ type='many2one',
+ relation='stock.location',
+ string="Supplier Location",
method=True,
view_load=True,
help="This stock location will be used, instead of the default one, as the source location for goods you receive from the current partner"),
}
+
res_partner()
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/stock/partner_view.xml b/addons/stock/partner_view.xml
index 9ba4073e2e2..04cd0207dd3 100644
--- a/addons/stock/partner_view.xml
+++ b/addons/stock/partner_view.xml
@@ -22,4 +22,4 @@
-
+
\ No newline at end of file
diff --git a/addons/stock/product.py b/addons/stock/product.py
index 7c62599dac8..dfe6f82c30d 100644
--- a/addons/stock/product.py
+++ b/addons/stock/product.py
@@ -22,45 +22,46 @@
from osv import fields, osv
from tools.translate import _
-
class product_product(osv.osv):
_inherit = "product.product"
def get_product_accounts(self, cr, uid, product_id, context=None):
""" To get the stock input account, stock output account and stock journal related to product.
- @param product_id: product id
+ @param product_id: product id
@return: dictionary which contains information regarding stock input account, stock output account and stock journal
"""
- product_obj = self.pool.get('product.product').browse(cr, uid, product_id, context)
-
- stock_input_acc = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id or False
+ if context is None:
+ context = {}
+ product_obj = self.pool.get('product.product').browse(cr, uid, product_id, context=context)
+
+ stock_input_acc = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id or False
if not stock_input_acc:
stock_input_acc = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id or False
-
+
stock_output_acc = product_obj.property_stock_account_output and product_obj.property_stock_account_output.id or False
if not stock_output_acc:
stock_output_acc = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id or False
journal_id = product_obj.categ_id.property_stock_journal and product_obj.categ_id.property_stock_journal.id or False
account_variation = product_obj.categ_id.property_stock_variation and product_obj.categ_id.property_stock_variation.id or False
-
+
return {
- 'stock_account_input': stock_input_acc,
- 'stock_account_output': stock_output_acc,
- 'stock_journal': journal_id,
+ 'stock_account_input': stock_input_acc,
+ 'stock_account_output': stock_output_acc,
+ 'stock_journal': journal_id,
'property_stock_variation': account_variation
- }
+ }
def do_change_standard_price(self, cr, uid, ids, datas, context={}):
""" Changes the Standard Price of Product and creates an account move accordingly.
@param datas : dict. contain default datas like new_price, stock_output_account, stock_input_account, stock_journal
- @param context: A standard dictionary
- @return:
-
- """
+ @param context: A standard dictionary
+ @return:
+
+ """
location_obj = self.pool.get('stock.location')
move_obj = self.pool.get('account.move')
- move_line_obj = self.pool.get('account.move.line')
+ move_line_obj = self.pool.get('account.move.line')
new_price = datas.get('new_price', 0.0)
stock_output_acc = datas.get('stock_output_account', False)
@@ -71,7 +72,7 @@ class product_product(osv.osv):
account_variation = product_obj.categ_id.property_stock_variation
account_variation_id = account_variation and account_variation.id or False
if not account_variation_id: raise osv.except_osv(_('Error!'), _('Variation Account is not specified for Product Category: %s' % (product_obj.categ_id.name)))
- move_ids = []
+ move_ids = []
loc_ids = location_obj.search(cr, uid,[('usage','=','internal')])
for rec_id in ids:
for location in location_obj.browse(cr, uid, loc_ids):
@@ -79,14 +80,14 @@ class product_product(osv.osv):
c.update({
'location': location.id,
'compute_child': False
- })
-
+ })
+
product = self.browse(cr, uid, rec_id, context=c)
qty = product.qty_available
- diff = product.standard_price - new_price
+ diff = product.standard_price - new_price
if not diff: raise osv.except_osv(_('Error!'), _("Could not find any difference between standard price and new price!"))
if qty:
- company_id = location.company_id and location.company_id.id or False
+ company_id = location.company_id and location.company_id.id or False
if not company_id: raise osv.except_osv(_('Error!'), _('Company is not specified in Location'))
#
# Accounting Entries
@@ -100,10 +101,10 @@ class product_product(osv.osv):
(product.categ_id.name,
product.categ_id.id,))
move_id = move_obj.create(cr, uid, {
- 'journal_id': journal_id,
+ 'journal_id': journal_id,
'company_id': company_id
- })
-
+ })
+
move_ids.append(move_id)
@@ -120,7 +121,7 @@ class product_product(osv.osv):
'for this product: "%s" (id: %d)') % \
(product.name,
product.id,))
- amount_diff = qty * diff
+ amount_diff = qty * diff
move_line_obj.create(cr, uid, {
'name': product.name,
'account_id': stock_input_acc,
@@ -133,7 +134,7 @@ class product_product(osv.osv):
'credit': amount_diff,
'move_id': move_id
})
- elif diff < 0:
+ elif diff < 0:
if not stock_output_acc:
stock_output_acc = product.product_tmpl_id.\
property_stock_account_output.id
@@ -158,17 +159,19 @@ class product_product(osv.osv):
'account_id': account_variation_id,
'debit': amount_diff,
'move_id': move_id
- })
-
+ })
+
self.write(cr, uid, rec_id, {'standard_price': new_price})
return move_ids
- def view_header_get(self, cr, user, view_id, view_type, context):
+ def view_header_get(self, cr, user, view_id, view_type, context=None):
+ if context is None:
+ context = {}
res = super(product_product, self).view_header_get(cr, user, view_id, view_type, context)
if res: return res
- if (context.get('location', False)):
- return _('Products: ')+self.pool.get('stock.location').browse(cr, user, context['location'], context).name
+ if (context.get('active_id', False)) and (context.get('active_model') == 'stock.location'):
+ return _('Products: ')+self.pool.get('stock.location').browse(cr, user, context['active_id'], context).name
return res
def get_product_available(self, cr, uid, ids, context=None):
@@ -280,12 +283,14 @@ class product_product(osv.osv):
res[prod_id] -= amount
return res
- def _product_available(self, cr, uid, ids, field_names=None, arg=False, context={}):
+ def _product_available(self, cr, uid, ids, field_names=None, arg=False, context=None):
""" Finds the incoming and outgoing quantity of product.
@return: Dictionary of values
"""
if not field_names:
field_names = []
+ if context is None:
+ context = {}
res = {}
for id in ids:
res[id] = {}.fromkeys(field_names, 0.0)
@@ -323,7 +328,7 @@ class product_product(osv.osv):
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
res = super(product_product,self).fields_view_get(cr, uid, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
- if context == None:
+ if context is None:
context = {}
if ('location' in context) and context['location']:
location_info = self.pool.get('stock.location').browse(cr, uid, context['location'])
@@ -348,7 +353,7 @@ class product_product(osv.osv):
if location_info.usage == 'inventory':
if fields.get('virtual_available'):
res['fields']['virtual_available']['string'] = _('Future P&L')
- if fields.get('qty_available'):
+ if fields.get('qty_available'):
res['fields']['qty_available']['string'] = _('P&L Qty')
if location_info.usage == 'procurement':
@@ -362,10 +367,9 @@ class product_product(osv.osv):
res['fields']['virtual_available']['string'] = _('Future Productions')
if fields.get('qty_available'):
res['fields']['qty_available']['string'] = _('Produced Qty')
-
return res
-product_product()
+product_product()
class product_template(osv.osv):
_name = 'product.template'
@@ -407,10 +411,11 @@ class product_template(osv.osv):
string='Stock Output Account', method=True, view_load=True,
help='This account will be used, instead of the default one, to value output stock'),
}
+
product_template()
-
class product_category(osv.osv):
+
_inherit = 'product.category'
_columns = {
'property_stock_journal': fields.property('account.journal',
@@ -425,14 +430,14 @@ class product_category(osv.osv):
type='many2one', relation='account.account',
string='Stock Output Account', method=True, view_load=True,
help='This account will be used to value the output stock'),
- 'property_stock_variation': fields.property('account.account',
+ 'property_stock_variation': fields.property('account.account',
type='many2one',
relation='account.account',
string="Stock Variation Account",
- method=True, view_load=True,
+ method=True, view_load=True,
help="This account will be used in product when valuation type is real-time valuation ",),
}
+
product_category()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
diff --git a/addons/stock/product_data.xml b/addons/stock/product_data.xml
index b6f7b5aaa8b..ae5a3478500 100644
--- a/addons/stock/product_data.xml
+++ b/addons/stock/product_data.xml
@@ -32,6 +32,6 @@
-
+
-
+
\ No newline at end of file
diff --git a/addons/stock/report/picking.rml b/addons/stock/report/picking.rml
index 97510e31a64..68bae72ba84 100644
--- a/addons/stock/report/picking.rml
+++ b/addons/stock/report/picking.rml
@@ -208,7 +208,7 @@
[[ formatLang(picking.min_date,date_time = True) ]]
|
- [[ picking.weight or '']]
+ [[ 'weight' in picking._columns.keys() and picking.weight or '']]
|
diff --git a/addons/stock/report/report_stock_picking.py b/addons/stock/report/report_stock_picking.py
index 8dff4acf528..81f20ed8906 100644
--- a/addons/stock/report/report_stock_picking.py
+++ b/addons/stock/report/report_stock_picking.py
@@ -72,6 +72,7 @@ class report_stock_picking(osv.osv):
sp.address_id as partner_id,
to_date(to_char(sp.create_date, 'MM-dd-YYYY'),'MM-dd-YYYY') as date,
count(sm.id) as nbr,
+ count(sp.id) as nbp,
sum(sm.product_qty*u.factor) as product_qty,
sum(sm.product_uos_qty) as product_uos_qty,
sm.product_id as product_id,
diff --git a/addons/stock/security/ir.model.access.csv b/addons/stock/security/ir.model.access.csv
index 3ab3905f083..86d9cac4337 100644
--- a/addons/stock/security/ir.model.access.csv
+++ b/addons/stock/security/ir.model.access.csv
@@ -20,6 +20,6 @@
"access_stock_report_tracklots","stock.report.tracklots","model_stock_report_tracklots","stock.group_stock_user",1,1,1,1
"access_report_products_to_received_planned","report.products.to.received.planned","model_report_products_to_received_planned","stock.group_stock_user",1,1,1,1
"access_report_delivery_products_planned","report.delivery.products.planned","model_report_delivery_products_planned","stock.group_stock_user",1,1,1,1
-"access_stock_inventory_line_split","stock.inventory.line.split","model_stock_inventory_line_split","stock.group_stock_user",1,1,1,1
"access_report_stock_move","report.stock.move","model_report_stock_move","stock.group_stock_user",1,1,1,1
"access_report_stock_inventory","report.stock.inventory","model_report_stock_inventory","stock.group_stock_user",1,1,1,1
+"access_report_stock_picking","report.stock.picking","model_report_stock_picking","stock.group_stock_user",1,1,1,1
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 6873508023f..9bc40a1e691 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -37,12 +37,12 @@ class stock_incoterms(osv.osv):
_name = "stock.incoterms"
_description = "Incoterms"
_columns = {
- 'name': fields.char('Name', size=64, required=True,help="Incoterms are series of sales terms.They are used to divide transaction costs and responsibilities between buyer and seller and reflect state-of-the-art transportation practices."),
- 'code': fields.char('Code', size=3, required=True,help="Code for Incoterms"),
+ 'name': fields.char('Name', size=64, required=True, help="Incoterms are series of sales terms.They are used to divide transaction costs and responsibilities between buyer and seller and reflect state-of-the-art transportation practices."),
+ 'code': fields.char('Code', size=3, required=True, help="Code for Incoterms"),
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the incoterms without removing it."),
}
_defaults = {
- 'active': lambda *a: True,
+ 'active': True,
}
stock_incoterms()
@@ -52,11 +52,12 @@ class stock_journal(osv.osv):
_description = "Stock Journal"
_columns = {
'name': fields.char('Stock Journal', size=32, required=True),
- 'user_id': fields.many2one('res.users','Responsible'),
+ 'user_id': fields.many2one('res.users', 'Responsible'),
}
_defaults = {
- 'user_id': lambda s,c,u,ctx: u
+ 'user_id': lambda s, c, u, ctx: u
}
+
stock_journal()
#----------------------------------------------------------
@@ -70,22 +71,24 @@ class stock_location(osv.osv):
_parent_order = 'id'
_order = 'parent_left'
- def name_get(self, cr, uid, ids, context={}):
+ def name_get(self, cr, uid, ids, context=None):
+ res = []
+ if context is None:
+ context = {}
if not len(ids):
return []
- reads = self.read(cr, uid, ids, ['name','location_id'], context)
- res = []
+ reads = self.read(cr, uid, ids, ['name','location_id'], context=context)
for record in reads:
name = record['name']
if context.get('full',False):
if record['location_id']:
- name = record['location_id'][1]+' / '+name
+ name = record['location_id'][1] + ' / ' + name
res.append((record['id'], name))
else:
res.append((record['id'], name))
return res
- def _complete_name(self, cr, uid, ids, name, args, context):
+ def _complete_name(self, cr, uid, ids, name, args, context=None):
""" Forms complete name of location from parent location to child location.
@return: Dictionary of values
"""
@@ -100,7 +103,7 @@ class stock_location(osv.osv):
res[m.id] = _get_one_full_name(m)
return res
- def _product_qty_available(self, cr, uid, ids, field_names, arg, context={}):
+ def _product_qty_available(self, cr, uid, ids, field_names, arg, context=None):
""" Finds real and virtual quantity for product available at particular location.
@return: Dictionary of values
"""
@@ -119,7 +122,7 @@ class stock_location(osv.osv):
res[loc]['stock_virtual'] = prod.virtual_available
return res
- def product_detail(self, cr, uid, id, field, context={}):
+ def product_detail(self, cr, uid, id, field, context=None):
""" Finds detail of product like price type, currency and then calculates its price.
@param field: Field name
@return: Calculated price
@@ -128,6 +131,8 @@ class stock_location(osv.osv):
res[id] = {}
final_value = 0.0
field_to_read = 'virtual_available'
+ if context is None:
+ context = {}
if field == 'stock_real_value':
field_to_read = 'qty_available'
cr.execute('select distinct product_id from stock_move where (location_id=%s) or (location_dest_id=%s)', (id, id))
@@ -136,20 +141,18 @@ class stock_location(osv.osv):
# Choose the right filed standard_price to read
# Take the user company
price_type_id = self.pool.get('res.users').browse(cr,uid,uid).company_id.property_valuation_price_type.id
- pricetype = self.pool.get('product.price.type').browse(cr, uid, price_type_id)
+ pricetype = self.pool.get('product.price.type').browse(cr, uid, price_type_id, context=context)
for r in result:
c = (context or {}).copy()
c['location'] = id
product = self.pool.get('product.product').read(cr, uid, r['product_id'], [field_to_read], context=c)
# Compute the amount_unit in right currency
-
context['currency_id'] = self.pool.get('res.users').browse(cr,uid,uid).company_id.currency_id.id
amount_unit = self.pool.get('product.product').browse(cr,uid,r['product_id']).price_get(pricetype.field, context)[r['product_id']]
-
final_value += (product[field_to_read] * amount_unit)
return final_value
- def _product_value(self, cr, uid, ids, field_names, arg, context={}):
+ def _product_value(self, cr, uid, ids, field_names, arg, context=None):
""" Calculates real and virtual stock value of a product.
@param field_names: Name of field
@return: Dictionary of values
@@ -209,20 +212,20 @@ class stock_location(osv.osv):
'scrap_location': fields.boolean('Scrap Location', help='Check this box if the current location is a place for destroyed items'),
}
_defaults = {
- 'active': lambda *a: 1,
- 'usage': lambda *a: 'internal',
- 'allocation_method': lambda *a: 'fifo',
- 'chained_location_type': lambda *a: 'none',
- 'chained_auto_packing': lambda *a: 'manual',
- 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.location', context=c),
- 'posx': lambda *a: 0,
- 'posy': lambda *a: 0,
- 'posz': lambda *a: 0,
- 'icon': lambda *a: False,
- 'scrap_location': lambda *a: False,
+ 'active': True,
+ 'usage': 'internal',
+ 'allocation_method': 'fifo',
+ 'chained_location_type': 'none',
+ 'chained_auto_packing': 'manual',
+ 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.location', context=c),
+ 'posx': 0,
+ 'posy': 0,
+ 'posz': 0,
+ 'icon': False,
+ 'scrap_location': False,
}
- def chained_location_get(self, cr, uid, location, partner=None, product=None, context={}):
+ def chained_location_get(self, cr, uid, location, partner=None, product=None, context=None):
""" Finds chained location
@param location: Location id
@param partner: Partner id
@@ -239,7 +242,7 @@ class stock_location(osv.osv):
return result, location.chained_auto_packing, location.chained_delay, location.chained_journal_id and location.chained_journal_id.id or False, location.chained_company_id and location.chained_company_id.id or False, location.chained_picking_type
return result
- def picking_type_get(self, cr, uid, from_location, to_location, context={}):
+ def picking_type_get(self, cr, uid, from_location, to_location, context=None):
""" Gets type of picking.
@param from_location: Source location
@param to_location: Destination location
@@ -248,14 +251,12 @@ class stock_location(osv.osv):
result = 'internal'
if (from_location.usage=='internal') and (to_location and to_location.usage in ('customer', 'supplier')):
result = 'delivery'
- elif (from_location.usage in ('supplier', 'customer')) and (to_location.usage=='internal'):
+ elif (from_location.usage in ('supplier', 'customer')) and (to_location.usage == 'internal'):
result = 'in'
return result
- def _product_get_all_report(self, cr, uid, ids, product_ids=False,
- context=None):
- return self._product_get_report(cr, uid, ids, product_ids, context,
- recursive=True)
+ def _product_get_all_report(self, cr, uid, ids, product_ids=False, context=None):
+ return self._product_get_report(cr, uid, ids, product_ids, context, recursive=True)
def _product_get_report(self, cr, uid, ids, product_ids=False,
context=None, recursive=False):
@@ -323,7 +324,7 @@ class stock_location(osv.osv):
result['total_price'] = total_price
return result
- def _product_get_multi_location(self, cr, uid, ids, product_ids=False, context={},
+ def _product_get_multi_location(self, cr, uid, ids, product_ids=False, context=None,
states=['done'], what=('in', 'out')):
"""
@param product_ids: Ids of product
@@ -332,6 +333,8 @@ class stock_location(osv.osv):
@return:
"""
product_obj = self.pool.get('product.product')
+ if context is None:
+ context = {}
context.update({
'states': states,
'what': what,
@@ -339,22 +342,22 @@ class stock_location(osv.osv):
})
return product_obj.get_product_available(cr, uid, product_ids, context=context)
- def _product_get(self, cr, uid, id, product_ids=False, context={}, states=['done']):
+ def _product_get(self, cr, uid, id, product_ids=False, context=None, states=['done']):
"""
@param product_ids:
@param states:
@return:
"""
ids = id and [id] or []
- return self._product_get_multi_location(cr, uid, ids, product_ids, context, states)
+ return self._product_get_multi_location(cr, uid, ids, product_ids, context=context, states=states)
- def _product_all_get(self, cr, uid, id, product_ids=False, context={}, states=['done']):
+ def _product_all_get(self, cr, uid, id, product_ids=False, context=None, states=['done']):
# build the list of ids of children of the location given by id
ids = id and [id] or []
location_ids = self.search(cr, uid, [('location_id', 'child_of', ids)])
return self._product_get_multi_location(cr, uid, location_ids, product_ids, context, states)
- def _product_virtual_get(self, cr, uid, id, product_ids=False, context={}, states=['done']):
+ def _product_virtual_get(self, cr, uid, id, product_ids=False, context=None, states=['done']):
return self._product_all_get(cr, uid, id, product_ids, context, ['confirmed', 'waiting', 'assigned', 'done'])
#
@@ -364,7 +367,7 @@ class stock_location(osv.osv):
# Returns:
# [ (tracking_id, product_qty, location_id) ]
#
- def _product_reserve(self, cr, uid, ids, product_id, product_qty, context={}):
+ def _product_reserve(self, cr, uid, ids, product_id, product_qty, context=None):
"""
@param product_id: Id of product
@param product_qty: Quantity of product
@@ -372,6 +375,8 @@ class stock_location(osv.osv):
"""
result = []
amount = 0.0
+ if context is None:
+ context = {}
for id in self.search(cr, uid, [('location_id', 'child_of', ids)]):
cr.execute("select product_uom,sum(product_qty) as product_qty from stock_move where location_dest_id=%s and location_id<>%s and product_id=%s and state='done' group by product_uom", (id, id, product_id))
results = cr.dictfetchall()
@@ -416,7 +421,7 @@ class stock_tracking(osv.osv):
return (10 - (sum % 10)) % 10
checksum = staticmethod(checksum)
- def make_sscc(self, cr, uid, context={}):
+ def make_sscc(self, cr, uid, context=None):
sequence = self.pool.get('ir.sequence').get(cr, uid, 'stock.lot.tracking')
return sequence + str(self.checksum(sequence))
@@ -428,9 +433,9 @@ class stock_tracking(osv.osv):
'date': fields.datetime('Created Date', required=True),
}
_defaults = {
- 'active': lambda *a: 1,
+ 'active': 1,
'name': make_sscc,
- 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'date': time.strftime('%Y-%m-%d %H:%M:%S'),
}
def name_search(self, cr, user, name, args=None, operator='ilike', context=None, limit=100):
@@ -442,7 +447,7 @@ class stock_tracking(osv.osv):
ids += self.search(cr, user, [('name', operator, name)]+ args, limit=limit, context=context)
return self.name_get(cr, user, ids, context)
- def name_get(self, cr, uid, ids, context={}):
+ def name_get(self, cr, uid, ids, context=None):
if not len(ids):
return []
res = [(r['id'], r['name']+' ['+(r['serial'] or '')+']') for r in self.read(cr, uid, ids, ['name', 'serial'], context)]
@@ -453,7 +458,6 @@ class stock_tracking(osv.osv):
stock_tracking()
-
#----------------------------------------------------------
# Stock Picking
#----------------------------------------------------------
@@ -461,7 +465,7 @@ class stock_picking(osv.osv):
_name = "stock.picking"
_description = "Picking List"
- def _set_maximum_date(self, cr, uid, ids, name, value, arg, context):
+ def _set_maximum_date(self, cr, uid, ids, name, value, arg, context=None):
""" Calculates planned date if it is greater than 'value'.
@param name: Name of field
@param value: Value of field
@@ -483,7 +487,7 @@ class stock_picking(osv.osv):
cr.execute(sql_str)
return True
- def _set_minimum_date(self, cr, uid, ids, name, value, arg, context):
+ def _set_minimum_date(self, cr, uid, ids, name, value, arg, context=None):
""" Calculates planned date if it is less than 'value'.
@param name: Name of field
@param value: Value of field
@@ -494,7 +498,7 @@ class stock_picking(osv.osv):
return False
if isinstance(ids, (int, long)):
ids = [ids]
- for pick in self.browse(cr, uid, ids, context):
+ for pick in self.browse(cr, uid, ids, context=context):
sql_str = """update stock_move set
date_planned='%s'
where
@@ -504,7 +508,7 @@ class stock_picking(osv.osv):
cr.execute(sql_str)
return True
- def get_min_max_date(self, cr, uid, ids, field_name, arg, context={}):
+ def get_min_max_date(self, cr, uid, ids, field_name, arg, context=None):
""" Finds minimum and maximum dates for picking.
@return: Dictionary of values
"""
@@ -587,16 +591,16 @@ class stock_picking(osv.osv):
}
_defaults = {
'name': lambda self, cr, uid, context: '/',
- 'active': lambda *a: 1,
- 'state': lambda *a: 'draft',
- 'move_type': lambda *a: 'direct',
- 'type': lambda *a: 'in',
- 'invoice_state': lambda *a: 'none',
- 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
- 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.picking', context=c)
+ 'active': 1,
+ 'state': 'draft',
+ 'move_type': 'direct',
+ 'type': 'in',
+ 'invoice_state': 'none',
+ 'date': time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.picking', context=c)
}
- def copy(self, cr, uid, id, default=None, context={}):
+ def copy(self, cr, uid, id, default=None, context=None):
if default is None:
default = {}
default = default.copy()
@@ -604,16 +608,15 @@ class stock_picking(osv.osv):
if ('name' not in default) or (picking_obj.name=='/'):
seq_obj_name = 'stock.picking.' + picking_obj.type
default['name'] = self.pool.get('ir.sequence').get(cr, uid, seq_obj_name)
-
return super(stock_picking, self).copy(cr, uid, id, default, context)
- def onchange_partner_in(self, cr, uid, context, partner_id=None):
+ def onchange_partner_in(self, cr, uid, context=None, partner_id=None):
return {}
- def action_explode(self, cr, uid, moves, context={}):
+ def action_explode(self, cr, uid, moves, context=None):
return moves
- def action_confirm(self, cr, uid, ids, context={}):
+ def action_confirm(self, cr, uid, ids, context=None):
""" Confirms picking.
@return: True
"""
@@ -625,7 +628,7 @@ class stock_picking(osv.osv):
todo.append(r.id)
todo = self.action_explode(cr, uid, todo, context)
if len(todo):
- self.pool.get('stock.move').action_confirm(cr, uid, todo, context)
+ self.pool.get('stock.move').action_confirm(cr, uid, todo, context=context)
return True
def test_auto_picking(self, cr, uid, ids):
@@ -747,7 +750,7 @@ class stock_picking(osv.osv):
ok = ok and (move.state in ('cancel', 'done', 'assigned'))
return ok
- def action_cancel(self, cr, uid, ids, context={}):
+ def action_cancel(self, cr, uid, ids, context=None):
""" Changes picking state to cancel.
@return: True
"""
@@ -769,7 +772,7 @@ class stock_picking(osv.osv):
self.write(cr, uid, ids, {'state': 'done', 'date_done': time.strftime('%Y-%m-%d %H:%M:%S')})
return True
- def action_move(self, cr, uid, ids, context={}):
+ def action_move(self, cr, uid, ids, context=None):
""" Changes move state to assigned.
@return: True
"""
@@ -778,7 +781,6 @@ class stock_picking(osv.osv):
for move in pick.move_lines:
if move.state == 'assigned':
todo.append(move.id)
-
if len(todo):
self.pool.get('stock.move').action_done(cr, uid, todo,
context=context)
@@ -1005,7 +1007,10 @@ class stock_picking(osv.osv):
}, context=context)
return res
- def test_done(self, cr, uid, ids, context={}):
+ def test_done(self, cr, uid, ids, context=None):
+ """ Test whether the move lines are done or not.
+ @return: True or False
+ """
ok = False
for pick in self.browse(cr, uid, ids, context=context):
if not pick.move_lines:
@@ -1017,7 +1022,7 @@ class stock_picking(osv.osv):
ok = True
return ok
- def test_cancel(self, cr, uid, ids, context={}):
+ def test_cancel(self, cr, uid, ids, context=None):
""" Test whether the move lines are canceled or not.
@return: True or False
"""
@@ -1033,7 +1038,6 @@ class stock_picking(osv.osv):
move_obj = self.pool.get('stock.move')
if not context:
context = {}
-
for pick in self.browse(cr, uid, ids, context=context):
if pick.state in ['done','cancel']:
raise osv.except_osv(_('Error'), _('You cannot remove the picking which is in %s state !')%(pick.state,))
@@ -1049,7 +1053,7 @@ class stock_picking(osv.osv):
return super(stock_picking, self).unlink(cr, uid, ids, context=context)
- def do_partial(self, cr, uid, ids, partial_datas, context={}):
+ def do_partial(self, cr, uid, ids, partial_datas, context=None):
""" Makes partial picking and moves done.
@param partial_datas : Dictionary containing details of partial picking
like partner_id, address_id, delivery_date,
@@ -1057,7 +1061,6 @@ class stock_picking(osv.osv):
@return: Dictionary of values
"""
res = {}
-
move_obj = self.pool.get('stock.move')
product_obj = self.pool.get('product.product')
currency_obj = self.pool.get('res.currency')
@@ -1072,7 +1075,6 @@ class stock_picking(osv.osv):
for pick in self.browse(cr, uid, ids, context=context):
new_picking = None
new_moves = []
-
complete, too_many, too_few = [], [], []
move_product_qty = {}
for move in pick.move_lines:
@@ -1185,13 +1187,14 @@ class stock_picking(osv.osv):
delivered_pack = self.browse(cr, uid, delivered_pack_id, context=context)
res[pick.id] = {'delivered_picking': delivered_pack.id or False}
+
return res
stock_picking()
-
class stock_production_lot(osv.osv):
- def name_get(self, cr, uid, ids, context={}):
+
+ def name_get(self, cr, uid, ids, context=None):
if not ids:
return []
reads = self.read(cr, uid, ids, ['name', 'prefix', 'ref'], context)
@@ -1209,7 +1212,7 @@ class stock_production_lot(osv.osv):
_name = 'stock.production.lot'
_description = 'Production lot'
- def _get_stock(self, cr, uid, ids, field_name, arg, context={}):
+ def _get_stock(self, cr, uid, ids, field_name, arg, context=None):
""" Gets stock of products for locations
@return: Dictionary of values
"""
@@ -1231,9 +1234,10 @@ class stock_production_lot(osv.osv):
where
location_id IN %s and prodlot_id IN %s group by prodlot_id''',(tuple(locations),tuple(ids),))
res.update(dict(cr.fetchall()))
+
return res
- def _stock_search(self, cr, uid, obj, name, args, context):
+ def _stock_search(self, cr, uid, obj, name, args, context=None):
""" Searches Ids of products
@return: Ids of locations
"""
@@ -1261,7 +1265,7 @@ class stock_production_lot(osv.osv):
'company_id': fields.many2one('res.company','Company',select=1),
}
_defaults = {
- 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'date': time.strftime('%Y-%m-%d %H:%M:%S'),
'name': lambda x, y, z, c: x.pool.get('ir.sequence').get(y, z, 'stock.lot.serial'),
'product_id': lambda x, y, z, c: c.get('product_id', False),
}
@@ -1287,7 +1291,7 @@ class stock_production_lot_revision(osv.osv):
_defaults = {
'author_id': lambda x, y, z, c: z,
- 'date': lambda *a: time.strftime('%Y-%m-%d'),
+ 'date': time.strftime('%Y-%m-%d'),
}
stock_production_lot_revision()
@@ -1302,7 +1306,7 @@ stock_production_lot_revision()
#
class stock_move(osv.osv):
- def _getSSCC(self, cr, uid, context={}):
+ def _getSSCC(self, cr, uid, context=None):
cr.execute('select id from stock_tracking where create_uid=%s order by id desc limit 1', (uid,))
res = cr.fetchone()
return (res and res[0]) or False
@@ -1311,7 +1315,7 @@ class stock_move(osv.osv):
_order = 'date_expected desc, id'
_log_create = False
- def name_get(self, cr, uid, ids, context={}):
+ def name_get(self, cr, uid, ids, context=None):
res = []
for line in self.browse(cr, uid, ids, context):
res.append((line.id, (line.product_id.code or '/')+': '+line.location_id.name+' > '+line.location_dest_id.name))
@@ -1391,7 +1395,7 @@ class stock_move(osv.osv):
'You try to assign a lot which is not from the same product',
['prodlot_id'])]
- def _default_location_destination(self, cr, uid, context={}):
+ def _default_location_destination(self, cr, uid, context=None):
""" Gets default address of partner for destination location
@return: Address id or False
"""
@@ -1407,7 +1411,7 @@ class stock_move(osv.osv):
return property_out and property_out.id or False
return False
- def _default_location_source(self, cr, uid, context={}):
+ def _default_location_source(self, cr, uid, context=None):
""" Gets default address of partner for source location
@return: Address id or False
"""
@@ -1423,24 +1427,24 @@ class stock_move(osv.osv):
_defaults = {
'location_id': _default_location_source,
'location_dest_id': _default_location_destination,
- 'state': lambda *a: 'draft',
- 'priority': lambda *a: '1',
- 'product_qty': lambda *a: 1.0,
- 'scraped' : lambda *a: False,
- 'date_planned': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
- 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'state': 'draft',
+ 'priority': '1',
+ 'product_qty': 1.0,
+ 'scraped' : False,
+ 'date_planned': time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'date': time.strftime('%Y-%m-%d %H:%M:%S'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.move', context=c),
- 'date_expected': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'date_expected': time.strftime('%Y-%m-%d %H:%M:%S'),
}
- def copy(self, cr, uid, id, default=None, context={}):
+ def copy(self, cr, uid, id, default=None, context=None):
if default is None:
default = {}
default = default.copy()
- return super(stock_move, self).copy(cr, uid, id, default, context)
+ return super(stock_move, self).copy(cr, uid, id, default, context=context)
- def _auto_init(self, cursor, context):
- res = super(stock_move, self)._auto_init(cursor, context)
+ def _auto_init(self, cursor, context=None):
+ res = super(stock_move, self)._auto_init(cursor, context=context)
cursor.execute('SELECT indexname \
FROM pg_indexes \
WHERE indexname = \'stock_move_location_id_location_dest_id_product_id_state\'')
@@ -1533,7 +1537,7 @@ class stock_move(osv.osv):
result['location_dest_id'] = loc_dest_id
return {'value': result}
- def _chain_compute(self, cr, uid, moves, context={}):
+ def _chain_compute(self, cr, uid, moves, context=None):
""" Finds whether the location has chained location type or not.
@param moves: Stock moves
@return: Dictionary containing destination location with chained location type.
@@ -1559,7 +1563,7 @@ class stock_move(osv.osv):
result[m.picking_id].append( (m, dest) )
return result
- def action_confirm(self, cr, uid, ids, context={}):
+ def action_confirm(self, cr, uid, ids, context=None):
""" Confirms stock move.
@return: List of ids.
"""
@@ -1568,10 +1572,12 @@ class stock_move(osv.osv):
self.write(cr, uid, ids, {'state': 'confirmed'})
i = 0
- def create_chained_picking(self, cr, uid, moves, context):
+ def create_chained_picking(self, cr, uid, moves, context=None):
new_moves = []
res_obj = self.pool.get('res.company')
- for picking, todo in self._chain_compute(cr, uid, moves, context).items():
+ if context is None:
+ context = {}
+ for picking, todo in self._chain_compute(cr, uid, moves, context=context).items():
ptype = todo[0][1][5] and todo[0][1][5] or self.pool.get('stock.location').picking_type_get(cr, uid, todo[0][0].location_dest_id, todo[0][1][0])
pick_name = ''
if ptype == 'delivery':
@@ -1641,13 +1647,15 @@ class stock_move(osv.osv):
#
# Duplicate stock.move
#
- def check_assign(self, cr, uid, ids, context={}):
+ def check_assign(self, cr, uid, ids, context=None):
""" Checks the product type and accordingly writes the state.
@return: No. of moves done
"""
done = []
count = 0
pickings = {}
+ if context is None:
+ context = {}
for move in self.browse(cr, uid, ids, context=context):
if move.product_id.type == 'consu':
if move.state in ('confirmed', 'waiting'):
@@ -1697,12 +1705,14 @@ class stock_move(osv.osv):
#
# Cancel move => cancel others move and pickings
#
- def action_cancel(self, cr, uid, ids, context={}):
+ def action_cancel(self, cr, uid, ids, context=None):
""" Cancels the moves and if all moves are cancelled it cancels the picking.
@return: True
"""
if not len(ids):
return True
+ if context is None:
+ context = {}
pickings = {}
for move in self.browse(cr, uid, ids):
if move.state in ('confirmed', 'waiting', 'assigned', 'draft'):
@@ -1735,6 +1745,9 @@ class stock_move(osv.osv):
acc_variation = accounts['property_stock_variation']
journal_id = accounts['stock_journal']
+ if context is None:
+ context = {}
+
if not acc_src:
raise osv.except_osv(_('Error!'), _('There is no stock input account defined ' \
'for this product: "%s" (id: %d)') % \
@@ -1766,8 +1779,7 @@ class stock_move(osv.osv):
# amount = q * move.product_id.standard_price
return journal_id, acc_src, acc_dest, acc_variation, amount
-
- def action_done(self, cr, uid, ids, context={}):
+ def action_done(self, cr, uid, ids, context=None):
""" Makes the move done and if all moves are done, it will finish the picking.
@return:
"""
@@ -1775,8 +1787,10 @@ class stock_move(osv.osv):
picking_ids = []
product_uom_obj = self.pool.get('product.uom')
price_type_obj = self.pool.get('product.price.type')
- product_obj=self.pool.get('product.product')
+ product_obj = self.pool.get('product.product')
move_obj = self.pool.get('account.move')
+ if context is None:
+ context = {}
for move in self.browse(cr, uid, ids):
if move.picking_id:
picking_ids.append(move.picking_id.id)
@@ -1852,11 +1866,11 @@ class stock_move(osv.osv):
for (id,name) in picking_obj.name_get(cr, uid, picking_ids):
message = _('Document') + " '" + name + "' "+ _("is processed")
self.log(cr, uid, id, message)
-
return True
- def create_account_move(self, cr, uid, move,account_id,account_variation,amount, context=None):
-
+ def create_account_move(self, cr, uid, move,account_id, account_variation, amount, context=None):
+ if context is None:
+ context = {}
partner_id = move.picking_id.address_id and (move.picking_id.address_id.partner_id and move.picking_id.address_id.partner_id.id or False) or False
lines=[(0, 0, {
'name': move.name,
@@ -1939,6 +1953,8 @@ class stock_move(osv.osv):
@return: Splited move lines
"""
+ if context is None:
+ context = {}
if quantity <= 0:
raise osv.except_osv(_('Warning!'), _('Please provide Proper Quantity !'))
@@ -1999,7 +2015,6 @@ class stock_move(osv.osv):
"""
if context is None:
context = {}
-
if quantity <= 0:
raise osv.except_osv(_('Warning!'), _('Please provide Proper Quantity !'))
@@ -2030,7 +2045,6 @@ class stock_move(osv.osv):
else:
current_move = self.copy(cr, uid, move.id, default_val)
res += [current_move]
-
update_val = {}
update_val['product_qty'] = quantity_rest
update_val['product_uos_qty'] = uos_qty_rest
@@ -2039,7 +2053,6 @@ class stock_move(osv.osv):
else:
quantity_rest = quantity
uos_qty_rest = uos_qty
-
if move.product_id.track_production and location_id:
res += self.split_lines(cr, uid, [move.id], quantity_rest, split_by_qty=1, context=context)
else:
@@ -2051,11 +2064,11 @@ class stock_move(osv.osv):
}
self.write(cr, uid, [move.id], update_val)
-
self.action_done(cr, uid, res)
+
return res
- def do_partial(self, cr, uid, ids, partial_datas, context={}):
+ def do_partial(self, cr, uid, ids, partial_datas, context=None):
""" Makes partial pickings and moves done.
@param partial_datas: Dictionary containing details of partial picking
like partner_id, address_id, delivery_date, delivery
@@ -2073,9 +2086,11 @@ class stock_move(osv.osv):
partner_id = partial_datas.get('partner_id', False)
address_id = partial_datas.get('address_id', False)
delivery_date = partial_datas.get('delivery_date', False)
-
new_moves = []
+ if context is None:
+ context = {}
+
complete, too_many, too_few = [], [], []
move_product_qty = {}
for move in self.browse(cr, uid, ids, context=context):
@@ -2153,7 +2168,7 @@ class stock_move(osv.osv):
complete.append(move)
for move in complete:
- self.action_done(cr, uid, [move.id], context)
+ self.action_done(cr, uid, [move.id], context=context)
if move.picking_id.id :
# TOCHECK : Done picking if all moves are done
cr.execute("""
@@ -2174,7 +2189,6 @@ class stock_move(osv.osv):
stock_move()
-
class stock_inventory(osv.osv):
_name = "stock.inventory"
_description = "Inventory"
@@ -2188,12 +2202,11 @@ class stock_inventory(osv.osv):
'company_id': fields.many2one('res.company','Company',required=True,select=1),
}
_defaults = {
- 'date': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
- 'state': lambda *a: 'draft',
+ 'date': time.strftime('%Y-%m-%d %H:%M:%S'),
+ 'state': 'draft',
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.inventory', context=c)
}
-
def _inventory_line_hook(self, cr, uid, inventory_line, move_vals):
""" Creates a stock move from an inventory line
@param inventory_line:
@@ -2206,6 +2219,8 @@ class stock_inventory(osv.osv):
""" Finishes the inventory and writes its finished date
@return: True
"""
+ if context is None:
+ context = {}
for inv in self.browse(cr, uid, ids):
move_ids = []
move_line = []
@@ -2248,7 +2263,7 @@ class stock_inventory(osv.osv):
self.write(cr, uid, [inv.id], {'state': 'done', 'date_done': time.strftime('%Y-%m-%d %H:%M:%S'), 'move_ids': [(6, 0, move_ids)]})
return True
- def action_cancel(self, cr, uid, ids, context={}):
+ def action_cancel(self, cr, uid, ids, context=None):
""" Cancels the stock move and change inventory state to draft.
@return: True
"""
@@ -2257,7 +2272,7 @@ class stock_inventory(osv.osv):
self.write(cr, uid, [inv.id], {'state': 'draft'})
return True
- def action_cancel_inventary(self, cr, uid, ids, context={}):
+ def action_cancel_inventary(self, cr, uid, ids, context=None):
""" Cancels both stock move and inventory
@return: True
"""
@@ -2268,7 +2283,6 @@ class stock_inventory(osv.osv):
stock_inventory()
-
class stock_inventory_line(osv.osv):
_name = "stock.inventory.line"
_description = "Inventory Line"
@@ -2301,7 +2315,6 @@ class stock_inventory_line(osv.osv):
stock_inventory_line()
-
#----------------------------------------------------------
# Stock Warehouse
#----------------------------------------------------------
@@ -2318,8 +2331,9 @@ class stock_warehouse(osv.osv):
'lot_output_id': fields.many2one('stock.location', 'Location Output', required=True, domain=[('usage','<>','view')]),
}
_defaults = {
- 'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.inventory', context=c),
+ 'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'stock.inventory', context=c),
}
+
stock_warehouse()
@@ -2328,15 +2342,19 @@ stock_warehouse()
class stock_picking_move_wizard(osv.osv_memory):
_name = 'stock.picking.move.wizard'
- def _get_picking(self, cr, uid, ctx):
+ def _get_picking(self, cr, uid, ctx=None):
+ if ctx is None:
+ ctx = {}
if ctx.get('action_id', False):
return ctx['action_id']
return False
- def _get_picking_address(self, cr, uid, ctx):
+ def _get_picking_address(self, cr, uid, context=None):
picking_obj = self.pool.get('stock.picking')
- if ctx.get('action_id', False):
- picking = picking_obj.browse(cr, uid, [ctx['action_id']])[0]
+ if context is None:
+ context = {}
+ if context.get('action_id', False):
+ picking = picking_obj.browse(cr, uid, [context['action_id']])[0]
return picking.address_id and picking.address_id.id or False
return False
@@ -2382,7 +2400,6 @@ class report_products_to_received_planned(osv.osv):
'planned_qty': fields.integer('Planned Qty'),
}
-
def init(self, cr):
tools.drop_view_if_exists(cr, 'report_products_to_received_planned')
cr.execute("""
@@ -2404,6 +2421,7 @@ class report_products_to_received_planned(osv.osv):
group by stock.date_planned
)
""")
+
report_products_to_received_planned()
class report_delivery_products_planned(osv.osv):
@@ -2440,5 +2458,7 @@ class report_delivery_products_planned(osv.osv):
)
""")
+
report_delivery_products_planned()
+
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/stock_view.xml b/addons/stock/stock_view.xml
index 7cdcec6e281..2f9fe026a61 100644
--- a/addons/stock/stock_view.xml
+++ b/addons/stock/stock_view.xml
@@ -1,6 +1,7 @@
+
@@ -77,8 +78,8 @@
-
+
stock.inventory.form
stock.inventory
@@ -129,6 +130,7 @@
+
Periodical Inventory
ir.actions.act_window
@@ -636,18 +638,18 @@
@@ -686,14 +688,14 @@
-
@@ -806,9 +808,9 @@
-
@@ -1015,13 +1017,13 @@
groups="base.group_extended"/>
@@ -1055,12 +1057,12 @@
@@ -1214,11 +1216,11 @@
states="draft,waiting,confirmed,assigned" />
@@ -1252,7 +1254,7 @@
@@ -1399,16 +1401,16 @@
states="draft,waiting,confirmed,assigned" />
@@ -1470,12 +1472,12 @@
@@ -1568,12 +1570,12 @@
groups="base.group_extended"/>
@@ -1618,19 +1620,16 @@
-
-
@@ -1970,4 +1969,4 @@
parent="menu_warehouse_config" />
-
+
\ No newline at end of file
diff --git a/addons/stock/stock_wizard.xml b/addons/stock/stock_wizard.xml
deleted file mode 100644
index 42415139dc1..00000000000
--- a/addons/stock/stock_wizard.xml
+++ /dev/null
@@ -1,16 +0,0 @@
-
-
-
-
-
-
-
-
-
diff --git a/addons/stock/stock_workflow.xml b/addons/stock/stock_workflow.xml
index 3b9db02ce1f..3254f7b6984 100644
--- a/addons/stock/stock_workflow.xml
+++ b/addons/stock/stock_workflow.xml
@@ -1,6 +1,7 @@
+
stock.picking.basic
stock.picking
@@ -43,7 +44,7 @@
function
action_cancel()
-
+
cancel
@@ -51,7 +52,7 @@
function
action_cancel()
-
+
@@ -134,5 +135,6 @@
test_cancel()
+
diff --git a/addons/stock/wizard/stock_inventory_line_split.py b/addons/stock/wizard/stock_inventory_line_split.py
index 9f91a47c9a5..b07d27c7656 100644
--- a/addons/stock/wizard/stock_inventory_line_split.py
+++ b/addons/stock/wizard/stock_inventory_line_split.py
@@ -44,8 +44,8 @@ class stock_inventory_line_split(osv.osv_memory):
@return: A dictionary which of fields with values.
"""
record_id = context and context.get('active_id',False)
- res = super(stock_inventory_line_split, self).default_get(cr, uid, fields, context=context)
- line= self.pool.get('stock.inventory.line').browse(cr, uid, record_id)
+ res = {}
+ line = self.pool.get('stock.inventory.line').browse(cr, uid, record_id)
if 'product_id' in fields:
res.update({'product_id':line.product_id.id})
return res
diff --git a/addons/thunderbird/plugin/tiny_plugin-2.0.xpi b/addons/thunderbird/plugin/tiny_plugin-2.0.xpi
index ef42a9a0c14..982447de8d8 100644
Binary files a/addons/thunderbird/plugin/tiny_plugin-2.0.xpi and b/addons/thunderbird/plugin/tiny_plugin-2.0.xpi differ