diff --git a/addons/crm/crm_lead_view.xml b/addons/crm/crm_lead_view.xml index e631e48e93d..f5deb670046 100644 --- a/addons/crm/crm_lead_view.xml +++ b/addons/crm/crm_lead_view.xml @@ -585,7 +585,7 @@ - + diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 7fda28f85e6..339f2aa0deb 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -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 diff --git a/addons/stock_account/stock_account.py b/addons/stock_account/stock_account.py index 4edaa4352cf..c220af80a5f 100644 --- a/addons/stock_account/stock_account.py +++ b/addons/stock_account/stock_account.py @@ -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) diff --git a/addons/web/static/src/js/views/list_view.js b/addons/web/static/src/js/views/list_view.js index 665681150fd..301b3936d02 100644 --- a/addons/web/static/src/js/views/list_view.js +++ b/addons/web/static/src/js/views/list_view.js @@ -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 {};