[MERGE] forward port of branch saas-6 up to 5eee559
This commit is contained in:
@@ -38,11 +38,11 @@ class res_users(osv.Model):
|
|||||||
def _auth_oauth_validate(self, cr, uid, provider, access_token, context=None):
|
def _auth_oauth_validate(self, cr, uid, provider, access_token, context=None):
|
||||||
""" return the validation data corresponding to the access token """
|
""" return the validation data corresponding to the access token """
|
||||||
p = self.pool.get('auth.oauth.provider').browse(cr, uid, provider, context=context)
|
p = self.pool.get('auth.oauth.provider').browse(cr, uid, provider, context=context)
|
||||||
validation = self._auth_oauth_rpc(cr, uid, p.validation_endpoint, access_token)
|
validation = self._auth_oauth_rpc(cr, uid, p.validation_endpoint, access_token, context=context)
|
||||||
if validation.get("error"):
|
if validation.get("error"):
|
||||||
raise Exception(validation['error'])
|
raise Exception(validation['error'])
|
||||||
if p.data_endpoint:
|
if p.data_endpoint:
|
||||||
data = self._auth_oauth_rpc(cr, uid, p.data_endpoint, access_token)
|
data = self._auth_oauth_rpc(cr, uid, p.data_endpoint, access_token, context=context)
|
||||||
validation.update(data)
|
validation.update(data)
|
||||||
return validation
|
return validation
|
||||||
|
|
||||||
@@ -98,7 +98,7 @@ class res_users(osv.Model):
|
|||||||
# else:
|
# else:
|
||||||
# continue with the process
|
# continue with the process
|
||||||
access_token = params.get('access_token')
|
access_token = params.get('access_token')
|
||||||
validation = self._auth_oauth_validate(cr, uid, provider, access_token)
|
validation = self._auth_oauth_validate(cr, uid, provider, access_token, context=context)
|
||||||
# required check
|
# required check
|
||||||
if not validation.get('user_id'):
|
if not validation.get('user_id'):
|
||||||
# Workaround: facebook does not send 'user_id' in Open Graph Api
|
# Workaround: facebook does not send 'user_id' in Open Graph Api
|
||||||
|
|||||||
@@ -798,6 +798,11 @@ class calendar_event(osv.Model):
|
|||||||
meeting_data[field] = meeting.stop_date if meeting.allday else meeting.stop_datetime
|
meeting_data[field] = meeting.stop_date if meeting.allday else meeting.stop_datetime
|
||||||
return res
|
return res
|
||||||
|
|
||||||
|
def _get_recurrent_fields(self, cr, uid, context=None):
|
||||||
|
return ['byday', 'recurrency', 'final_date', 'rrule_type', 'month_by',
|
||||||
|
'interval', 'count', 'end_type', 'mo', 'tu', 'we', 'th', 'fr', 'sa',
|
||||||
|
'su', 'day', 'week_list']
|
||||||
|
|
||||||
def _get_rulestring(self, cr, uid, ids, name, arg, context=None):
|
def _get_rulestring(self, cr, uid, ids, name, arg, context=None):
|
||||||
"""
|
"""
|
||||||
Gets Recurrence rule string according to value type RECUR of iCalendar from the values given.
|
Gets Recurrence rule string according to value type RECUR of iCalendar from the values given.
|
||||||
@@ -808,10 +813,8 @@ class calendar_event(osv.Model):
|
|||||||
ids = [ids]
|
ids = [ids]
|
||||||
|
|
||||||
#read these fields as SUPERUSER because if the record is private a normal search could raise an error
|
#read these fields as SUPERUSER because if the record is private a normal search could raise an error
|
||||||
events = self.read(cr, SUPERUSER_ID, ids,
|
recurrent_fields = self._get_recurrent_fields(cr, uid, context=context)
|
||||||
['id', 'byday', 'recurrency', 'final_date', 'rrule_type', 'month_by',
|
events = self.read(cr, SUPERUSER_ID, ids, recurrent_fields, context=context)
|
||||||
'interval', 'count', 'end_type', 'mo', 'tu', 'we', 'th', 'fr', 'sa',
|
|
||||||
'su', 'day', 'week_list'], context=context)
|
|
||||||
for event in events:
|
for event in events:
|
||||||
if event['recurrency']:
|
if event['recurrency']:
|
||||||
result[event['id']] = self.compute_rule_string(event)
|
result[event['id']] = self.compute_rule_string(event)
|
||||||
|
|||||||
@@ -971,9 +971,10 @@ class calendar_event(osv.Model):
|
|||||||
_inherit = "calendar.event"
|
_inherit = "calendar.event"
|
||||||
|
|
||||||
def get_fields_need_update_google(self, cr, uid, context=None):
|
def get_fields_need_update_google(self, cr, uid, context=None):
|
||||||
return ['name', 'description', 'allday', 'start', 'date_end', 'stop',
|
recurrent_fields = self._get_recurrent_fields(cr, uid, context=context)
|
||||||
'attendee_ids', 'alarm_ids', 'location', 'class', 'active',
|
return recurrent_fields + ['name', 'description', 'allday', 'start', 'date_end', 'stop',
|
||||||
'start_date', 'start_datetime', 'stop_date', 'stop_datetime']
|
'attendee_ids', 'alarm_ids', 'location', 'class', 'active',
|
||||||
|
'start_date', 'start_datetime', 'stop_date', 'stop_datetime']
|
||||||
|
|
||||||
def write(self, cr, uid, ids, vals, context=None):
|
def write(self, cr, uid, ids, vals, context=None):
|
||||||
if context is None:
|
if context is None:
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ class Invite(models.TransientModel):
|
|||||||
if 'message' in fields and model and res_id:
|
if 'message' in fields and model and res_id:
|
||||||
model_name = self.env['ir.model'].search([('model', '=', self.pool[model]._name)]).name_get()[0][1]
|
model_name = self.env['ir.model'].search([('model', '=', self.pool[model]._name)]).name_get()[0][1]
|
||||||
document_name = self.env[model].browse(res_id).name_get()[0][1]
|
document_name = self.env[model].browse(res_id).name_get()[0][1]
|
||||||
message = _('<div><p>Hello,</p><p>%s invited you to follow %s document: %s.<p></div>') % (user_name, model_name, document_name)
|
message = _('<div><p>Hello,</p><p>%s invited you to follow %s document: %s.</p></div>') % (user_name, model_name, document_name)
|
||||||
result['message'] = message
|
result['message'] = message
|
||||||
elif 'message' in fields:
|
elif 'message' in fields:
|
||||||
result['message'] = _('<div><p>Hello,</p><p>%s invited you to follow a new document.</p></div>') % user_name
|
result['message'] = _('<div><p>Hello,</p><p>%s invited you to follow a new document.</p></div>') % user_name
|
||||||
|
|||||||
@@ -87,15 +87,6 @@ your store's efficiency.
|
|||||||
No more hassle of having to integrate softwares: get all your sales and
|
No more hassle of having to integrate softwares: get all your sales and
|
||||||
inventory operations automatically posted in your G/L.
|
inventory operations automatically posted in your G/L.
|
||||||
|
|
||||||
Self-checkout Interface
|
|
||||||
-----------------------
|
|
||||||
|
|
||||||
Reduce costs by limitting the number of required cashiers. The self-checkout
|
|
||||||
mode allows customers to scan products and pay by themselves with a dedicated
|
|
||||||
and super easy user interface.
|
|
||||||
|
|
||||||
Use lights and sounds to control the checkout distantly.
|
|
||||||
|
|
||||||
Unified Data Amongst All Shops
|
Unified Data Amongst All Shops
|
||||||
------------------------------
|
------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -176,26 +176,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
|
||||||
<section class='oe_container oe_dark'>
|
|
||||||
<div class='oe_row'>
|
|
||||||
<h2 class='oe_slogan'>Self-checkout Interface</h2>
|
|
||||||
<div class='oe_span6'>
|
|
||||||
<p>
|
|
||||||
Reduce costs by limitting the number of required cashiers.
|
|
||||||
The self-checkout mode allows customers to scan products and pay by
|
|
||||||
themselves with a dedicated and super easy user interface.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
Use lights and sounds to control the checkout distantly.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<div class='oe_span6'>
|
|
||||||
<img class="oe_picture oe_screenshot" src="pos_checkout.jpg">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</section>
|
|
||||||
|
|
||||||
|
|
||||||
<section class='oe_container'>
|
<section class='oe_container'>
|
||||||
<div class='oe_row'>
|
<div class='oe_row'>
|
||||||
<h2 class='oe_slogan'>Unified Data Amongst All Shops</h2>
|
<h2 class='oe_slogan'>Unified Data Amongst All Shops</h2>
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 17 KiB |
@@ -90,7 +90,6 @@ class procurement_order(osv.osv):
|
|||||||
_description = "Procurement"
|
_description = "Procurement"
|
||||||
_order = 'priority desc, date_planned, id asc'
|
_order = 'priority desc, date_planned, id asc'
|
||||||
_inherit = ['mail.thread','ir.needaction_mixin']
|
_inherit = ['mail.thread','ir.needaction_mixin']
|
||||||
_log_create = False
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'name': fields.text('Description', required=True),
|
'name': fields.text('Description', required=True),
|
||||||
|
|
||||||
|
|||||||
@@ -151,7 +151,9 @@ class product_product(osv.osv):
|
|||||||
moves_in = dict(map(lambda x: (x['product_id'][0], x['product_qty']), moves_in))
|
moves_in = dict(map(lambda x: (x['product_id'][0], x['product_qty']), moves_in))
|
||||||
moves_out = dict(map(lambda x: (x['product_id'][0], x['product_qty']), moves_out))
|
moves_out = dict(map(lambda x: (x['product_id'][0], x['product_qty']), moves_out))
|
||||||
res = {}
|
res = {}
|
||||||
for product in self.browse(cr, uid, ids, context=context):
|
ctx = context.copy()
|
||||||
|
ctx.update({'prefetch_fields': False})
|
||||||
|
for product in self.browse(cr, uid, ids, context=ctx):
|
||||||
id = product.id
|
id = product.id
|
||||||
qty_available = float_round(quants.get(id, 0.0), precision_rounding=product.uom_id.rounding)
|
qty_available = float_round(quants.get(id, 0.0), precision_rounding=product.uom_id.rounding)
|
||||||
incoming_qty = float_round(moves_in.get(id, 0.0), precision_rounding=product.uom_id.rounding)
|
incoming_qty = float_round(moves_in.get(id, 0.0), precision_rounding=product.uom_id.rounding)
|
||||||
|
|||||||
@@ -1764,7 +1764,6 @@ class stock_move(osv.osv):
|
|||||||
_name = "stock.move"
|
_name = "stock.move"
|
||||||
_description = "Stock Move"
|
_description = "Stock Move"
|
||||||
_order = 'picking_id, sequence, id'
|
_order = 'picking_id, sequence, id'
|
||||||
_log_create = False
|
|
||||||
|
|
||||||
def get_price_unit(self, cr, uid, move, context=None):
|
def get_price_unit(self, cr, uid, move, context=None):
|
||||||
""" Returns the unit price to store on the quant """
|
""" Returns the unit price to store on the quant """
|
||||||
|
|||||||
@@ -468,7 +468,8 @@ class website(osv.osv):
|
|||||||
:rtype: bool
|
:rtype: bool
|
||||||
"""
|
"""
|
||||||
endpoint = rule.endpoint
|
endpoint = rule.endpoint
|
||||||
methods = rule.methods or ['GET']
|
methods = endpoint.routing.get('method') or ['GET']
|
||||||
|
|
||||||
converters = rule._converters.values()
|
converters = rule._converters.values()
|
||||||
if not ('GET' in methods
|
if not ('GET' in methods
|
||||||
and endpoint.routing['type'] == 'http'
|
and endpoint.routing['type'] == 'http'
|
||||||
|
|||||||
@@ -137,6 +137,12 @@ def constrains(*args):
|
|||||||
|
|
||||||
Should raise :class:`~openerp.exceptions.ValidationError` if the
|
Should raise :class:`~openerp.exceptions.ValidationError` if the
|
||||||
validation failed.
|
validation failed.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
``@constrains`` only supports simple field names, dotted names
|
||||||
|
(fields of relational fields e.g. ``partner_id.customer``) are not
|
||||||
|
supported and will be ignored
|
||||||
"""
|
"""
|
||||||
return lambda method: decorate(method, '_constrains', args)
|
return lambda method: decorate(method, '_constrains', args)
|
||||||
|
|
||||||
@@ -162,6 +168,12 @@ def onchange(*args):
|
|||||||
'warning': {'title': "Warning", 'message': "What is this?"},
|
'warning': {'title': "Warning", 'message': "What is this?"},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
``@onchange`` only supports simple field names, dotted names
|
||||||
|
(fields of relational fields e.g. ``partner_id.tz``) are not
|
||||||
|
supported and will be ignored
|
||||||
"""
|
"""
|
||||||
return lambda method: decorate(method, '_onchange', args)
|
return lambda method: decorate(method, '_onchange', args)
|
||||||
|
|
||||||
|
|||||||
@@ -342,7 +342,6 @@ class BaseModel(object):
|
|||||||
_inherit_fields = {}
|
_inherit_fields = {}
|
||||||
|
|
||||||
_table = None
|
_table = None
|
||||||
_log_create = False
|
|
||||||
_sql_constraints = []
|
_sql_constraints = []
|
||||||
|
|
||||||
# model dependencies, for models backed up by sql views:
|
# model dependencies, for models backed up by sql views:
|
||||||
@@ -4342,13 +4341,6 @@ class BaseModel(object):
|
|||||||
# recompute new-style fields
|
# recompute new-style fields
|
||||||
recs.recompute()
|
recs.recompute()
|
||||||
|
|
||||||
if self._log_create and recs.env.recompute and context.get('recompute', True):
|
|
||||||
message = self._description + \
|
|
||||||
" '" + \
|
|
||||||
self.name_get(cr, user, [id_new], context=context)[0][1] + \
|
|
||||||
"' " + _("created.")
|
|
||||||
self.log(cr, user, id_new, message, True, context=context)
|
|
||||||
|
|
||||||
self.check_access_rule(cr, user, [id_new], 'create', context=context)
|
self.check_access_rule(cr, user, [id_new], 'create', context=context)
|
||||||
self.create_workflow(cr, user, [id_new], context=context)
|
self.create_workflow(cr, user, [id_new], context=context)
|
||||||
return id_new
|
return id_new
|
||||||
|
|||||||
Reference in New Issue
Block a user