[MERGE] Sync with parent
bzr revid: rim@openerp.com-20140410120341-n1idn9rtnf2lmvcy
This commit is contained in:
commit
ac8ada1a47
|
@ -47,7 +47,7 @@ class account_installer(osv.osv_memory):
|
||||||
|
|
||||||
# try get the list on apps server
|
# try get the list on apps server
|
||||||
try:
|
try:
|
||||||
apps_server = self.pool.get('ir.config_parameter').get_param(cr, uid, 'apps.server', 'https://apps.openerp.com')
|
apps_server = self.pool.get('ir.module.module').get_apps_server(cr, uid, context=context)
|
||||||
|
|
||||||
up = urlparse.urlparse(apps_server)
|
up = urlparse.urlparse(apps_server)
|
||||||
url = '{0.scheme}://{0.netloc}/apps/charts?serie={1}'.format(up, serie)
|
url = '{0.scheme}://{0.netloc}/apps/charts?serie={1}'.format(up, serie)
|
||||||
|
|
|
@ -94,7 +94,7 @@ class account_entries_report(osv.osv):
|
||||||
return super(account_entries_report, self).search(cr, uid, args=args, offset=offset, limit=limit, order=order,
|
return super(account_entries_report, self).search(cr, uid, args=args, offset=offset, limit=limit, order=order,
|
||||||
context=context, count=count)
|
context=context, count=count)
|
||||||
|
|
||||||
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
|
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False,lazy=True):
|
||||||
if context is None:
|
if context is None:
|
||||||
context = {}
|
context = {}
|
||||||
fiscalyear_obj = self.pool.get('account.fiscalyear')
|
fiscalyear_obj = self.pool.get('account.fiscalyear')
|
||||||
|
@ -108,7 +108,7 @@ class account_entries_report(osv.osv):
|
||||||
domain.append(['period_id','in',ids])
|
domain.append(['period_id','in',ids])
|
||||||
else:
|
else:
|
||||||
domain = domain
|
domain = domain
|
||||||
return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context, orderby)
|
return super(account_entries_report, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context, orderby,lazy)
|
||||||
|
|
||||||
def init(self, cr):
|
def init(self, cr):
|
||||||
tools.drop_view_if_exists(cr, 'account_entries_report')
|
tools.drop_view_if_exists(cr, 'account_entries_report')
|
||||||
|
|
|
@ -328,7 +328,7 @@ class account_asset_asset(osv.osv):
|
||||||
default = {}
|
default = {}
|
||||||
if context is None:
|
if context is None:
|
||||||
context = {}
|
context = {}
|
||||||
default.update({'depreciation_line_ids': [], 'state': 'draft'})
|
default.update({'depreciation_line_ids': [], 'account_move_line_ids': [], 'history_ids': [], 'state': 'draft'})
|
||||||
return super(account_asset_asset, self).copy(cr, uid, id, default, context=context)
|
return super(account_asset_asset, self).copy(cr, uid, id, default, context=context)
|
||||||
|
|
||||||
def _compute_entries(self, cr, uid, ids, period_id, context=None):
|
def _compute_entries(self, cr, uid, ids, period_id, context=None):
|
||||||
|
|
|
@ -26,6 +26,7 @@ import openerp.addons.decimal_precision as dp
|
||||||
class analytic_user_funct_grid(osv.osv):
|
class analytic_user_funct_grid(osv.osv):
|
||||||
_name="analytic.user.funct.grid"
|
_name="analytic.user.funct.grid"
|
||||||
_description= "Price per User"
|
_description= "Price per User"
|
||||||
|
_rec_name="user_id"
|
||||||
_columns={
|
_columns={
|
||||||
'user_id': fields.many2one("res.users", "User", required=True,),
|
'user_id': fields.many2one("res.users", "User", required=True,),
|
||||||
'product_id': fields.many2one("product.product", "Service", required=True,),
|
'product_id': fields.many2one("product.product", "Service", required=True,),
|
||||||
|
|
|
@ -2,6 +2,7 @@ import functools
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
import simplejson
|
import simplejson
|
||||||
|
import urlparse
|
||||||
import werkzeug.utils
|
import werkzeug.utils
|
||||||
from werkzeug.exceptions import BadRequest
|
from werkzeug.exceptions import BadRequest
|
||||||
|
|
||||||
|
@ -68,7 +69,8 @@ class OAuthLogin(openerp.addons.web.controllers.main.Home):
|
||||||
def get_state(self, provider):
|
def get_state(self, provider):
|
||||||
state = dict(
|
state = dict(
|
||||||
d=request.session.db,
|
d=request.session.db,
|
||||||
p=provider['id']
|
p=provider['id'],
|
||||||
|
r=request.httprequest.full_path
|
||||||
)
|
)
|
||||||
token = request.params.get('token')
|
token = request.params.get('token')
|
||||||
if token:
|
if token:
|
||||||
|
@ -137,8 +139,12 @@ class OAuthController(http.Controller):
|
||||||
cr.commit()
|
cr.commit()
|
||||||
action = state.get('a')
|
action = state.get('a')
|
||||||
menu = state.get('m')
|
menu = state.get('m')
|
||||||
|
redirect = state.get('r')
|
||||||
url = '/web'
|
url = '/web'
|
||||||
if action:
|
if redirect and not redirect.startswith('/auth_oauth/signin') and \
|
||||||
|
(not redirect.startswith('/web/login') or 'redirect' in urlparse.urlsplit(redirect).query):
|
||||||
|
url = redirect
|
||||||
|
elif action:
|
||||||
url = '/web#action=%s' % action
|
url = '/web#action=%s' % action
|
||||||
elif menu:
|
elif menu:
|
||||||
url = '/web#menu_id=%s' % menu
|
url = '/web#menu_id=%s' % menu
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
<field name="password"></field>
|
<field name="password"></field>
|
||||||
<field name="active" eval="False"/>
|
<field name="active" eval="False"/>
|
||||||
<!-- Avoid auto-including this user in any default group, just like a typical portal member -->
|
<!-- Avoid auto-including this user in any default group, just like a typical portal member -->
|
||||||
<field name="groups_id" eval="[(4,ref('base.group_portal'))]"/>
|
<field name="groups_id" eval="[(6, 0, [ref('base.group_portal')])]"/>
|
||||||
<!-- allow signuped users to have a alias -->
|
<!-- allow signuped users to have a alias -->
|
||||||
<field name="alias_name">_usertemplate</field>
|
<field name="alias_name">_usertemplate</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
|
@ -22,5 +22,6 @@
|
||||||
import res_company
|
import res_company
|
||||||
import ir_translation
|
import ir_translation
|
||||||
import wizard
|
import wizard
|
||||||
|
import controller
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
import gengo_callback
|
|
@ -0,0 +1,22 @@
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
|
||||||
|
import openerp
|
||||||
|
from openerp.addons.web import http
|
||||||
|
from openerp.addons.web.http import request
|
||||||
|
|
||||||
|
import json
|
||||||
|
|
||||||
|
class website_gengo(http.Controller):
|
||||||
|
@http.route('/website/gengo_callback', type='http', auth='none')
|
||||||
|
def gengo_callback(self,**post):
|
||||||
|
cr, uid, context = request.cr, openerp.SUPERUSER_ID, request.context
|
||||||
|
translation_pool = request.registry['ir.translation']
|
||||||
|
if post and post.get('job'):
|
||||||
|
job = json.loads(post['job'])
|
||||||
|
tid = job.get('custom_data', False)
|
||||||
|
if (job.get('status') == 'approved') and tid:
|
||||||
|
term = translation_pool.browse(cr, uid, int(tid), context=context)
|
||||||
|
if term.job_id <> job.get('job_id'):
|
||||||
|
raise 'Error'
|
||||||
|
vals = {'state': 'translated', 'value': job.get('body_tgt')}
|
||||||
|
translation_pool.write(cr, uid, [int(tid)], vals, context=context)
|
|
@ -33,10 +33,6 @@ try:
|
||||||
from mygengo import MyGengo
|
from mygengo import MyGengo
|
||||||
except ImportError:
|
except ImportError:
|
||||||
_logger.warning('Gengo library not found, Gengo features disabled. If you plan to use it, please install the mygengo library from http://pypi.python.org/pypi/mygengo')
|
_logger.warning('Gengo library not found, Gengo features disabled. If you plan to use it, please install the mygengo library from http://pypi.python.org/pypi/mygengo')
|
||||||
class MyGengo(object):
|
|
||||||
def __init__(self, *args, **kwargs):
|
|
||||||
# no context for translations - so don't bother
|
|
||||||
raise ImportError('Gengo library not found, please install mygengo from http://pypi.python.org/pypi/mygengo')
|
|
||||||
|
|
||||||
GENGO_DEFAULT_LIMIT = 20
|
GENGO_DEFAULT_LIMIT = 20
|
||||||
|
|
||||||
|
@ -120,51 +116,45 @@ class base_gengo_translations(osv.osv_memory):
|
||||||
all_translation_ids = translation_pool.search(cr, uid, [('state', '=', 'inprogress'), ('gengo_translation', 'in', ('machine', 'standard', 'pro', 'ultra')), ('job_id', "!=", False)], context=context)
|
all_translation_ids = translation_pool.search(cr, uid, [('state', '=', 'inprogress'), ('gengo_translation', 'in', ('machine', 'standard', 'pro', 'ultra')), ('job_id', "!=", False)], context=context)
|
||||||
while True:
|
while True:
|
||||||
translation_ids = all_translation_ids[offset:offset + limit]
|
translation_ids = all_translation_ids[offset:offset + limit]
|
||||||
if translation_ids:
|
|
||||||
offset += limit
|
offset += limit
|
||||||
|
if not translation_ids:
|
||||||
|
break
|
||||||
translation_terms = translation_pool.browse(cr, uid, translation_ids, context=context)
|
translation_terms = translation_pool.browse(cr, uid, translation_ids, context=context)
|
||||||
gengo_job_id = [term.job_id for term in translation_terms]
|
gengo_job_id = [term.job_id for term in translation_terms]
|
||||||
if gengo_job_id:
|
if gengo_job_id:
|
||||||
gengo_ids = ','.join(gengo_job_id)
|
gengo_ids = ','.join(gengo_job_id)
|
||||||
|
try:
|
||||||
job_response = gengo.getTranslationJobBatch(id=gengo_ids)
|
job_response = gengo.getTranslationJobBatch(id=gengo_ids)
|
||||||
|
except:
|
||||||
|
continue
|
||||||
if job_response['opstat'] == 'ok':
|
if job_response['opstat'] == 'ok':
|
||||||
job_response_dict = dict([(job['job_id'], job) for job in job_response['response']['jobs']])
|
for job in job_response['response'].get('jobs', []):
|
||||||
for term in translation_terms:
|
self._update_terms_job(cr, uid, job, context=context)
|
||||||
up_term = up_comment = 0
|
|
||||||
vals = {}
|
|
||||||
if job_response_dict[term.job_id]['status'] == 'approved':
|
|
||||||
vals.update({'state': 'translated',
|
|
||||||
'value': job_response_dict[term.job_id]['body_tgt']})
|
|
||||||
up_term += 1
|
|
||||||
job_comment = gengo.getTranslationJobComments(id=term.job_id)
|
|
||||||
if job_comment['opstat'] == 'ok':
|
|
||||||
gengo_comments = ""
|
|
||||||
for comment in job_comment['response']['thread']:
|
|
||||||
gengo_comments += _('%s\n-- Commented on %s by %s.\n\n') % (comment['body'], time.ctime(comment['ctime']), comment['author'])
|
|
||||||
vals.update({'gengo_comment': gengo_comments})
|
|
||||||
up_comment += 1
|
|
||||||
if vals:
|
|
||||||
translation_pool.write(cr, uid, term.id, vals)
|
|
||||||
_logger.info("Successfully Updated `%d` terms and %d Comments." % (up_term, up_comment))
|
|
||||||
if not len(translation_ids) == limit:
|
|
||||||
break
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
def _update_terms_job(self, cr, uid, job, context=None):
|
||||||
|
translation_pool = self.pool.get('ir.translation')
|
||||||
|
tid = int(job['custom_data'])
|
||||||
|
vals = {}
|
||||||
|
if job.get('job_id', False):
|
||||||
|
vals['job_id'] = job['job_id']
|
||||||
|
vals['state'] = 'inprogress'
|
||||||
|
if job.get('status', False) in ('queued','available','pending','reviewable'):
|
||||||
|
vals['state'] = 'inprogress'
|
||||||
|
if job.get('body_tgt', False) and job.get('status', False)=='approved':
|
||||||
|
vals['value'] = job['body_tgt']
|
||||||
|
if job.get('status', False) in ('approved', 'canceled'):
|
||||||
|
vals['state'] = 'translated'
|
||||||
|
if vals:
|
||||||
|
translation_pool.write(cr, uid, [tid], vals, context=context)
|
||||||
|
|
||||||
def _update_terms(self, cr, uid, response, context=None):
|
def _update_terms(self, cr, uid, response, context=None):
|
||||||
"""
|
"""
|
||||||
Update the terms after their translation were requested to Gengo
|
Update the terms after their translation were requested to Gengo
|
||||||
"""
|
"""
|
||||||
translation_pool = self.pool.get('ir.translation')
|
for jobs in response.get('jobs', []):
|
||||||
for jobs in response['jobs']:
|
|
||||||
for t_id, res in jobs.items():
|
for t_id, res in jobs.items():
|
||||||
vals = {}
|
self._update_terms_job(cr, uid, res, context=context)
|
||||||
t_id = int(t_id)
|
|
||||||
tier = translation_pool.read(cr, uid, [t_id], ['gengo_translation'], context=context)[0]['gengo_translation']
|
|
||||||
if tier == "machine":
|
|
||||||
vals.update({'value': res['body_tgt'], 'state': 'translated'})
|
|
||||||
else:
|
|
||||||
vals.update({'job_id': res['job_id'], 'state': 'inprogress'})
|
|
||||||
translation_pool.write(cr, uid, [t_id], vals, context=context)
|
|
||||||
return
|
return
|
||||||
|
|
||||||
def pack_jobs_request(self, cr, uid, term_ids, context=None):
|
def pack_jobs_request(self, cr, uid, term_ids, context=None):
|
||||||
|
@ -181,17 +171,22 @@ class base_gengo_translations(osv.osv_memory):
|
||||||
auto_approve = 1 if user.company_id.gengo_auto_approve else 0
|
auto_approve = 1 if user.company_id.gengo_auto_approve else 0
|
||||||
for term in translation_pool.browse(cr, uid, term_ids, context=context):
|
for term in translation_pool.browse(cr, uid, term_ids, context=context):
|
||||||
if re.search(r"\w", term.src or ""):
|
if re.search(r"\w", term.src or ""):
|
||||||
jobs[term.id] = {'type': 'text',
|
comment = user.company_id.gengo_comment or ''
|
||||||
'slug': 'single::English to ' + term.lang,
|
if term.gengo_comment:
|
||||||
|
comment+='\n' + term.gengo_comment
|
||||||
|
jobs[time.strftime('%Y%m%d%H%M%S') + '-' + str(term.id)] = {
|
||||||
|
'type': 'text',
|
||||||
|
'slug': 'Single :: English to ' + term.lang,
|
||||||
'tier': tools.ustr(term.gengo_translation),
|
'tier': tools.ustr(term.gengo_translation),
|
||||||
|
'custom_data': str(term.id),
|
||||||
'body_src': term.src,
|
'body_src': term.src,
|
||||||
'lc_src': 'en',
|
'lc_src': 'en',
|
||||||
'lc_tgt': translation_pool._get_gengo_corresponding_language(term.lang),
|
'lc_tgt': translation_pool._get_gengo_corresponding_language(term.lang),
|
||||||
'auto_approve': auto_approve,
|
'auto_approve': auto_approve,
|
||||||
'comment': user.company_id.gengo_comment and "%s %s"%(user.company_id.gengo_comment,term.gengo_comment) or term.gengo_comment,
|
'comment': comment,
|
||||||
'callback_url': self.pool.get('ir.config_parameter').get_param(cr, uid,'web.base.url') + '/website/gengo_callback/' + str(term.id)
|
'callback_url': self.pool.get('ir.config_parameter').get_param(cr, uid,'web.base.url') + '/website/gengo_callback'
|
||||||
}
|
}
|
||||||
return {'jobs': jobs}
|
return {'jobs': jobs, 'as_group': 1}
|
||||||
|
|
||||||
|
|
||||||
def _send_translation_terms(self, cr, uid, term_ids, context=None):
|
def _send_translation_terms(self, cr, uid, term_ids, context=None):
|
||||||
|
@ -223,15 +218,14 @@ class base_gengo_translations(osv.osv_memory):
|
||||||
context = {}
|
context = {}
|
||||||
language_pool = self.pool.get('res.lang')
|
language_pool = self.pool.get('res.lang')
|
||||||
translation_pool = self.pool.get('ir.translation')
|
translation_pool = self.pool.get('ir.translation')
|
||||||
|
domain = [('state', '=', 'to_translate'), ('gengo_translation', 'in', ('machine', 'standard', 'pro', 'ultra')), ('job_id', "=", False)]
|
||||||
|
if context.get('gengo_language', False):
|
||||||
|
lc = language_pool.browse(cr, uid, context['gengo_language'], context=context).code
|
||||||
|
domain.append( ('lang', '=', lc) )
|
||||||
|
|
||||||
|
all_term_ids = translation_pool.search(cr, uid, domain, context=context)
|
||||||
try:
|
try:
|
||||||
#by default, the request will be made for all terms that needs it, whatever the language
|
|
||||||
lang_ids = language_pool.search(cr, uid, [], context=context)
|
|
||||||
if context.get('gengo_language'):
|
|
||||||
#but if this specific key is given, then we restrict the request on terms of this language only
|
|
||||||
lang_ids = [context.get('gengo_language')]
|
|
||||||
langs = [lang.code for lang in language_pool.browse(cr, uid, lang_ids, context=context)]
|
|
||||||
offset = 0
|
offset = 0
|
||||||
all_term_ids = translation_pool.search(cr, uid, [('state', '=', 'to_translate'), ('gengo_translation', 'in', ('machine', 'standard', 'pro', 'ultra')), ('lang', 'in', langs), ('job_id', "=", False)], context=context)
|
|
||||||
while True:
|
while True:
|
||||||
#search for the n first terms to translate
|
#search for the n first terms to translate
|
||||||
term_ids = all_term_ids[offset:offset + limit]
|
term_ids = all_term_ids[offset:offset + limit]
|
||||||
|
|
|
@ -1476,7 +1476,7 @@ class calendar_event(osv.Model):
|
||||||
self.create_attendees(cr, uid, [res], context=context)
|
self.create_attendees(cr, uid, [res], context=context)
|
||||||
return res
|
return res
|
||||||
|
|
||||||
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
|
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False, lazy=True):
|
||||||
if not context:
|
if not context:
|
||||||
context = {}
|
context = {}
|
||||||
|
|
||||||
|
@ -1484,7 +1484,7 @@ class calendar_event(osv.Model):
|
||||||
raise osv.except_osv(_('Warning!'), _('Group by date is not supported, use the calendar view instead.'))
|
raise osv.except_osv(_('Warning!'), _('Group by date is not supported, use the calendar view instead.'))
|
||||||
virtual_id = context.get('virtual_id', True)
|
virtual_id = context.get('virtual_id', True)
|
||||||
context.update({'virtual_id': False})
|
context.update({'virtual_id': False})
|
||||||
res = super(calendar_event, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby)
|
res = super(calendar_event, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby, lazy=lazy)
|
||||||
for result in res:
|
for result in res:
|
||||||
#remove the count, since the value is not consistent with the result of the search when expand the group
|
#remove the count, since the value is not consistent with the result of the search when expand the group
|
||||||
for groupname in groupby:
|
for groupname in groupby:
|
||||||
|
|
|
@ -105,9 +105,9 @@
|
||||||
<field name="phone"/>
|
<field name="phone"/>
|
||||||
<field name="nb_register" />
|
<field name="nb_register" />
|
||||||
<field name="state"/>
|
<field name="state"/>
|
||||||
<button name="registration_open" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
|
<button name="registration_open" string="Confirm Registration" states="draft" type="object"/>
|
||||||
<button name="button_reg_close" string="Attended the Event" states="open" type="object" icon="gtk-jump-to"/>
|
<button name="button_reg_close" string="Attended the Event" states="open" type="object"/>
|
||||||
<button name="button_reg_cancel" string="Cancel Registration" states="draft,open" type="object" icon="gtk-cancel"/>
|
<button name="button_reg_cancel" string="Cancel Registration" states="draft,open" type="object"/>
|
||||||
</tree>
|
</tree>
|
||||||
<form string="Registration">
|
<form string="Registration">
|
||||||
<field name="partner_id" attrs="{'readonly':[('state','!=', 'draft')]}" on_change="onchange_partner_id(partner_id, context)" />
|
<field name="partner_id" attrs="{'readonly':[('state','!=', 'draft')]}" on_change="onchange_partner_id(partner_id, context)" />
|
||||||
|
@ -125,9 +125,9 @@
|
||||||
<separator string="" colspan="4"/>
|
<separator string="" colspan="4"/>
|
||||||
<newline/>
|
<newline/>
|
||||||
<field name="state" colspan="2"/>
|
<field name="state" colspan="2"/>
|
||||||
<button name="registration_open" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
|
<button name="registration_open" string="Confirm Registration" states="draft" type="object"/>
|
||||||
<button name="button_reg_close" string="Attended the Event" states="open" type="object" icon="gtk-jump-to"/>
|
<button name="button_reg_close" string="Attended the Event" states="open" type="object"/>
|
||||||
<button name="button_reg_cancel" string="Cancel Registration" states="draft,open" type="object" icon="gtk-cancel"/>
|
<button name="button_reg_cancel" string="Cancel Registration" states="draft,open" type="object"/>
|
||||||
</group>
|
</group>
|
||||||
</form>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
|
@ -263,21 +263,21 @@
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="Events">
|
<search string="Events">
|
||||||
<field name="name" string="Events"/>
|
<field name="name" string="Events"/>
|
||||||
<filter icon="terp-mail-message-new" string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
|
<filter string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
|
||||||
<separator/>
|
<separator/>
|
||||||
<filter icon="terp-check" string="Unconfirmed" name="draft" domain="[('state','=','draft')]" help="Events in New state"/>
|
<filter string="Unconfirmed" name="draft" domain="[('state','=','draft')]" help="Events in New state"/>
|
||||||
<filter icon="terp-camera_test" string="Confirmed" domain="[('state','=','confirm')]" help="Confirmed events"/>
|
<filter string="Confirmed" domain="[('state','=','confirm')]" help="Confirmed events"/>
|
||||||
<separator/>
|
<separator/>
|
||||||
<filter icon="terp-personal" string="My Events" help="My Events" domain="[('user_id','=',uid)]"/>
|
<filter string="My Events" help="My Events" domain="[('user_id','=',uid)]"/>
|
||||||
<separator/>
|
<separator/>
|
||||||
<filter icon="terp-go-today" string="Upcoming" name="upcoming" domain="[('date_begin','>=', time.strftime('%%Y-%%m-%%d 00:00:00'))]" help="Upcoming events from today" />
|
<filter string="Upcoming" name="upcoming" domain="[('date_begin','>=', time.strftime('%%Y-%%m-%%d 00:00:00'))]" help="Upcoming events from today" />
|
||||||
<field name="type"/>
|
<field name="type"/>
|
||||||
<field name="user_id"/>
|
<field name="user_id"/>
|
||||||
<group expand="0" string="Group By...">
|
<group expand="0" string="Group By...">
|
||||||
<filter string="Responsible" icon="terp-personal" context="{'group_by': 'user_id'}"/>
|
<filter string="Responsible" context="{'group_by': 'user_id'}"/>
|
||||||
<filter string="Event Type" icon="terp-crm" context="{'group_by':'type'}"/>
|
<filter string="Event Type" context="{'group_by':'type'}"/>
|
||||||
<filter string="Status" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
|
<filter string="Status" context="{'group_by':'state'}"/>
|
||||||
<filter string="Start Month" icon="terp-go-month" domain="[]" context="{'group_by':'date_begin'}"/>
|
<filter string="Start Month" domain="[]" context="{'group_by':'date_begin'}"/>
|
||||||
</group>
|
</group>
|
||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
|
@ -333,9 +333,9 @@
|
||||||
<field name="origin"/>
|
<field name="origin"/>
|
||||||
<field name="state"/>
|
<field name="state"/>
|
||||||
<field name="message_unread" invisible="1"/>
|
<field name="message_unread" invisible="1"/>
|
||||||
<button name="registration_open" string="Confirm Registration" states="draft" type="object" icon="gtk-apply"/>
|
<button name="registration_open" string="Confirm Registration" states="draft" type="object"/>
|
||||||
<button name="button_reg_close" string="Attended the Event" states="open" type="object" icon="gtk-jump-to"/>
|
<button name="button_reg_close" string="Attended the Event" states="open" type="object"/>
|
||||||
<button name="button_reg_cancel" string="Cancel Registration" states="draft,open" type="object" icon="gtk-cancel"/>
|
<button name="button_reg_cancel" string="Cancel Registration" states="draft,open" type="object"/>
|
||||||
</tree>
|
</tree>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
@ -367,7 +367,7 @@
|
||||||
<field name="email" class="oe_inline"/>
|
<field name="email" class="oe_inline"/>
|
||||||
<button class="oe_inline oe_right" string="Send Email"
|
<button class="oe_inline oe_right" string="Send Email"
|
||||||
name="%(mail.action_email_compose_message_wizard)d"
|
name="%(mail.action_email_compose_message_wizard)d"
|
||||||
icon="terp-mail-message-new" context= '{"default_email_to":email}' type="action"/>
|
context= '{"default_email_to":email}' type="action"/>
|
||||||
</div>
|
</div>
|
||||||
</group>
|
</group>
|
||||||
<group>
|
<group>
|
||||||
|
@ -420,20 +420,20 @@
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<search string="Event Registration">
|
<search string="Event Registration">
|
||||||
<field name="name" string="Participant" filter_domain="['|','|',('name','ilike',self),('email','ilike',self),('origin','ilike',self)]"/>
|
<field name="name" string="Participant" filter_domain="['|','|',('name','ilike',self),('email','ilike',self),('origin','ilike',self)]"/>
|
||||||
<filter icon="terp-mail-message-new" string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
|
<filter string="Unread Messages" name="message_unread" domain="[('message_unread','=',True)]"/>
|
||||||
<separator/>
|
<separator/>
|
||||||
<filter icon="terp-check" string="New" name="draft" domain="[('state','=','draft')]" help="Registrations in unconfirmed state"/>
|
<filter string="New" name="draft" domain="[('state','=','draft')]" help="Registrations in unconfirmed state"/>
|
||||||
<filter icon="terp-camera_test" string="Confirmed" domain="[('state','=','open')]" help="Confirmed registrations"/>
|
<filter string="Confirmed" domain="[('state','=','open')]" help="Confirmed registrations"/>
|
||||||
<separator/>
|
<separator/>
|
||||||
<filter icon="terp-personal" string="My Registrations" help="My Registrations" domain="[('user_id','=',uid)]"/>
|
<filter string="My Registrations" help="My Registrations" domain="[('user_id','=',uid)]"/>
|
||||||
<field name="event_id"/>
|
<field name="event_id"/>
|
||||||
<field name="user_id"/>
|
<field name="user_id"/>
|
||||||
<field name="partner_id"/>
|
<field name="partner_id"/>
|
||||||
<group expand="0" string="Group By...">
|
<group expand="0" string="Group By...">
|
||||||
<filter string="Responsible" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
|
<filter string="Responsible" domain="[]" context="{'group_by':'user_id'}"/>
|
||||||
<filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
|
<filter string="Partner" domain="[]" context="{'group_by':'partner_id'}"/>
|
||||||
<filter string="Event" icon="terp-crm" domain="[]" context="{'group_by':'event_id'}"/>
|
<filter string="Event" name="group_event" domain="[]" context="{'group_by':'event_id'}"/>
|
||||||
<filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
<filter string="Status" domain="[]" context="{'group_by':'state'}"/>
|
||||||
</group>
|
</group>
|
||||||
</search>
|
</search>
|
||||||
</field>
|
</field>
|
||||||
|
|
|
@ -17,6 +17,28 @@
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="view_event_registration_ticket_search">
|
||||||
|
<field name="name">event.registration.ticket.search</field>
|
||||||
|
<field name="model">event.registration</field>
|
||||||
|
<field name="inherit_id" ref="event.view_registration_search" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<filter name="group_event" position="after">
|
||||||
|
<filter string="Ticket Type" domain="[]" context="{'group_by':'event_ticket_id'}"/>
|
||||||
|
</filter>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
|
<record model="ir.ui.view" id="view_event_registration_ticket_tree">
|
||||||
|
<field name="name">event.registration.ticket.tree</field>
|
||||||
|
<field name="model">event.registration</field>
|
||||||
|
<field name="inherit_id" ref="event.view_event_registration_tree" />
|
||||||
|
<field name="arch" type="xml">
|
||||||
|
<field name="event_id" position="after">
|
||||||
|
<field name="event_ticket_id"/>
|
||||||
|
</field>
|
||||||
|
</field>
|
||||||
|
</record>
|
||||||
|
|
||||||
<record model="ir.ui.view" id="event_sale_product_template_form">
|
<record model="ir.ui.view" id="event_sale_product_template_form">
|
||||||
<field name="model">product.template</field>
|
<field name="model">product.template</field>
|
||||||
<field name="inherit_id" ref="product.product_template_form_view" />
|
<field name="inherit_id" ref="product.product_template_form_view" />
|
||||||
|
|
|
@ -91,7 +91,7 @@ class IdeaIdea(osv.Model):
|
||||||
# Technical stuff
|
# Technical stuff
|
||||||
#------------------------------------------------------
|
#------------------------------------------------------
|
||||||
|
|
||||||
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
|
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False, lazy=True):
|
||||||
""" Override read_group to always display all states. """
|
""" Override read_group to always display all states. """
|
||||||
if groupby and groupby[0] == "state":
|
if groupby and groupby[0] == "state":
|
||||||
# Default result structure
|
# Default result structure
|
||||||
|
@ -103,7 +103,7 @@ class IdeaIdea(osv.Model):
|
||||||
'state_count': 0,
|
'state_count': 0,
|
||||||
} for state_value, state_name in states]
|
} for state_value, state_name in states]
|
||||||
# Get standard results
|
# Get standard results
|
||||||
read_group_res = super(IdeaIdea, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context, orderby)
|
read_group_res = super(IdeaIdea, self).read_group(cr, uid, domain, fields, groupby, offset, limit, context, orderby, lazy)
|
||||||
# Update standard results with default results
|
# Update standard results with default results
|
||||||
result = []
|
result = []
|
||||||
for state_value, state_name in states:
|
for state_value, state_name in states:
|
||||||
|
@ -114,7 +114,7 @@ class IdeaIdea(osv.Model):
|
||||||
result.append(res[0])
|
result.append(res[0])
|
||||||
return result
|
return result
|
||||||
else:
|
else:
|
||||||
return super(IdeaIdea, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby)
|
return super(IdeaIdea, self).read_group(cr, uid, domain, fields, groupby, offset=offset, limit=limit, context=context, orderby=orderby, lazy=lazy)
|
||||||
|
|
||||||
#------------------------------------------------------
|
#------------------------------------------------------
|
||||||
# Workflow / Actions
|
# Workflow / Actions
|
||||||
|
|
|
@ -116,7 +116,7 @@ class note_note(osv.osv):
|
||||||
}
|
}
|
||||||
_order = 'sequence'
|
_order = 'sequence'
|
||||||
|
|
||||||
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False):
|
def read_group(self, cr, uid, domain, fields, groupby, offset=0, limit=None, context=None, orderby=False, lazy=True):
|
||||||
if groupby and groupby[0]=="stage_id":
|
if groupby and groupby[0]=="stage_id":
|
||||||
|
|
||||||
#search all stages
|
#search all stages
|
||||||
|
@ -169,7 +169,7 @@ class note_note(osv.osv):
|
||||||
|
|
||||||
else:
|
else:
|
||||||
return super(note_note, self).read_group(self, cr, uid, domain, fields, groupby,
|
return super(note_note, self).read_group(self, cr, uid, domain, fields, groupby,
|
||||||
offset=offset, limit=limit, context=context, orderby=orderby)
|
offset=offset, limit=limit, context=context, orderby=orderby,lazy=lazy)
|
||||||
|
|
||||||
|
|
||||||
#upgrade config setting page to configure pad, fancy and tags mode
|
#upgrade config setting page to configure pad, fancy and tags mode
|
||||||
|
|
|
@ -13,6 +13,7 @@ openerp.pad = function(instance) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
self.set("configured", true);
|
self.set("configured", true);
|
||||||
});
|
});
|
||||||
|
this.pad_loading_request = null;
|
||||||
},
|
},
|
||||||
initialize_content: function() {
|
initialize_content: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
@ -30,14 +31,14 @@ openerp.pad = function(instance) {
|
||||||
},
|
},
|
||||||
render_value: function() {
|
render_value: function() {
|
||||||
var self = this;
|
var self = this;
|
||||||
this._configured_deferred.always(function() {
|
$.when(this._configured_deferred, this.pad_loading_request).always(function() {
|
||||||
if (! self.get('configured')) {
|
if (! self.get('configured')) {
|
||||||
return;
|
return;
|
||||||
};
|
};
|
||||||
var value = self.get('value');
|
var value = self.get('value');
|
||||||
if (self.get('effective_readonly')) {
|
if (self.get('effective_readonly')) {
|
||||||
if (_.str.startsWith(value, 'http')) {
|
if (_.str.startsWith(value, 'http')) {
|
||||||
this.pad_loading_request = self.view.dataset.call('pad_get_content', {url: value}).done(function(data) {
|
self.pad_loading_request = self.view.dataset.call('pad_get_content', {url: value}).done(function(data) {
|
||||||
self.$('.oe_pad_content').removeClass('oe_pad_loading').html('<div class="oe_pad_readonly"><div>');
|
self.$('.oe_pad_content').removeClass('oe_pad_loading').html('<div class="oe_pad_readonly"><div>');
|
||||||
self.$('.oe_pad_readonly').html(data);
|
self.$('.oe_pad_readonly').html(data);
|
||||||
}).fail(function() {
|
}).fail(function() {
|
||||||
|
|
|
@ -7,11 +7,12 @@
|
||||||
'version': '1.0',
|
'version': '1.0',
|
||||||
'description': """Payment Acquirer Base Module""",
|
'description': """Payment Acquirer Base Module""",
|
||||||
'author': 'OpenERP SA',
|
'author': 'OpenERP SA',
|
||||||
'depends': ['mail', 'account'],
|
'depends': ['account'],
|
||||||
'data': [
|
'data': [
|
||||||
'views/payment_acquirer.xml',
|
'views/payment_acquirer.xml',
|
||||||
'views/res_config_view.xml',
|
'views/res_config_view.xml',
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
],
|
],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
|
'auto_install': True,
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,6 +118,7 @@
|
||||||
</div>
|
</div>
|
||||||
<field name="company_id" groups="base.group_multi_company" widget="selection"
|
<field name="company_id" groups="base.group_multi_company" widget="selection"
|
||||||
attrs="{'invisible': [('is_only_child', '=', False)]}"/>
|
attrs="{'invisible': [('is_only_child', '=', False)]}"/>
|
||||||
|
<field name="active" />
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<field name="description" placeholder="describe the product characteristics..."
|
<field name="description" placeholder="describe the product characteristics..."
|
||||||
|
|
|
@ -82,7 +82,6 @@
|
||||||
<div attrs="{'invisible':[('type','=','service')]}">
|
<div attrs="{'invisible':[('type','=','service')]}">
|
||||||
<field name="produce_delay" class="oe_inline"/> days
|
<field name="produce_delay" class="oe_inline"/> days
|
||||||
</div>
|
</div>
|
||||||
<field name="active"/>
|
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<xpath expr="//group[@string='Sale Conditions']" position="inside">
|
<xpath expr="//group[@string='Sale Conditions']" position="inside">
|
||||||
|
|
|
@ -1399,6 +1399,9 @@
|
||||||
start : function () {
|
start : function () {
|
||||||
var self = this;
|
var self = this;
|
||||||
this._super();
|
this._super();
|
||||||
|
if (!self.$target.data("snippet-view")) {
|
||||||
|
this.$target.data("snippet-view", new website.snippet.animationRegistry.parallax(this.$target));
|
||||||
|
}
|
||||||
this.scroll();
|
this.scroll();
|
||||||
this.$target.on('snippet-style-change snippet-style-preview', function () {
|
this.$target.on('snippet-style-change snippet-style-preview', function () {
|
||||||
self.$target.data("snippet-view").set_values();
|
self.$target.data("snippet-view").set_values();
|
||||||
|
|
|
@ -4,9 +4,6 @@ import openerp
|
||||||
from openerp.addons.web import http
|
from openerp.addons.web import http
|
||||||
from openerp.addons.web.http import request
|
from openerp.addons.web.http import request
|
||||||
import time
|
import time
|
||||||
import json
|
|
||||||
from openerp.tools.translate import _
|
|
||||||
|
|
||||||
|
|
||||||
GENGO_DEFAULT_LIMIT = 20
|
GENGO_DEFAULT_LIMIT = 20
|
||||||
|
|
||||||
|
@ -40,21 +37,3 @@ class website_gengo(http.Controller):
|
||||||
def post_gengo_jobs(self):
|
def post_gengo_jobs(self):
|
||||||
request.registry['base.gengo.translations']._sync_request(request.cr, request.uid, limit=GENGO_DEFAULT_LIMIT, context=request.context)
|
request.registry['base.gengo.translations']._sync_request(request.cr, request.uid, limit=GENGO_DEFAULT_LIMIT, context=request.context)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@http.route('/website/gengo_callback/<model("ir.translation"):term>', type='http', auth='none')
|
|
||||||
def gengo_callback(self,term,**post):
|
|
||||||
if post and post.get('job'):
|
|
||||||
translation_pool = request.registry['ir.translation']
|
|
||||||
base_gengo_pool = request.registry['base.gengo.translations']
|
|
||||||
job, vals = json.loads(post['job']), {}
|
|
||||||
if job.get('status') == 'approved':
|
|
||||||
vals.update({'state': 'translated', 'value': job.get('body_tgt')})
|
|
||||||
flag, gengo = base_gengo_pool.gengo_authentication(request.cr, openerp.SUPERUSER_ID, context=request.context)
|
|
||||||
job_comment = gengo.getTranslationJobComments(id=job.get('job_id'))
|
|
||||||
if job_comment['opstat']=='ok':
|
|
||||||
gengo_comments=""
|
|
||||||
for comment in job_comment['response']['thread']:
|
|
||||||
gengo_comments += _('%s\n-- Commented on %s by %s.\n\n') % (comment['body'], time.ctime(comment['ctime']), comment['author'])
|
|
||||||
vals.update({'gengo_comment': gengo_comments})
|
|
||||||
if vals:
|
|
||||||
translation_pool.write(request.cr, openerp.SUPERUSER_ID, term.id, vals)
|
|
||||||
|
|
|
@ -56,7 +56,7 @@
|
||||||
new_content:self.getInitialContent(this),
|
new_content:self.getInitialContent(this),
|
||||||
translation_id: data.oeTranslationId || null,
|
translation_id: data.oeTranslationId || null,
|
||||||
gengo_translation: gengo_service_level,
|
gengo_translation: gengo_service_level,
|
||||||
gengo_comment:"Original page:" + document.URL
|
gengo_comment:"\nOriginal Page: " + document.URL
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
openerp.jsonRpc('/website/set_translations', 'call', {
|
openerp.jsonRpc('/website/set_translations', 'call', {
|
||||||
|
|
|
@ -6,3 +6,4 @@ access_sale_quote_line_manager,sale.quote.line,model_sale_quote_line,base.group_
|
||||||
access_sale_quote_option,sale.quote.option,model_sale_quote_option,base.group_sale_salesman,1,0,0,0
|
access_sale_quote_option,sale.quote.option,model_sale_quote_option,base.group_sale_salesman,1,0,0,0
|
||||||
access_sale_quote_option_manager,sale.quote.option,model_sale_quote_option,base.group_sale_manager,1,1,1,1
|
access_sale_quote_option_manager,sale.quote.option,model_sale_quote_option,base.group_sale_manager,1,1,1,1
|
||||||
access_sale_order_option,sale.order.option,model_sale_order_option,base.group_sale_salesman,1,1,1,1
|
access_sale_order_option,sale.order.option,model_sale_order_option,base.group_sale_salesman,1,1,1,1
|
||||||
|
access_sale_order_option_all,sale.order.option,model_sale_order_option,,1,0,0,0
|
||||||
|
|
|
|
@ -43,7 +43,7 @@ class CheckoutInfo(object):
|
||||||
result = dict((prefix + field_name, getattr(partner, field_name)) for field_name in self.string_billing_fields if getattr(partner, field_name))
|
result = dict((prefix + field_name, getattr(partner, field_name)) for field_name in self.string_billing_fields if getattr(partner, field_name))
|
||||||
result[prefix + 'state_id'] = partner.state_id and partner.state_id.id or ''
|
result[prefix + 'state_id'] = partner.state_id and partner.state_id.id or ''
|
||||||
result[prefix + 'country_id'] = partner.country_id and partner.country_id.id or ''
|
result[prefix + 'country_id'] = partner.country_id and partner.country_id.id or ''
|
||||||
result[prefix + 'company'] = partner.parent_id and partner.parent_id.name or ''
|
result[prefix + 'company'] = partner.commercial_partner_id and partner.commercial_partner_id.is_company and partner.commercial_partner_id.name or ''
|
||||||
return result
|
return result
|
||||||
|
|
||||||
def from_post(self, post):
|
def from_post(self, post):
|
||||||
|
@ -383,6 +383,8 @@ class Ecommerce(http.Controller):
|
||||||
def add_cart(self, product_id, remove=None, **kw):
|
def add_cart(self, product_id, remove=None, **kw):
|
||||||
request.registry['website']._ecommerce_add_product_to_cart(request.cr, request.uid,
|
request.registry['website']._ecommerce_add_product_to_cart(request.cr, request.uid,
|
||||||
product_id=int(product_id),
|
product_id=int(product_id),
|
||||||
|
number=float(kw.get('number',1)),
|
||||||
|
set_number=float(kw.get('set_number',-1)),
|
||||||
context=request.context)
|
context=request.context)
|
||||||
return request.redirect("/shop/mycart")
|
return request.redirect("/shop/mycart")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue