diff --git a/addons/event/__openerp__.py b/addons/event/__openerp__.py index c293eb3aafe..da797cbed2d 100644 --- a/addons/event/__openerp__.py +++ b/addons/event/__openerp__.py @@ -17,7 +17,7 @@ Key Features * Manage your Events and Registrations * Use emails to automatically confirm and send acknowledgements for any event registration """, - 'depends': ['base_setup', 'mail', 'marketing', 'web_tip'], + 'depends': ['base_setup', 'mail', 'marketing', 'report', 'web_tip'], 'data': [ 'security/event_security.xml', 'security/ir.model.access.csv', diff --git a/addons/hr_holidays/__openerp__.py b/addons/hr_holidays/__openerp__.py index 32a7f5ab2a3..ef21192f4f6 100644 --- a/addons/hr_holidays/__openerp__.py +++ b/addons/hr_holidays/__openerp__.py @@ -25,7 +25,7 @@ You can keep track of leaves in different ways by following reports: A synchronization with an internal agenda (Meetings of the CRM module) is also possible in order to automatically create a meeting when a leave request is accepted by setting up a type of meeting in Leave Type. """, - 'depends': ['hr', 'calendar', 'resource'], + 'depends': ['hr', 'calendar', 'resource', 'report'], 'data': [ 'data/report_paperformat.xml', 'security/ir.model.access.csv', diff --git a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py index 2b79c3c2715..ec72fc30c42 100644 --- a/addons/hr_timesheet_sheet/hr_timesheet_sheet.py +++ b/addons/hr_timesheet_sheet/hr_timesheet_sheet.py @@ -8,7 +8,11 @@ from pytz import timezone import pytz from openerp.osv import fields, osv -from openerp.tools import DEFAULT_SERVER_DATE_FORMAT, DEFAULT_SERVER_DATETIME_FORMAT +from openerp.tools import ( + DEFAULT_SERVER_DATE_FORMAT, + DEFAULT_SERVER_DATETIME_FORMAT, + drop_view_if_exists, +) from openerp.tools.translate import _ from openerp.exceptions import UserError @@ -511,6 +515,7 @@ class hr_timesheet_sheet_sheet_day(osv.osv): } def init(self, cr): + drop_view_if_exists(cr, 'hr_timesheet_sheet_sheet_day') cr.execute("""create or replace view hr_timesheet_sheet_sheet_day as SELECT id, @@ -600,6 +605,7 @@ class hr_timesheet_sheet_sheet_account(osv.osv): } def init(self, cr): + drop_view_if_exists(cr, 'hr_timesheet_sheet_sheet_account') cr.execute("""create or replace view hr_timesheet_sheet_sheet_account as ( select min(l.id) as id, diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py index 1efa441be02..aac2e725f96 100644 --- a/addons/mrp/mrp.py +++ b/addons/mrp/mrp.py @@ -771,11 +771,11 @@ class mrp_production(osv.osv): proc_obj = self.pool.get('procurement.order') for production in self.browse(cr, uid, ids, context=context): if production.move_created_ids: - move_obj.action_cancel(cr, uid, [x.id for x in production.move_created_ids]) + move_obj.action_cancel(cr, uid, [x.id for x in production.move_created_ids], context=context) procs = proc_obj.search(cr, uid, [('move_dest_id', 'in', [x.id for x in production.move_lines])], context=context) if procs: proc_obj.cancel(cr, uid, procs, context=context) - move_obj.action_cancel(cr, uid, [x.id for x in production.move_lines]) + move_obj.action_cancel(cr, uid, [x.id for x in production.move_lines], context=context) self.write(cr, uid, ids, {'state': 'cancel'}) # Put related procurements in exception proc_obj = self.pool.get("procurement.order") diff --git a/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init_posbox_image.sh b/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init_posbox_image.sh index e54a8688741..a05dfc897ae 100755 --- a/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init_posbox_image.sh +++ b/addons/point_of_sale/tools/posbox/overwrite_before_init/etc/init_posbox_image.sh @@ -11,6 +11,8 @@ __base="$(basename ${__file} .sh)" # Recommends: antiword, graphviz, ghostscript, postgresql, python-gevent, poppler-utils export DEBIAN_FRONTEND=noninteractive +mount /dev/sda1 /boot + apt-get update apt-get -y dist-upgrade diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 528b4ac35eb..eef58e6649a 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -3271,7 +3271,7 @@ class stock_inventory_line(osv.osv): elif inventory_line.package_id: stock_move_obj.action_done(cr, uid, move_id, context=context) quants = [x.id for x in move.quant_ids] - quant_obj.write(cr, uid, quants, {'package_id': inventory_line.package_id.id}, context=context) + quant_obj.write(cr, SUPERUSER_ID, quants, {'package_id': inventory_line.package_id.id}, context=context) res = quant_obj.search(cr, uid, [('qty', '<', 0.0), ('product_id', '=', move.product_id.id), ('location_id', '=', move.location_dest_id.id), ('package_id', '!=', False)], limit=1, context=context) if res: diff --git a/addons/stock/wizard/stock_change_product_qty.py b/addons/stock/wizard/stock_change_product_qty.py index 0216dce3367..ec03ae965d5 100644 --- a/addons/stock/wizard/stock_change_product_qty.py +++ b/addons/stock/wizard/stock_change_product_qty.py @@ -53,6 +53,23 @@ class stock_change_product_qty(osv.osv_memory): values.update(self.onchange_product_id(cr, uid, None, values['product_id'], context=context)['value']) return super(stock_change_product_qty, self).create(cr, uid, values, context=context) + def _prepare_inventory_line(self, cr, uid, inventory_id, data, context=None): + + product = data.product_id.with_context(location=data.location_id.id, lot_id=data.lot_id.id) + th_qty = product.qty_available + + res = { + 'inventory_id': inventory_id, + 'product_qty': data.new_quantity, + 'location_id': data.location_id.id, + 'product_id': data.product_id.id, + 'product_uom_id': data.product_id.uom_id.id, + 'theoretical_qty': th_qty, + 'prod_lot_id': data.lot_id.id, + } + + return res + def onchange_product_id(self, cr, uid, ids, prod_id, context=None): product = self.pool.get('product.product').browse(cr, uid, prod_id) return {'value': { @@ -86,18 +103,10 @@ class stock_change_product_qty(osv.osv_memory): 'product_id': data.product_id.id, 'location_id': data.location_id.id, 'lot_id': data.lot_id.id}, context=context) - product = data.product_id.with_context(location=data.location_id.id, lot_id= data.lot_id.id) - th_qty = product.qty_available - line_data = { - 'inventory_id': inventory_id, - 'product_qty': data.new_quantity, - 'location_id': data.location_id.id, - 'product_id': data.product_id.id, - 'product_uom_id': data.product_id.uom_id.id, - 'theoretical_qty': th_qty, - 'prod_lot_id': data.lot_id.id - } - inventory_line_obj.create(cr , uid, line_data, context=context) + + line_data = self._prepare_inventory_line(cr, uid, inventory_id, data, context=context) + + inventory_line_obj.create(cr, uid, line_data, context=context) inventory_obj.action_done(cr, uid, [inventory_id], context=context) return {} diff --git a/addons/stock_account/wizard/stock_valuation_history.py b/addons/stock_account/wizard/stock_valuation_history.py index db097acbc5d..a7c31e2381a 100644 --- a/addons/stock_account/wizard/stock_valuation_history.py +++ b/addons/stock_account/wizard/stock_valuation_history.py @@ -108,7 +108,7 @@ class stock_history(osv.osv): 'product_categ_id': fields.many2one('product.category', 'Product Category', required=True), 'quantity': fields.float('Product Quantity'), 'date': fields.datetime('Operation Date'), - 'price_unit_on_quant': fields.float('Value'), + 'price_unit_on_quant': fields.float('Value', group_operator='avg'), 'inventory_value': fields.function(_get_inventory_value, string="Inventory Value", type='float', readonly=True), 'source': fields.char('Source'), 'product_template_id': fields.many2one('product.template', 'Product Template', required=True), @@ -128,7 +128,7 @@ class stock_history(osv.osv): product_template_id, SUM(quantity) as quantity, date, - SUM(price_unit_on_quant * quantity) / SUM(quantity) as price_unit_on_quant, + COALESCE(SUM(price_unit_on_quant * quantity) / NULLIF(SUM(quantity), 0), 0) as price_unit_on_quant, source, string_agg(DISTINCT serial_number, ', ' ORDER BY serial_number) AS serial_number FROM diff --git a/openerp/addons/base/ir/ir_actions.py b/openerp/addons/base/ir/ir_actions.py index ede8cf9d92f..963f4290be9 100644 --- a/openerp/addons/base/ir/ir_actions.py +++ b/openerp/addons/base/ir/ir_actions.py @@ -1271,7 +1271,7 @@ class ir_actions_act_client(osv.osv): def _get_params(self, cr, uid, ids, field_name, arg, context): result = {} # Need to remove bin_size from context, to obtains the binary and not the length. - context = dict(context, bin_size_params_store=False) + context = dict(context, bin_size_params_store=False, bin_size=False) for record in self.browse(cr, uid, ids, context=context): result[record.id] = record.params_store and eval(record.params_store, {'uid': uid}) or False return result