|
- ${object.event_id.get_interval(object.event_id.start, 'dayname', tz=object.partner_id.tz)}
+ ${object.event_id.get_interval(object.event_id.start, 'dayname', tz=object.partner_id.tz if not object.event_id.allday else None)}
- ${object.event_id.get_interval(object.event_id.start,'day', tz=object.partner_id.tz)}
+ ${object.event_id.get_interval(object.event_id.start,'day', tz=object.partner_id.tz if not object.event_id.allday else None)}
- ${object.event_id.get_interval(object.event_id.start, 'month', tz=object.partner_id.tz)}
+ ${object.event_id.get_interval(object.event_id.start, 'month', tz=object.partner_id.tz if not object.event_id.allday else None)}
${not object.event_id.allday and object.event_id.get_interval(object.event_id.start, 'time', tz=object.partner_id.tz) or ''}
|
@@ -226,11 +226,11 @@
|
- ${object.event_id.get_interval(object.event_id.start, 'dayname', tz=object.partner_id.tz)}
+ ${object.event_id.get_interval(object.event_id.start, 'dayname', tz=object.partner_id.tz if not object.event_id.allday else None)}
- ${object.event_id.get_interval(object.event_id.start,'day', tz=object.partner_id.tz)}
+ ${object.event_id.get_interval(object.event_id.start,'day', tz=object.partner_id.tz if not object.event_id.allday else None)}
- ${object.event_id.get_interval(object.event_id.start, 'month', tz=object.partner_id.tz)}
+ ${object.event_id.get_interval(object.event_id.start, 'month', tz=object.partner_id.tz if not object.event_id.allday else None)}
${not object.event_id.allday and object.event_id.get_interval(object.event_id.start, 'time', tz=object.partner_id.tz) or ''}
|
@@ -350,11 +350,11 @@
|
- ${object.event_id.get_interval(object.event_id.start, 'dayname', tz=object.partner_id.tz)}
+ ${object.event_id.get_interval(object.event_id.start, 'dayname', tz=object.partner_id.tz if not object.event_id.allday else None)}
- ${object.event_id.get_interval(object.event_id.start,'day', tz=object.partner_id.tz)}
+ ${object.event_id.get_interval(object.event_id.start,'day', tz=object.partner_id.tz if not object.event_id.allday else None)}
- ${object.event_id.get_interval(object.event_id.start, 'month', tz=object.partner_id.tz)}
+ ${object.event_id.get_interval(object.event_id.start, 'month', tz=object.partner_id.tz if not object.event_id.allday else None)}
${not object.event_id.allday and object.event_id.get_interval(object.event_id.start, 'time', tz=object.partner_id.tz) or ''}
|
diff --git a/addons/crm/base_partner_merge.py b/addons/crm/base_partner_merge.py
index 8baf69a5a7a..95ad18f044f 100644
--- a/addons/crm/base_partner_merge.py
+++ b/addons/crm/base_partner_merge.py
@@ -306,7 +306,7 @@ class MergePartnerAutomatic(osv.TransientModel):
for partner_id in partner_ids:
child_ids = child_ids.union(set(proxy.search(cr, uid, [('id', 'child_of', [partner_id])])) - set([partner_id]))
if set(partner_ids).intersection(child_ids):
- raise osv.except_osv(_('Error'), _("You cannot merge a contact with one of his parent."))
+ raise UserError(_("You cannot merge a contact with one of his parent."))
if openerp.SUPERUSER_ID != uid and len(set(partner.email for partner in proxy.browse(cr, uid, partner_ids, context=context))) > 1:
raise UserError(_("All contacts must have the same email. Only the Administrator can merge contacts with different emails."))
diff --git a/addons/crm_partner_assign/security/ir.model.access.csv b/addons/crm_partner_assign/security/ir.model.access.csv
index e0b29587ff4..3f39d776ddc 100644
--- a/addons/crm_partner_assign/security/ir.model.access.csv
+++ b/addons/crm_partner_assign/security/ir.model.access.csv
@@ -3,6 +3,8 @@ access_ crm_lead_report_assign,crm.lead.report.assign,model_crm_lead_report_assi
access_ crm_lead_report_assign_all,crm.lead.report.assign.all,model_crm_lead_report_assign,base.group_user,1,0,0,0
access_crm_partner_report,crm.partner.report.assign.all,model_crm_partner_report_assign,base.group_sale_salesman,1,0,0,0
access_res_partner_grade,res.partner.grade,model_res_partner_grade,base.group_sale_salesman,1,1,1,0
+access_res_partner_grade_employee,res.partner.grade,model_res_partner_grade,base.group_user,1,0,0,0
+access_res_partner_grade_portal,res.partner.grade,model_res_partner_grade,base.group_portal,1,0,0,0
access_res_partner_grade_public,res.partner.grade,model_res_partner_grade,base.group_public,1,0,0,0
access_res_partner_grade_manager,res.partner.grade.manager,model_res_partner_grade,base.group_sale_manager,1,1,1,1
access_res_partner_activation_user,res.partner.activation.user,model_res_partner_activation,base.group_user,1,0,0,0
diff --git a/addons/gamification/models/goal.py b/addons/gamification/models/goal.py
index 2f307e03ca0..c41b0fea484 100644
--- a/addons/gamification/models/goal.py
+++ b/addons/gamification/models/goal.py
@@ -133,18 +133,36 @@ class gamification_goal_definition(osv.Model):
raise UserError(_("The domain for the definition %s seems incorrect, please check it.\n\n%s") % (definition.name, msg))
return True
+ def _check_model_validity(self, cr, uid, ids, context=None):
+ """ make sure the selected field and model are usable"""
+ for definition in self.browse(cr, uid, ids, context=context):
+ try:
+ if not definition.model_id or not definition.field_id:
+ continue
+
+ model = self.pool[definition.model_id.model]
+ field = model._fields[definition.field_id.name]
+ if not field.store:
+ raise UserError(
+ _("The model configuration for the definition %s seems incorrect, please check it.\n\n%s not stored") % (definition.name, definition.field_id.name))
+ except KeyError, e:
+ raise UserError(
+ _("The model configuration for the definition %s seems incorrect, please check it.\n\n%s not found") % (definition.name, e.message))
+
def create(self, cr, uid, vals, context=None):
res_id = super(gamification_goal_definition, self).create(cr, uid, vals, context=context)
if vals.get('computation_mode') in ('count', 'sum'):
self._check_domain_validity(cr, uid, [res_id], context=context)
-
+ if vals.get('field_id'):
+ self._check_model_validity(cr, uid, [res_id], context=context)
return res_id
def write(self, cr, uid, ids, vals, context=None):
res = super(gamification_goal_definition, self).write(cr, uid, ids, vals, context=context)
if vals.get('computation_mode', 'count') in ('count', 'sum') and (vals.get('domain') or vals.get('model_id')):
self._check_domain_validity(cr, uid, ids, context=context)
-
+ if vals.get('field_id') or vals.get('model_id') or vals.get('batch_mode'):
+ self._check_model_validity(cr, uid, ids, context=context)
return res
def on_change_model_id(self, cr, uid, ids, model_id, context=None):
diff --git a/addons/hr_holidays/hr_holidays.py b/addons/hr_holidays/hr_holidays.py
index 91867143890..1001bb6e8e6 100644
--- a/addons/hr_holidays/hr_holidays.py
+++ b/addons/hr_holidays/hr_holidays.py
@@ -567,14 +567,14 @@ class hr_employee(osv.Model):
# Find for holidays status
status_ids = type_obj.search(cr, uid, [('limit', '=', False)], context=context)
if len(status_ids) != 1 :
- raise osv.except_osv(_('Warning!'),_("The feature behind the field 'Remaining Legal Leaves' can only be used when there is only one leave type with the option 'Allow to Override Limit' unchecked. (%s Found). Otherwise, the update is ambiguous as we cannot decide on which leave type the update has to be done. \nYou may prefer to use the classic menus 'Leave Requests' and 'Allocation Requests' located in 'Human Resources \ Leaves' to manage the leave days of the employees if the configuration does not allow to use this field.") % (len(status_ids)))
+ raise UserError(_("The feature behind the field 'Remaining Legal Leaves' can only be used when there is only one leave type with the option 'Allow to Override Limit' unchecked. (%s Found). Otherwise, the update is ambiguous as we cannot decide on which leave type the update has to be done. \nYou may prefer to use the classic menus 'Leave Requests' and 'Allocation Requests' located in 'Human Resources \ Leaves' to manage the leave days of the employees if the configuration does not allow to use this field.") % (len(status_ids)))
status_id = status_ids and status_ids[0] or False
if not status_id:
return False
if diff > 0:
leave_id = holiday_obj.create(cr, uid, {'name': _('Allocation for %s') % employee.name, 'employee_id': employee.id, 'holiday_status_id': status_id, 'type': 'add', 'holiday_type': 'employee', 'number_of_days_temp': diff}, context=context)
elif diff < 0:
- raise osv.except_osv(_('Warning!'), _('You cannot reduce validated allocation requests'))
+ raise UserError(_('You cannot reduce validated allocation requests'))
else:
return False
for sig in ('confirm', 'validate', 'second_validate'):
diff --git a/addons/hr_payroll/report/report_payslip_details.py b/addons/hr_payroll/report/report_payslip_details.py
index f5858f8e7ef..5cc1af7ba65 100644
--- a/addons/hr_payroll/report/report_payslip_details.py
+++ b/addons/hr_payroll/report/report_payslip_details.py
@@ -18,13 +18,16 @@ class payslip_details_report(report_sxw.rml_parse):
payslip_line = self.pool.get('hr.payslip.line')
rule_cate_obj = self.pool.get('hr.salary.rule.category')
- def get_recursive_parent(rule_categories):
- if not rule_categories:
- return []
- if rule_categories[0].parent_id:
- rule_categories = rule_categories[0].parent_id | rule_categories
- get_recursive_parent(rule_categories)
- return rule_categories
+ def get_recursive_parent(current_rule_category, rule_categories = None):
+ if rule_categories:
+ rule_categories = current_rule_category | rule_categories
+ else:
+ rule_categories = current_rule_category
+
+ if current_rule_category.parent_id:
+ return get_recursive_parent(current_rule_category.parent_id, rule_categories)
+ else:
+ return rule_categories
res = []
result = {}
diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py
index 7ec47dc183d..16f3e17a88a 100644
--- a/addons/point_of_sale/point_of_sale.py
+++ b/addons/point_of_sale/point_of_sale.py
@@ -1601,7 +1601,7 @@ class product_template(osv.osv):
product_ctx = dict(context or {}, active_test=False)
if self.search_count(cr, uid, [('id', 'in', ids), ('available_in_pos', '=', True)], context=product_ctx):
if self.pool['pos.session'].search_count(cr, uid, [('state', '!=', 'closed')], context=context):
- raise osv.except_osv(_('Error!'),
+ raise UserError(
_('You cannot delete a product saleable in point of sale while a session is still opened.'))
return super(product_template, self).unlink(cr, uid, ids, context=context)
diff --git a/addons/stock/wizard/stock_return_picking.py b/addons/stock/wizard/stock_return_picking.py
index 22d2208ceee..607a99c66d7 100644
--- a/addons/stock/wizard/stock_return_picking.py
+++ b/addons/stock/wizard/stock_return_picking.py
@@ -45,7 +45,7 @@ class stock_return_picking(osv.osv_memory):
context = {}
if context and context.get('active_ids', False):
if len(context.get('active_ids')) > 1:
- raise osv.except_osv(_('Warning!'), _("You may only return one picking at a time!"))
+ raise UserError(_("You may only return one picking at a time!"))
res = super(stock_return_picking, self).default_get(cr, uid, fields, context=context)
record_id = context and context.get('active_id', False) or False
uom_obj = self.pool.get('product.uom')
diff --git a/addons/stock_account/stock_account.py b/addons/stock_account/stock_account.py
index aae0f832db8..13378669dc1 100644
--- a/addons/stock_account/stock_account.py
+++ b/addons/stock_account/stock_account.py
@@ -277,7 +277,7 @@ class stock_quant(osv.osv):
:param context: context dictionary that can explicitly mention the company to consider via the 'force_company' key
:returns: journal_id, source account, destination account, valuation account
- :raise: osv.except_osv() is any mandatory account or journal is not defined.
+ :raise: openerp.exceptions.UserError if any mandatory account or journal is not defined.
"""
product_obj = self.pool.get('product.template')
accounts = product_obj.browse(cr, uid, move.product_id.product_tmpl_id.id, context).get_product_accounts()
diff --git a/doc/cla/corporate/rocksolidsolutions.md b/doc/cla/corporate/rocksolidsolutions.md
new file mode 100644
index 00000000000..133c19de35c
--- /dev/null
+++ b/doc/cla/corporate/rocksolidsolutions.md
@@ -0,0 +1,15 @@
+United States, 2016-05-25
+
+Rock Solid Solutions, LLC agrees to the terms of the Odoo Corporate Contributor License
+Agreement v1.0.
+
+I declare that I am authorized and able to make this agreement and sign this
+declaration.
+
+Signed,
+
+Daniel Kauffman, Manager rocksolidsolutions@users.noreply.github.com
+
+List of contributors:
+
+Daniel Kauffman rocksolidsolutions@users.noreply.github.com
diff --git a/openerp/addons/base/res/res_users.py b/openerp/addons/base/res/res_users.py
index 928a28414ef..4d6da4b6edd 100644
--- a/openerp/addons/base/res/res_users.py
+++ b/openerp/addons/base/res/res_users.py
@@ -517,7 +517,7 @@ class res_users(osv.osv):
:return: True
:raise: openerp.exceptions.AccessDenied when old password is wrong
- :raise: except_osv when new password is not set or empty
+ :raise: openerp.exceptions.UserError when new password is not set or empty
"""
self.check(cr.dbname, uid, old_passwd)
if new_passwd:
diff --git a/openerp/service/server.py b/openerp/service/server.py
index 92fda76aa7a..1425acce3eb 100644
--- a/openerp/service/server.py
+++ b/openerp/service/server.py
@@ -383,7 +383,8 @@ class PreforkServer(CommonServer):
"""
def __init__(self, app):
# config
- self.address = (config['xmlrpc_interface'] or '0.0.0.0', config['xmlrpc_port'])
+ self.address = config['xmlrpc'] and \
+ (config['xmlrpc_interface'] or '0.0.0.0', config['xmlrpc_port'])
self.population = config['workers']
self.timeout = config['limit_time_real']
self.limit_request = config['limit_request']
@@ -558,12 +559,13 @@ class PreforkServer(CommonServer):
signal.signal(signal.SIGQUIT, dumpstacks)
signal.signal(signal.SIGUSR1, log_ormcache_stats)
- # listen to socket
- self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
- self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
- self.socket.setblocking(0)
- self.socket.bind(self.address)
- self.socket.listen(8 * self.population)
+ if self.address:
+ # listen to socket
+ self.socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+ self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+ self.socket.setblocking(0)
+ self.socket.bind(self.address)
+ self.socket.listen(8 * self.population)
def stop(self, graceful=True):
if self.long_polling_pid is not None:
@@ -587,7 +589,8 @@ class PreforkServer(CommonServer):
_logger.info("Stopping forcefully")
for pid in self.workers.keys():
self.worker_kill(pid, signal.SIGTERM)
- self.socket.close()
+ if self.socket:
+ self.socket.close()
def run(self, preload, stop):
self.start()
@@ -690,11 +693,13 @@ class Worker(object):
_logger.info("Worker %s (%s) alive", self.__class__.__name__, self.pid)
# Reseed the random number generator
random.seed()
- # Prevent fd inherientence close_on_exec
- flags = fcntl.fcntl(self.multi.socket, fcntl.F_GETFD) | fcntl.FD_CLOEXEC
- fcntl.fcntl(self.multi.socket, fcntl.F_SETFD, flags)
- # reset blocking status
- self.multi.socket.setblocking(0)
+ if self.multi.socket:
+ # Prevent fd inheritance: close_on_exec
+ flags = fcntl.fcntl(self.multi.socket, fcntl.F_GETFD) | fcntl.FD_CLOEXEC
+ fcntl.fcntl(self.multi.socket, fcntl.F_SETFD, flags)
+ # reset blocking status
+ self.multi.socket.setblocking(0)
+
signal.signal(signal.SIGINT, self.signal_handler)
signal.signal(signal.SIGTERM, signal.SIG_DFL)
signal.signal(signal.SIGCHLD, signal.SIG_DFL)
@@ -812,7 +817,8 @@ class WorkerCron(Worker):
def start(self):
os.nice(10) # mommy always told me to be nice with others...
Worker.start(self)
- self.multi.socket.close()
+ if self.multi.socket:
+ self.multi.socket.close()
#----------------------------------------------------------
# start/stop public api
| | |