Skip to content

Commit

Permalink
Merge remote-tracking branch 'odoo/8.0' into 8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
OCA-git-bot committed May 26, 2016
2 parents d07a5fc + 6622196 commit c249296
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 17 deletions.
2 changes: 2 additions & 0 deletions addons/crm_partner_assign/security/ir.model.access.csv
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 7 additions & 2 deletions addons/gamification/models/goal.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,12 +152,17 @@ 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))
raise osv.except_osv(_('Error!'),
_("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))
raise osv.except_osv(_('Error!'),
_("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)
Expand Down
2 changes: 1 addition & 1 deletion addons/sale/sale.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,7 +538,7 @@ def action_invoice_create(self, cr, uid, ids, grouped=False, states=None, date_i
continue
elif (line.state in states):
lines.append(line.id)
created_lines = obj_sale_order_line.invoice_line_create(cr, uid, lines)
created_lines = obj_sale_order_line.invoice_line_create(cr, uid, lines, context=context)
if created_lines:
invoices.setdefault(o.partner_invoice_id.id or o.partner_id.id, []).append((o, created_lines))
if not invoices:
Expand Down
15 changes: 15 additions & 0 deletions doc/cla/corporate/rocksolidsolutions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
United States, 2016-05-25

Rock Solid Solutions, LLC <http://www.rocksolidsolutions.org> 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 [email protected] <https://github.com/rocksolidsolutions>

List of contributors:

Daniel Kauffman [email protected] <https://github.com/rocksolidsolutions>
34 changes: 20 additions & 14 deletions openerp/service/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,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']
Expand Down Expand Up @@ -603,12 +604,13 @@ def start(self):
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:
Expand All @@ -632,7 +634,8 @@ def stop(self, graceful=True):
_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()
Expand Down Expand Up @@ -735,11 +738,13 @@ def start(self):
_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)
Expand Down Expand Up @@ -857,7 +862,8 @@ def process_work(self):
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
Expand Down

0 comments on commit c249296

Please sign in to comment.