[MERGE] forward port of branch saas-6 up to e928c60

This commit is contained in:
Christophe Simonis
2016-07-14 16:23:22 +02:00
9 changed files with 38 additions and 21 deletions
+1 -1
View File
@@ -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',
+1 -1
View File
@@ -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',
@@ -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,
+2 -2
View File
@@ -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")
@@ -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
+1 -1
View File
@@ -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:
+21 -12
View File
@@ -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 {}
@@ -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
+1 -1
View File
@@ -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