[MERGE] forward port branch saas-6 up to fa50349

This commit is contained in:
Christophe Simonis
2016-10-17 13:14:22 +02:00
4 changed files with 14 additions and 18 deletions
+1 -1
View File
@@ -585,7 +585,7 @@
<field name="source_id" invisible="1"/>
<field name="stage_id"/>
<field name="planned_revenue" sum="Expected Revenues"/>
<field name="probability" />
<field name="probability" avg="Avg. of Probability"/>
<field name="team_id"/>
<field name="user_id"/>
<field name="referred" invisible="1"/>
+5 -16
View File
@@ -1876,7 +1876,6 @@ class stock_move(osv.osv):
return res
def _get_string_qty_information(self, cr, uid, ids, field_name, args, context=None):
settings_obj = self.pool.get('stock.config.settings')
uom_obj = self.pool.get('product.uom')
res = dict.fromkeys(ids, '')
precision = self.pool['decimal.precision'].precision_get(cr, uid, 'Product Unit of Measure')
@@ -1889,11 +1888,8 @@ class stock_move(osv.osv):
total_available = float_round(total_available, precision_digits=precision)
info = str(total_available)
#look in the settings if we need to display the UoM name or not
config_ids = settings_obj.search(cr, uid, [], limit=1, order='id DESC', context=context)
if config_ids:
stock_settings = settings_obj.browse(cr, uid, config_ids[0], context=context)
if stock_settings.group_uom:
info += ' ' + move.product_uom.name
if self.pool.get('res.users').has_group(cr, uid, 'product.group_uom'):
info += ' ' + move.product_uom.name
if move.reserved_availability:
if move.reserved_availability != total_available:
#some of the available quantity is assigned and some are available but not reserved
@@ -2957,19 +2953,12 @@ class stock_inventory(osv.osv):
"""
#default available choices
res_filter = [('none', _('All products')), ('partial', _('Select products manually')), ('product', _('One product only'))]
settings_obj = self.pool.get('stock.config.settings')
config_ids = settings_obj.search(cr, uid, [], limit=1, order='id DESC', context=context)
#If we don't have updated config until now, all fields are by default false and so should be not dipslayed
if not config_ids:
return res_filter
stock_settings = settings_obj.browse(cr, uid, config_ids[0], context=context)
if stock_settings.group_stock_tracking_owner:
if self.pool.get('res.users').has_group(cr, uid, 'stock.group_tracking_owner'):
res_filter.append(('owner', _('One owner only')))
res_filter.append(('product_owner', _('One product for a specific owner')))
if stock_settings.group_stock_production_lot:
if self.pool.get('res.users').has_group(cr, uid, 'stock.group_production_lot'):
res_filter.append(('lot', _('One Lot/Serial Number')))
if stock_settings.group_stock_tracking_lot:
if self.pool.get('res.users').has_group(cr, uid, 'stock.group_tracking_lot'):
res_filter.append(('pack', _('A Pack')))
return res_filter
+7
View File
@@ -234,6 +234,13 @@ class stock_quant(osv.osv):
else:
self._create_account_move_line(cr, uid, quants, move, acc_valuation, acc_dest, journal_id, context=ctx)
if move.company_id.anglo_saxon_accounting and move.location_id.usage == 'supplier' and move.location_dest_id.usage == 'customer':
# Creates an account entry from stock_input to stock_output on a dropship move. https://github.com/odoo/odoo/issues/12687
ctx = context.copy()
ctx['force_company'] = move.company_id.id
journal_id, acc_src, acc_dest, acc_valuation = self._get_accounting_data_for_valuation(cr, uid, move, context=ctx)
self._create_account_move_line(cr, uid, quants, move, acc_src, acc_dest, journal_id, context=ctx)
def _quant_create(self, cr, uid, qty, move, lot_id=False, owner_id=False, src_package_id=False, dest_package_id=False, force_location_from=False, force_location_to=False, context=None):
quant_obj = self.pool.get('stock.quant')
quant = super(stock_quant, self)._quant_create(cr, uid, qty, move, lot_id=lot_id, owner_id=owner_id, src_package_id=src_package_id, dest_package_id=dest_package_id, force_location_from=force_location_from, force_location_to=force_location_to, context=context)
+1 -1
View File
@@ -1851,7 +1851,7 @@ var Column = Class.extend({
}
var aggregation_func = (this.sum && 'sum') || (this.avg && 'avg') ||
(this.max && 'max') || (this.min && 'min') || this.group_operator;
(this.max && 'max') || (this.min && 'min');
if (!aggregation_func) {
return {};