Richard Mathot (OpenERP) 2014-04-07 09:39:46 +02:00
commit deae95f6af
61 changed files with 1003 additions and 294 deletions

View File

@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-12-21 17:04+0000\n"
"PO-Revision-Date: 2012-12-22 12:46+0000\n"
"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) <grzegorz@openglobe.pl>\n"
"PO-Revision-Date: 2014-04-04 19:18+0000\n"
"Last-Translator: Dariusz Żbikowski <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-03-27 06:26+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-04-05 05:30+0000\n"
"X-Generator: Launchpad (build 16976)\n"
#. module: account
#: model:process.transition,name:account.process_transition_supplierreconcilepaid0
@ -989,6 +989,8 @@ msgid ""
" opening/closing fiscal "
"year process."
msgstr ""
"Nie możesz anulować uzgodnień pozycji dziennika jeśli zostały one "
"wygenerowane procesem zamykania/otwierania roku."
#. module: account
#: model:ir.actions.act_window,name:account.action_subscription_form_new

View File

@ -543,33 +543,40 @@ class account_analytic_account(osv.osv):
'nodestroy': True,
}
def on_change_template(self, cr, uid, ids, template_id, context=None):
def on_change_template(self, cr, uid, ids, template_id, date_start=False, fix_price_invoices=False, invoice_on_timesheets=False, recurring_invoices=False, context=None):
if not template_id:
return {}
obj_analytic_line = self.pool.get('account.analytic.invoice.line')
res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, context=context)
res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, date_start=date_start, context=context)
template = self.browse(cr, uid, template_id, context=context)
invoice_line_ids = []
for x in template.recurring_invoice_line_ids:
invoice_line_ids.append((0, 0, {
'product_id': x.product_id.id,
'uom_id': x.uom_id.id,
'name': x.name,
'quantity': x.quantity,
'price_unit': x.price_unit,
'analytic_account_id': x.analytic_account_id and x.analytic_account_id.id or False,
}))
res['value']['fix_price_invoices'] = template.fix_price_invoices
res['value']['invoice_on_timesheets'] = template.invoice_on_timesheets
res['value']['hours_qtt_est'] = template.hours_qtt_est
res['value']['amount_max'] = template.amount_max
res['value']['to_invoice'] = template.to_invoice.id
res['value']['pricelist_id'] = template.pricelist_id.id
res['value']['recurring_invoices'] = template.recurring_invoices
res['value']['recurring_interval'] = template.recurring_interval
res['value']['recurring_rule_type'] = template.recurring_rule_type
res['value']['recurring_invoice_line_ids'] = invoice_line_ids
if not fix_price_invoices:
res['value']['fix_price_invoices'] = template.fix_price_invoices
res['value']['amount_max'] = template.amount_max
if not invoice_on_timesheets:
res['value']['invoice_on_timesheets'] = template.invoice_on_timesheets
res['value']['hours_qtt_est'] = template.hours_qtt_est
if template.to_invoice.id:
res['value']['to_invoice'] = template.to_invoice.id
if template.pricelist_id.id:
res['value']['pricelist_id'] = template.pricelist_id.id
if not recurring_invoices:
invoice_line_ids = []
for x in template.recurring_invoice_line_ids:
invoice_line_ids.append((0, 0, {
'product_id': x.product_id.id,
'uom_id': x.uom_id.id,
'name': x.name,
'quantity': x.quantity,
'price_unit': x.price_unit,
'analytic_account_id': x.analytic_account_id and x.analytic_account_id.id or False,
}))
res['value']['recurring_invoices'] = template.recurring_invoices
res['value']['recurring_interval'] = template.recurring_interval
res['value']['recurring_rule_type'] = template.recurring_rule_type
res['value']['recurring_invoice_line_ids'] = invoice_line_ids
return res
def onchange_recurring_invoices(self, cr, uid, ids, recurring_invoices, date_start=False, context=None):

View File

@ -38,6 +38,9 @@
<field name="partner_id" position="attributes">
<attribute name="attrs">{'required': [('type','=','contract'),'|','|',('fix_price_invoices','=',True), ('invoice_on_timesheets', '=', True), ('recurring_invoices', '=', True)]}</attribute>
</field>
<field name="template_id" position="attributes">
<attribute name="on_change">on_change_template(template_id, date_start, fix_price_invoices, invoice_on_timesheets, recurring_invoices)</attribute>
</field>
<xpath expr='//group[@name="invoice_on_timesheets"]' position="replace">
</xpath>
<xpath expr='//separator[@name="description"]' position='before'>

View File

@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-12-21 17:05+0000\n"
"PO-Revision-Date: 2012-12-12 17:49+0000\n"
"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) <grzegorz@openglobe.pl>\n"
"PO-Revision-Date: 2014-04-04 19:44+0000\n"
"Last-Translator: Dariusz Żbikowski <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-03-27 06:16+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-04-05 05:30+0000\n"
"X-Generator: Launchpad (build 16976)\n"
#. module: account_followup
#: model:email.template,subject:account_followup.email_template_account_followup_default
@ -109,7 +109,7 @@ msgstr "Kroki monitowania płatności"
#. module: account_followup
#: field:account_followup.print,email_body:0
msgid "Email Body"
msgstr ""
msgstr "Treść email"
#. module: account_followup
#: model:ir.actions.act_window,name:account_followup.action_account_followup_print
@ -403,7 +403,7 @@ msgstr "Monity o płatność"
#. module: account_followup
#: field:account_followup.followup.line,delay:0
msgid "Due Days"
msgstr ""
msgstr "Dni zwłoki"
#. module: account_followup
#: field:account.move.line,followup_line_id:0
@ -419,7 +419,7 @@ msgstr "Ostatni monit o płatność"
#. module: account_followup
#: model:ir.ui.menu,name:account_followup.menu_manual_reconcile_followup
msgid "Reconcile Invoices & Payments"
msgstr ""
msgstr "Uzgadnianie Faktur i Płatności"
#. module: account_followup
#: model:ir.ui.menu,name:account_followup.account_followup_s
@ -429,7 +429,7 @@ msgstr "Wykonaj manualnie monit o płatność"
#. module: account_followup
#: report:account_followup.followup.print:0
msgid "Li."
msgstr ""
msgstr "Sp."
#. module: account_followup
#: field:account_followup.print,email_conf:0
@ -499,6 +499,7 @@ msgstr "Monitowanie płatności"
#, python-format
msgid "Email not sent because of email address of partner not filled in"
msgstr ""
"Email nie został wysłany ponieważ adres email partnera nie został wypełniony"
#. module: account_followup
#: model:ir.model,name:account_followup.model_account_followup_followup
@ -511,6 +512,8 @@ msgid ""
"Optionally you can assign a user to this field, which will make him "
"responsible for the action."
msgstr ""
"Opcjonalnie możesz przypisać użytkownika do tego pola, który stanie się "
"odpowiedzialny za tę akcję."
#. module: account_followup
#: model:ir.model,name:account_followup.model_account_followup_sending_results
@ -528,7 +531,7 @@ msgstr ""
#: code:addons/account_followup/wizard/account_followup_print.py:172
#, python-format
msgid " manual action(s) assigned:"
msgstr ""
msgstr " ręczna akcja przypisana do:"
#. module: account_followup
#: view:res.partner:0
@ -548,13 +551,13 @@ msgstr "Przeszukaj monity o płatność"
#. module: account_followup
#: view:res.partner:0
msgid "Account Move line"
msgstr ""
msgstr "Pozycja zapisu"
#. module: account_followup
#: code:addons/account_followup/wizard/account_followup_print.py:237
#, python-format
msgid "Send Letters and Emails: Actions Summary"
msgstr ""
msgstr "Listy i Email: Podsumowanie akcji"
#. module: account_followup
#: view:account_followup.print:0
@ -916,7 +919,7 @@ msgstr ""
#. module: account_followup
#: view:res.partner:0
msgid "Responsible"
msgstr ""
msgstr "Odpowiedzialny"
#. module: account_followup
#: model:ir.ui.menu,name:account_followup.menu_finance_followup
@ -945,7 +948,7 @@ msgstr "Działanie monitowania płatności"
#. module: account_followup
#: view:account_followup.stat:0
msgid "Including journal entries marked as a litigation"
msgstr ""
msgstr "Załącz pozycje dziennika oznaczone jako sporne"
#. module: account_followup
#: report:account_followup.followup.print:0

View File

@ -203,7 +203,7 @@ class account_analytic_account(osv.osv):
}, string='Currency', type='many2one', relation='res.currency'),
}
def on_change_template(self, cr, uid, ids, template_id, context=None):
def on_change_template(self, cr, uid, ids, template_id, date_start=False, context=None):
if not template_id:
return {}
res = {'value':{}}
@ -213,7 +213,8 @@ class account_analytic_account(osv.osv):
to_dt = datetime.strptime(template.date, tools.DEFAULT_SERVER_DATE_FORMAT)
timedelta = to_dt - from_dt
res['value']['date'] = datetime.strftime(datetime.now() + timedelta, tools.DEFAULT_SERVER_DATE_FORMAT)
res['value']['date_start'] = fields.date.today()
if not date_start:
res['value']['date_start'] = fields.date.today()
res['value']['quantity_max'] = template.quantity_max
res['value']['parent_id'] = template.parent_id and template.parent_id.id or False
res['value']['description'] = template.description

View File

@ -27,7 +27,7 @@
</group>
<group>
<field name="type" invisible="context.get('default_type', False)"/>
<field name="template_id" on_change="on_change_template(template_id,context)" domain="[('type','=','template')]" attrs="{'invisible': [('type','in',['view', 'normal','template'])]}" context="{'default_type' : 'template'}"/>
<field name="template_id" on_change="on_change_template(template_id, date_start)" domain="[('type','=','template')]" attrs="{'invisible': [('type','in',['view', 'normal','template'])]}" context="{'default_type' : 'template'}"/>
<field name="code"/>
<field name="parent_id" on_change="on_change_parent(parent_id)" attrs="{'invisible': [('type','in',['contract'])]}"/>
<field name="company_id" on_change="on_change_company(company_id)" widget="selection" groups="base.group_multi_company" attrs="{'required': [('type','&lt;&gt;','view')]}"/>

View File

@ -115,8 +115,8 @@ class account_analytic_account(osv.osv):
digits_compute=dp.get_precision('Account')),
}
def on_change_template(self, cr, uid, id, template_id, context=None):
res = super(account_analytic_account, self).on_change_template(cr, uid, id, template_id, context=context)
def on_change_template(self, cr, uid, id, template_id, date_start=False, context=None):
res = super(account_analytic_account, self).on_change_template(cr, uid, id, template_id, date_start=date_start, context=context)
if template_id and 'value' in res:
template = self.browse(cr, uid, template_id, context=context)
res['value']['charge_expenses'] = template.charge_expenses

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-12-21 17:05+0000\n"
"PO-Revision-Date: 2012-12-12 18:01+0000\n"
"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) <grzegorz@openglobe.pl>\n"
"PO-Revision-Date: 2014-04-04 19:12+0000\n"
"Last-Translator: Dariusz Żbikowski <Unknown>\n"
"Language-Team: Polish <pl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-03-27 07:32+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-04-05 05:30+0000\n"
"X-Generator: Launchpad (build 16976)\n"
#. module: auth_signup
#: field:res.partner,signup_type:0
@ -80,7 +80,7 @@ msgstr "Wprowadź hasło o potwierdź je"
#. module: auth_signup
#: view:res.users:0
msgid "Send an email to the user to (re)set their password."
msgstr ""
msgstr "Wyślij email do użytkownika w celu zresetowania hasła"
#. module: auth_signup
#. openerp-web
@ -99,7 +99,7 @@ msgstr "Nowy"
#: code:addons/auth_signup/res_users.py:258
#, python-format
msgid "Mail sent to:"
msgstr ""
msgstr "Mail wysłano do:"
#. module: auth_signup
#: field:res.users,state:0
@ -191,7 +191,7 @@ msgstr "Proszę wprowadź nazwę użytkownika lub adres email."
#. module: auth_signup
#: selection:res.users,state:0
msgid "Resetting Password"
msgstr ""
msgstr "Resetowane hasło"
#. module: auth_signup
#. openerp-web

View File

@ -4,7 +4,7 @@
<!--Scheduler sync Receive Request-->
<record id="gengo_sync_receive_request_scheduler" model="ir.cron">
<field name="name" >Gengo Sync Translation (Response)</field>
<field eval="False" name="active"/>
<field eval="True" name="active"/>
<field name="interval_number">20</field>
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>
@ -16,7 +16,7 @@
<!--Scheduler Sync Send Request-->
<record id="gengo_sync_send_request_scheduler" model="ir.cron">
<field name="name" >Gengo Sync Translation (Request)</field>
<field eval="False" name="active"/>
<field eval="True" name="active"/>
<field name="interval_number">20</field>
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>

View File

@ -23,7 +23,7 @@ from openerp.osv import fields, osv
from openerp.tools.translate import _
LANG_CODE_MAPPING = {
'ar_SA': ('ar', 'Arabic'),
'ar_SY': ('ar', 'Arabic'),
'id_ID': ('id', 'Indonesian'),
'nl_NL': ('nl', 'Dutch'),
'fr_CA': ('fr-ca', 'French (Canada)'),
@ -41,7 +41,19 @@ LANG_CODE_MAPPING = {
'fr_BE': ('fr', 'French'),
'ru_RU': ('ru', 'Russian'),
'it_IT': ('it', 'Italian'),
'pt_BR': ('pt-br', 'Portuguese (Brazil)')
'pt_BR': ('pt-br', 'Portuguese (Brazil)'),
'th_TH': ('th', 'Thai'),
'nb_NO': ('no', 'Norwegian'),
'ro_RO': ('ro', 'Romanian'),
'tr_TR': ('tr', 'Turkish'),
'bg_BG': ('bg', 'Bulgarian'),
'da_DK': ('da', 'Danish'),
'en_GB': ('en-gb', 'English (British)'),
'el_GR': ('el', 'Greek'),
'vi_VN': ('vi', 'Vietnamese'),
'he_IL': ('he', 'Hebrew'),
'hu_HU': ('hu', 'Hungarian'),
'fi_FI': ('fi', 'Finnish')
}
class ir_translation(osv.Model):
@ -71,18 +83,3 @@ class ir_translation(osv.Model):
def _get_gengo_corresponding_language(cr, lang):
return lang in LANG_CODE_MAPPING and LANG_CODE_MAPPING[lang][0] or lang
def _check_lang_support(self, cr, uid, ids, context=None):
for term in self.browse(cr, uid, ids, context=context):
if term.gengo_translation:
supported_langs = self._get_all_supported_languages(cr, uid, context=context)
if supported_langs:
tier = "nonprofit" if term.gengo_translation == 'machine' else term.gengo_translation
language = self._get_gengo_corresponding_language(term.lang)
if tier not in supported_langs.get(language,[]):
return False
return True
_constraints = [
(_check_lang_support, 'The Gengo translation service selected is not supported for this language.', ['gengo_translation'])
]

View File

@ -30,6 +30,7 @@ class res_company(osv.Model):
"gengo_public_key": fields.text("Gengo Public Key"),
"gengo_comment": fields.text("Comments", help="This comment will be automatically be enclosed in each an every request sent to Gengo"),
"gengo_auto_approve": fields.boolean("Auto Approve Translation ?", help="Jobs are Automatically Approved by Gengo."),
"gengo_sandbox": fields.boolean("Sandbox Mode", help="Check this box if you're using the sandbox mode of Gengo, mainly used for testing purpose."),
}
_defaults = {

View File

@ -17,8 +17,13 @@
<field name="gengo_private_key" password="True" nolabel="1" placeholder="Add Gengo login Private Key..."/>
</group>
</group>
<group col="4">
<field name="gengo_auto_approve"/>
<group>
<group>
<field name="gengo_auto_approve"/>
</group>
<group>
<field name="gengo_sandbox"/>
</group>
</group>
<group string="Comments for Translator" col="1">
<field name="gengo_comment" nolabel="1" placeholder="Add your comments here for translator...."/>

View File

@ -40,22 +40,19 @@ except ImportError:
GENGO_DEFAULT_LIMIT = 20
DEFAULT_CRON_VALS = {
'active': True,
'interval_number': 20,
'interval_type': 'minutes',
'model': "'base.gengo.translations'",
'args': "'(%s,)'" % (str(GENGO_DEFAULT_LIMIT)),
}
class base_gengo_translations(osv.osv_memory):
_name = 'base.gengo.translations'
_columns = {
'restart_send_job': fields.boolean("Restart Sending Job"),
'sync_type': fields.selection([('send', 'Send New Terms'),
('receive', 'Receive Translation'),
('both', 'Both')], "Sync Type"),
'lang_id': fields.many2one('res.lang', 'Language', required=True),
'sync_limit': fields.integer("No. of terms to sync"),
}
_defaults = {'sync_type' : 'both',
'sync_limit' : 20
}
def gengo_authentication(self, cr, uid, context=None):
'''
This method tries to open a connection with Gengo. For that, it uses the Public and Private
@ -74,6 +71,7 @@ class base_gengo_translations(osv.osv_memory):
gengo = MyGengo(
public_key=user.company_id.gengo_public_key.encode('ascii'),
private_key=user.company_id.gengo_private_key.encode('ascii'),
sandbox = user.company_id.gengo_sandbox,
)
gengo.getAccountStats()
return (True, gengo)
@ -81,22 +79,6 @@ class base_gengo_translations(osv.osv_memory):
_logger.exception('Gengo connection failed')
return (False, _("Gengo connection failed with this message:\n``%s``") % e)
def do_check_schedular(self, cr, uid, xml_id, name, fn, context=None):
"""
This function is used to reset a cron to its default values, or to recreate it if it was deleted.
"""
cron_pool = self.pool.get('ir.cron')
cron_vals = DEFAULT_CRON_VALS.copy()
cron_vals.update({'name': name, "function": fn})
try:
res = []
_, res = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'base_gengo', xml_id)
cron_pool.write(cr, uid, [res], cron_vals, context=context)
except:
#the cron job was not found, probably deleted previously, so we create it again using default values
cron_vals.update({'numbercall': -1})
return cron_pool.create(cr, uid, cron_vals, context=context)
def act_update(self, cr, uid, ids, context=None):
'''
Function called by the wizard.
@ -113,15 +95,14 @@ class base_gengo_translations(osv.osv_memory):
if language not in supported_langs:
raise osv.except_osv(_("Warning"), _('This language is not supported by the Gengo translation services.'))
#send immediately a new request for the selected language (if any)
ctx = context.copy()
ctx['gengo_language'] = wizard.lang_id.id
self._sync_request(cr, uid, limit=GENGO_DEFAULT_LIMIT, context=ctx)
self._sync_response( cr, uid, limit=GENGO_DEFAULT_LIMIT, context=ctx)
#check the cron jobs and eventually restart/recreate them
if wizard.restart_send_job:
self.do_check_schedular(cr, uid, 'gengo_sync_send_request_scheduler', _('Gengo Sync Translation (Request)'), '_sync_request', context=context)
self.do_check_schedular(cr, uid, 'gengo_sync_receive_request_scheduler', _('Gengo Sync Translation (Response)'), '_sync_response', context=context)
if wizard.sync_limit > 200 or wizard.sync_limit < 1:
raise osv.except_osv(_("Warning"), _('Sync limit should between 1 to 200 for Gengo translation services.'))
if wizard.sync_type in ['send','both']:
self._sync_request(cr, uid, wizard.sync_limit, context=ctx)
if wizard.sync_type in ['receive','both']:
self._sync_response( cr, uid, wizard.sync_limit, context=ctx)
return {'type': 'ir.actions.act_window_close'}
def _sync_response(self, cr, uid, limit=GENGO_DEFAULT_LIMIT, context=None):
@ -135,31 +116,31 @@ class base_gengo_translations(osv.osv_memory):
if not flag:
_logger.warning("%s", gengo)
else:
translation_id = translation_pool.search(cr, uid, [('state', '=', 'inprogress'), ('gengo_translation', 'in', ('machine','standard','pro','ultra'))], limit=limit, context=context)
for term in translation_pool.browse(cr, uid, translation_id, context=context):
up_term = up_comment = 0
if term.job_id:
vals={}
job_response = gengo.getTranslationJob(id=term.job_id)
if job_response['opstat'] != 'ok':
_logger.warning("Invalid Response! Skipping translation Terms with `id` %s." % (term.job_id))
continue
if job_response['response']['job']['status'] == 'approved':
vals.update({'state': 'translated',
'value': job_response['response']['job']['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\n--\n Commented on %s by %s.') % (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 ))
else:
_logger.warning("%s", 'Cannot retrieve the Gengo job ID for translation %s: %s' % (term.id, term.src))
translation_id = translation_pool.search(cr, uid, [('state', '=', 'inprogress'), ('gengo_translation', 'in', ('machine','standard','pro','ultra')), ('job_id', "!=",False)], limit=limit, context=context)
translation_terms = translation_pool.browse(cr, uid, translation_id, context=context)
gengo_job_id = [term.job_id for term in translation_terms]
if gengo_job_id:
gengo_ids = ','.join(gengo_job_id)
job_response = gengo.getTranslationJobBatch(id=gengo_ids)
if job_response['opstat'] == 'ok':
job_response_dict = dict([(job['job_id'],job) for job in job_response['response']['jobs']])
for term in translation_terms:
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 ))
return True
def _update_terms(self, cr, uid, response, context=None):
@ -200,7 +181,8 @@ class base_gengo_translations(osv.osv_memory):
'lc_src': 'en',
'lc_tgt': translation_pool._get_gengo_corresponding_language(term.lang),
'auto_approve': auto_approve,
'comment': user.company_id.gengo_comment,
'comment': user.company_id.gengo_comment and "%s %s"%(user.company_id.gengo_comment,term.gengo_comment) or term.gengo_comment,
'callback_url': self.pool.get('ir.config_parameter').get_param(cr, uid,'web.base.url') + '/website/gengo_callback/' + str(term.id)
}
return {'jobs': jobs}
@ -242,7 +224,7 @@ class base_gengo_translations(osv.osv_memory):
lang_ids = [context.get('gengo_language')]
langs = [lang.code for lang in language_pool.browse(cr, uid, lang_ids, context=context)]
#search for the n first terms to translate
term_ids = translation_pool.search(cr, uid, [('state', '=', 'to_translate'), ('gengo_translation', 'in', ('machine','standard','pro','ultra')), ('lang', 'in', langs)], limit=limit, context=context)
term_ids = translation_pool.search(cr, uid, [('state', '=', 'to_translate'), ('gengo_translation', 'in', ('machine','standard','pro','ultra')), ('lang', 'in', langs),('job_id',"=",False)], limit=limit, context=context)
if term_ids:
self._send_translation_terms(cr, uid, term_ids, context=context)
_logger.info("%s Translation terms have been posted to Gengo successfully", len(term_ids))

View File

@ -8,7 +8,14 @@
<form string="Gengo Request Form" version="7.0">
<group>
<field name="lang_id"/>
<field name="restart_send_job"/>
</group>
<group>
<group>
<field name="sync_type" widget="radio"/>
</group>
<group>
<field name="sync_limit" required="1"/>
</group>
</group>
<footer>
<button name="act_update" string="Send" type="object" class="oe_highlight"/>

View File

@ -37,7 +37,7 @@ This is a complete document management system.
""",
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ['knowledge'],
'depends': ['knowledge', 'mail'],
'data': [
'security/document_security.xml',
'document_view.xml',

View File

@ -235,7 +235,6 @@
<field name="partner_id"/>
<field name="type"/>
</tree>
</field>
</record>
@ -244,6 +243,7 @@
<field name="type">ir.actions.act_window</field>
<field name="res_model">ir.attachment</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a new document.

View File

@ -111,16 +111,30 @@ class event_event(osv.osv):
"""Get reserved, available, reserved but unconfirmed and used seats.
@return: Dictionary of function field values.
"""
res = dict([(id, {}) for id in ids])
for event in self.browse(cr, uid, ids, context=context):
res[event.id]['seats_reserved'] = sum(reg.nb_register for reg in event.registration_ids if reg.state == "open")
res[event.id]['seats_used'] = sum(reg.nb_register for reg in event.registration_ids if reg.state == "done")
res[event.id]['seats_unconfirmed'] = sum(reg.nb_register for reg in event.registration_ids if reg.state == "draft")
keys = {'draft': 'seats_unconfirmed', 'open':'seats_reserved', 'done': 'seats_used'}
res = {}
for event_id in ids:
res[event_id] = {key:0 for key in keys.values()}
query = "SELECT state, sum(nb_register) FROM event_registration WHERE event_id = %s AND state IN ('draft','open','done') GROUP BY state"
for event in self.pool.get('event.event').browse(cr, uid, ids, context=context):
cr.execute(query, (event.id,))
reg_states = cr.fetchall()
for reg_state in reg_states:
res[event.id][keys[reg_state[0]]] = reg_state[1]
res[event.id]['seats_available'] = event.seats_max - \
(res[event.id]['seats_reserved'] + res[event.id]['seats_used']) \
if event.seats_max > 0 else None
return res
def _get_events_from_registrations(self, cr, uid, ids, context=None):
"""Get reserved, available, reserved but unconfirmed and used seats, of the event related to a registration.
@return: Dictionary of function field values.
"""
event_ids=set()
for registration in self.browse(cr, uid, ids, context=context):
event_ids.add(registration.event_id.id)
return list(event_ids)
def _subscribe_fnc(self, cr, uid, ids, fields, args, context=None):
"""This functional fields compute if the current user (uid) is already subscribed or not to the event passed in parameter (ids)
"""
@ -142,10 +156,18 @@ class event_event(osv.osv):
'type': fields.many2one('event.type', 'Type of Event', readonly=False, states={'done': [('readonly', True)]}),
'seats_max': fields.integer('Maximum Avalaible Seats', oldname='register_max', help="You can for each event define a maximum registration level. If you have too much registrations you are not able to confirm your event. (put 0 to ignore this rule )", readonly=True, states={'draft': [('readonly', False)]}),
'seats_min': fields.integer('Minimum Reserved Seats', oldname='register_min', help="You can for each event define a minimum registration level. If you do not enough registrations you are not able to confirm your event. (put 0 to ignore this rule )", readonly=True, states={'draft': [('readonly', False)]}),
'seats_reserved': fields.function(_get_seats, oldname='register_current', string='Reserved Seats', type='integer', multi='seats_reserved'),
'seats_available': fields.function(_get_seats, oldname='register_avail', string='Available Seats', type='integer', multi='seats_reserved'),
'seats_unconfirmed': fields.function(_get_seats, oldname='register_prospect', string='Unconfirmed Seat Reservations', type='integer', multi='seats_reserved'),
'seats_used': fields.function(_get_seats, oldname='register_attended', string='Number of Participations', type='integer', multi='seats_reserved'),
'seats_reserved': fields.function(_get_seats, oldname='register_current', string='Reserved Seats', type='integer', multi='seats_reserved',
store={'event.registration': (_get_events_from_registrations, ['state'], 10),
'event.event': (lambda self, cr, uid, ids, c = {}: ids, ['seats_max'], 20)}),
'seats_available': fields.function(_get_seats, oldname='register_avail', string='Available Seats', type='integer', multi='seats_reserved',
store={'event.registration': (_get_events_from_registrations, ['state'], 10),
'event.event': (lambda self, cr, uid, ids, c = {}: ids, ['seats_max'], 20)}),
'seats_unconfirmed': fields.function(_get_seats, oldname='register_prospect', string='Unconfirmed Seat Reservations', type='integer', multi='seats_reserved',
store={'event.registration': (_get_events_from_registrations, ['state'], 10),
'event.event': (lambda self, cr, uid, ids, c = {}: ids, ['seats_max'], 20)}),
'seats_used': fields.function(_get_seats, oldname='register_attended', string='Number of Participations', type='integer', multi='seats_reserved',
store={'event.registration': (_get_events_from_registrations, ['state'], 10),
'event.event': (lambda self, cr, uid, ids, c = {}: ids, ['seats_max'], 20)}),
'registration_ids': fields.one2many('event.registration', 'event_id', 'Registrations', readonly=False, states={'done': [('readonly', True)]}),
'date_begin': fields.datetime('Start Date', required=True, readonly=True, states={'draft': [('readonly', False)]}),
'date_end': fields.datetime('End Date', required=True, readonly=True, states={'draft': [('readonly', False)]}),

View File

@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-12-21 17:04+0000\n"
"PO-Revision-Date: 2013-06-22 10:54+0000\n"
"PO-Revision-Date: 2014-04-04 19:21+0000\n"
"Last-Translator: Dariusz Kubiak <d.kubiak@macopedia.pl>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-03-27 06:53+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-04-05 05:30+0000\n"
"X-Generator: Launchpad (build 16976)\n"
#. module: hr_holidays
#: selection:hr.holidays.status,color_name:0
@ -680,7 +680,7 @@ msgstr "Podsumowanie"
#. module: hr_holidays
#: model:hr.holidays.status,name:hr_holidays.holiday_status_unpaid
msgid "Unpaid"
msgstr "Bezpłatny"
msgstr "Urlop bezpłatny"
#. module: hr_holidays
#: xsl:holidays.summary:0

View File

@ -207,8 +207,8 @@ class account_analytic_account(osv.osv):
'use_timesheets': fields.boolean('Timesheets', help="Check this field if this project manages timesheets"),
}
def on_change_template(self, cr, uid, ids, template_id, context=None):
res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, context=context)
def on_change_template(self, cr, uid, ids, template_id, date_start=False, context=None):
res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, date_start=date_start, context=context)
if template_id and 'value' in res:
template = self.browse(cr, uid, template_id, context=context)
res['value']['use_timesheets'] = template.use_timesheets

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-12-21 17:04+0000\n"
"PO-Revision-Date: 2012-12-17 19:55+0000\n"
"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) <grzegorz@openglobe.pl>\n"
"PO-Revision-Date: 2014-04-04 19:25+0000\n"
"Last-Translator: Dariusz Żbikowski <Unknown>\n"
"Language-Team: Polish <pl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-03-27 07:26+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-04-05 05:30+0000\n"
"X-Generator: Launchpad (build 16976)\n"
#. module: mail
#: view:mail.followers:0
@ -1363,7 +1363,7 @@ msgstr "Wiadomość Rich-text/HTML"
#. module: mail
#: view:mail.mail:0
msgid "Creation Month"
msgstr "Miesiąc tworzenia"
msgstr "Miesiąc utworzenia"
#. module: mail
#. openerp-web
@ -1509,7 +1509,7 @@ msgstr ""
#: code:addons/mail/static/src/xml/mail.xml:213
#, python-format
msgid "Please, wait while the file is uploading."
msgstr ""
msgstr "Poczekaj, aż plik zostanie załadowany."
#. module: mail
#: view:mail.group:0

View File

@ -89,5 +89,36 @@
<!-- Add menu entry in Settings/Email -->
<menuitem name="Messages" id="menu_mail_message" parent="base.menu_email" action="action_view_mail_message"/>
<record model="ir.ui.view" id="view_document_file_kanban">
<field name="name">ir.attachment kanban</field>
<field name="model">ir.attachment</field>
<field name="arch" type="xml">
<kanban>
<field name="file_type_icon"/>
<field name="url"/>
<field name="name"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div t-attf-class="oe_attachment" t-if="record.file_type_icon.value != 'webimage'">
<img t-att-src="'/mail/static/src/img/mimetypes/' + record.file_type_icon.value + '.png'"></img>
<div class='oe_name'><t t-raw='record.name.value' />bb</div>
</div>
<div t-attf-class="oe_attachment oe_preview" t-if="record.file_type_icon.value == 'webimage'">
<img t-att-src="kanban_image('ir.attachment', 'datas', record.id.value)" class="oe_kanban_image"/>
<div class='oe_name'><t t-raw='record.name.value' />aa</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="base.action_attachment" model="ir.actions.act_window">
<field name="view_mode">kanban,form</field>
</record>
</data>
</openerp>
</openerp>

View File

@ -318,7 +318,7 @@
.openerp .oe_mail .oe_msg_composer .oe_recipients input{
vertical-align: middle;
}
.openerp .oe_mail .oe_attachment{
.oe_attachment{
display: inline-block;
width: 100px;
margin: 4px 2px;
@ -328,7 +328,7 @@
text-align: center;
vertical-align: top;
}
.openerp .oe_mail .oe_attachment .oe_name{
.oe_attachment .oe_name{
display: inline-block;
max-width: 100%;
padding: 1px 3px;
@ -341,10 +341,10 @@
border-radius: 3px;
}
.openerp .oe_mail .oe_attachment.oe_preview{
.oe_attachment.oe_preview{
background: url( data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAYAAACNMs+9AAAAJ0lEQVQYV2MsLS39z4AGLCws0IUYGIeCwrVr12J45sSJE5ieGQIKAbuZKf/EMCs7AAAAAElFTkSuQmCC );
}
.openerp .oe_mail .oe_attachment .oe_progress_bar{
.oe_attachment .oe_progress_bar{
display: none;
position: absolute;
top: 18px;
@ -364,7 +364,7 @@
-o-animation: oe_mail_attach_loading_anim 0.75s infinite linear;
animation: oe_mail_attach_loading_anim 0.75s infinite linear;
}
.openerp .oe_mail .oe_attachment.oe_uploading .oe_progress_bar{
.oe_attachment.oe_uploading .oe_progress_bar{
display: block;
}
@-webkit-keyframes oe_mail_attach_loading_anim{
@ -387,7 +387,7 @@
50% { background: #009123 }
100% { background: #4BBD00 }
}
.openerp .oe_mail .oe_attachment.oe_preview .oe_name{
.oe_attachment.oe_preview .oe_name{
position: absolute;
bottom: 0px;
margin: 3px;
@ -405,14 +405,14 @@
-o-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.openerp .oe_mail .oe_attachment.oe_preview:hover .oe_name{
.oe_attachment.oe_preview:hover .oe_name{
opacity: 1;
-webkit-transition: opacity 0.2s linear;
-moz-transition: opacity 0.2s linear;
-o-transition: opacity 0.2s linear;
transition: opacity 0.2s linear;
}
.openerp .oe_mail .oe_attachment img{
.oe_attachment img{
position: absolute;
width: 48px;
height: 48px;
@ -420,7 +420,7 @@
left: 50%;
margin-left: -24px;
}
.openerp .oe_mail .oe_attachment.oe_preview img{
.oe_attachment.oe_preview img{
display: block;
position: relative;
margin:0px;

View File

@ -52,8 +52,15 @@ class PaymentAcquirer(osv.Model):
_name = 'payment.acquirer'
_description = 'Payment Acquirer'
def _get_providers(self, cr, uid, context=None):
return []
# indirection to ease inheritance
_provider_selection = lambda self, *args, **kwargs: self._get_providers(*args, **kwargs)
_columns = {
'name': fields.char('Name', required=True),
'provider': fields.selection(_provider_selection, string='Provider', required=True),
'company_id': fields.many2one('res.company', 'Company', required=True),
'pre_msg': fields.html('Message', help='Message displayed to explain and help the payment process.'),
'post_msg': fields.html('Thanks Message', help='Message displayed after having done the payment process.'),
@ -84,10 +91,10 @@ class PaymentAcquirer(osv.Model):
}
def _check_required_if_provider(self, cr, uid, ids, context=None):
""" If the field has 'required_if_provider="<name>"' attribute, then it
required if record.name is <name>. """
""" If the field has 'required_if_provider="<provider>"' attribute, then it
required if record.provider is <provider>. """
for acquirer in self.browse(cr, uid, ids, context=context):
if any(c for c, f in self._all_columns.items() if getattr(f.column, 'required_if_provider', None) == acquirer.name and not acquirer[c]):
if any(c for c, f in self._all_columns.items() if getattr(f.column, 'required_if_provider', None) == acquirer.provider and not acquirer[c]):
return False
return True
@ -98,8 +105,8 @@ class PaymentAcquirer(osv.Model):
def get_form_action_url(self, cr, uid, id, context=None):
""" Returns the form action URL, for form-based acquirer implementations. """
acquirer = self.browse(cr, uid, id, context=context)
if hasattr(self, '%s_get_form_action_url' % acquirer.name):
return getattr(self, '%s_get_form_action_url' % acquirer.name)(cr, uid, id, context=context)
if hasattr(self, '%s_get_form_action_url' % acquirer.provider):
return getattr(self, '%s_get_form_action_url' % acquirer.provider)(cr, uid, id, context=context)
return False
def form_preprocess_values(self, cr, uid, id, reference, amount, currency_id, tx_id, partner_id, partner_values, tx_values, context=None):
@ -178,7 +185,7 @@ class PaymentAcquirer(osv.Model):
})
# compute fees
fees_method_name = '%s_compute_fees' % acquirer.name
fees_method_name = '%s_compute_fees' % acquirer.provider
if hasattr(self, fees_method_name):
fees = getattr(self, fees_method_name)(
cr, uid, id, tx_data['amount'], tx_data['currency_id'], partner_data['country_id'], context=None)
@ -237,7 +244,7 @@ class PaymentAcquirer(osv.Model):
partner_values, tx_values, context=context)
# call <name>_form_generate_values to update the tx dict with acqurier specific values
cust_method_name = '%s_form_generate_values' % (acquirer.name)
cust_method_name = '%s_form_generate_values' % (acquirer.provider)
if hasattr(self, cust_method_name):
method = getattr(self, cust_method_name)
partner_values, tx_values = method(cr, uid, id, partner_values, tx_values, context=context)
@ -383,14 +390,14 @@ class PaymentTransaction(osv.Model):
acquirer = self.pool['payment.acquirer'].browse(cr, uid, values.get('acquirer_id'), context=context)
# compute fees
custom_method_name = '%s_compute_fees' % acquirer.name
custom_method_name = '%s_compute_fees' % acquirer.provider
if hasattr(Acquirer, custom_method_name):
fees = getattr(Acquirer, custom_method_name)(
cr, uid, acquirer.id, values.get('amount', 0.0), values.get('currency_id'), values.get('country_id'), context=None)
values['fees'] = float_round(fees, 2)
# custom create
custom_method_name = '%s_create' % acquirer.name
custom_method_name = '%s_create' % acquirer.provider
if hasattr(self, custom_method_name):
values.update(getattr(self, custom_method_name)(cr, uid, values, context=context))
@ -469,7 +476,7 @@ class PaymentTransaction(osv.Model):
if values.get('acquirer_id'):
acquirer = self.pool['payment.acquirer'].browse(cr, uid, values.get('acquirer_id'), context=context)
custom_method_name = '_%s_s2s_send' % acquirer.name
custom_method_name = '_%s_s2s_send' % acquirer.provider
if hasattr(self, custom_method_name):
tx_id, result = getattr(self, custom_method_name)(cr, uid, values, cc_values, context=context)
@ -482,7 +489,7 @@ class PaymentTransaction(osv.Model):
tx = self.browse(cr, uid, tx_id, context=context)
invalid_parameters = None
invalid_param_method_name = '_%s_s2s_get_invalid_parameters' % tx.acquirer_id.name
invalid_param_method_name = '_%s_s2s_get_invalid_parameters' % tx.acquirer_id.provider
if hasattr(self, invalid_param_method_name):
invalid_parameters = getattr(self, invalid_param_method_name)(cr, uid, tx, data, context=context)
@ -493,7 +500,7 @@ class PaymentTransaction(osv.Model):
_logger.error(_error_message)
return False
feedback_method_name = '_%s_s2s_validate' % tx.acquirer_id.name
feedback_method_name = '_%s_s2s_validate' % tx.acquirer_id.provider
if hasattr(self, feedback_method_name):
return getattr(self, feedback_method_name)(cr, uid, tx, data, context=context)
@ -503,7 +510,7 @@ class PaymentTransaction(osv.Model):
""" Get the tx status. """
tx = self.browse(cr, uid, tx_id, context=context)
invalid_param_method_name = '_%s_s2s_get_tx_status' % tx.acquirer_id.name
invalid_param_method_name = '_%s_s2s_get_tx_status' % tx.acquirer_id.provider
if hasattr(self, invalid_param_method_name):
return getattr(self, invalid_param_method_name)(cr, uid, tx, context=context)

View File

@ -8,7 +8,7 @@
parent='base.menu_administration'/>
<record id="acquirer_form" model="ir.ui.view">
<field name="name">acquirer.form</field>
<field name="name">payment.acquirer.form</field>
<field name="model">payment.acquirer</field>
<field name="arch" type="xml">
<form string="Payment Acquirer" version="7.0">
@ -16,6 +16,7 @@
<group name="acquirer_base">
<group>
<field name="name"/>
<field name="provider"/>
<field name="company_id"/>
<field name="website_published"/>
<field name="env"/>
@ -62,10 +63,12 @@
</record>
<record id="acquirer_list" model="ir.ui.view">
<field name="name">payment.acquirer.list</field>
<field name="model">payment.acquirer</field>
<field name="arch" type="xml">
<tree string="Payment Acquirers">
<field name="name"/>
<field name="provider"/>
<field name="website_published"/>
<field name="env"/>
</tree>
@ -73,10 +76,15 @@
</record>
<record id="acquirer_search" model="ir.ui.view">
<field name="name">payment.acquirer.search</field>
<field name="model">payment.acquirer</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="provider"/>
<group expand="0" string="Group By...">
<filter string="Provider" name="provider" domain="[]" context="{'group_by': 'provider'}"/>
</group>
</search>
</field>
</record>
@ -95,6 +103,7 @@
sequence='10' />
<record id="transaction_form" model="ir.ui.view">
<field name="name">payment.transaction.form</field>
<field name="model">payment.transaction</field>
<field name="arch" type="xml">
<form string="Payment Transactions" version="7.0">
@ -138,6 +147,7 @@
</record>
<record id="transaction_list" model="ir.ui.view">
<field name="name">payment.transaction.list</field>
<field name="model">payment.transaction</field>
<field name="arch" type="xml">
<tree string="Payment Transactions">
@ -151,6 +161,7 @@
</record>
<record id="transaction" model="ir.ui.view">
<field name="name">payment.transaction.search</field>
<field name="model">payment.transaction</field>
<field name="arch" type="xml">
<search>

View File

@ -3,7 +3,8 @@
<data noupdate="1">
<record id="payment_acquirer_adyen" model="payment.acquirer">
<field name="name">adyen</field>
<field name="name">Adyen</field>
<field name="provider">adyen</field>
<field name="company_id" ref="base.main_company"/>
<field name="view_template_id" ref="adyen_acquirer_button"/>
<field name="env">test</field>

View File

@ -26,14 +26,14 @@ class AcquirerAdyen(osv.Model):
- yhpp: hosted payment page: pay.shtml for single, select.shtml for multiple
"""
if env == 'prod':
return {
'adyen_form_url': 'https://prod.adyen.com/hpp/pay.shtml',
}
else:
return {
'adyen_form_url': 'https://test.adyen.com/hpp/pay.shtml',
}
return {
'adyen_form_url': 'https://%s.adyen.com/hpp/pay.shtml' % env,
}
def _get_providers(self, cr, uid, context=None):
providers = super(AcquirerAdyen, self)._get_providers(cr, uid, context=context)
providers.append(['adyen', 'Adyen'])
return providers
_columns = {
'adyen_merchant_account': fields.char('Merchant Account', required_if_provider='adyen'),
@ -54,7 +54,7 @@ class AcquirerAdyen(osv.Model):
:return string: shasign
"""
assert inout in ('in', 'out')
assert acquirer.name == 'adyen'
assert acquirer.provider == 'adyen'
if inout == 'in':
keys = "paymentAmount currencyCode shipBeforeDate merchantReference skinCode merchantAccount sessionValidity shopperEmail shopperReference recurringContract allowedMethods blockedMethods shopperStatement merchantReturnData billingAddressType deliveryAddressType offset".split()

View File

@ -8,7 +8,7 @@
<field name="inherit_id" ref="payment.acquirer_form"/>
<field name="arch" type="xml">
<xpath expr='//group[@name="acquirer_display"]' position='after'>
<group attrs="{'invisible': [('name', '!=', 'adyen')]}">
<group attrs="{'invisible': [('provider', '!=', 'adyen')]}">
<field name="adyen_merchant_account"/>
<field name="adyen_skin_code"/>
<field name="adyen_skin_hmac_key"/>

View File

@ -3,7 +3,8 @@
<data noupdate="1">
<record id="payment_acquirer_ogone" model="payment.acquirer">
<field name="name">ogone</field>
<field name="name">Credit Card</field>
<field name="provider">ogone</field>
<field name="company_id" ref="base.main_company"/>
<field name="view_template_id" ref="ogone_acquirer_button"/>
<field name="env">test</field>

View File

@ -36,6 +36,11 @@ class PaymentAcquirerOgone(osv.Model):
'ogone_afu_agree_url': 'https://secure.ogone.com/ncol/%s/AFU_agree.asp' % (env,),
}
def _get_providers(self, cr, uid, context=None):
providers = super(PaymentAcquirerOgone, self)._get_providers(cr, uid, context=context)
providers.append(['ogone', 'Ogone'])
return providers
_columns = {
'ogone_pspid': fields.char('PSPID', required_if_provider='ogone'),
'ogone_userid': fields.char('API User ID', required_if_provider='ogone'),
@ -57,7 +62,7 @@ class PaymentAcquirerOgone(osv.Model):
:return string: shasign
"""
assert inout in ('in', 'out')
assert acquirer.name == 'ogone'
assert acquirer.provider == 'ogone'
key = getattr(acquirer, 'ogone_shakey_' + inout)
def filter_key(key):

View File

@ -8,7 +8,7 @@
<field name="inherit_id" ref="payment.acquirer_form"/>
<field name="arch" type="xml">
<xpath expr='//group[@name="acquirer_display"]' position='after'>
<group attrs="{'invisible': [('name', '!=', 'ogone')]}">
<group attrs="{'invisible': [('provider', '!=', 'ogone')]}">
<field name="ogone_pspid"/>
<field name="ogone_userid"/>
<field name="ogone_password"/>

View File

@ -3,7 +3,8 @@
<data noupdate="1">
<record id="payment_acquirer_paypal" model="payment.acquirer">
<field name="name">paypal</field>
<field name="name">Paypal</field>
<field name="provider">paypal</field>
<field name="company_id" ref="base.main_company"/>
<field name="view_template_id" ref="paypal_acquirer_button"/>
<field name="env">test</field>

View File

@ -34,6 +34,11 @@ class AcquirerPaypal(osv.Model):
'paypal_rest_url': 'https://api.sandbox.paypal.com/v1/oauth2/token',
}
def _get_providers(self, cr, uid, context=None):
providers = super(AcquirerPaypal, self)._get_providers(cr, uid, context=context)
providers.append(['paypal', 'Paypal'])
return providers
_columns = {
'paypal_email_account': fields.char('Paypal Email ID', required_if_provider='paypal'),
'paypal_seller_account': fields.char(

View File

@ -8,7 +8,7 @@
<field name="inherit_id" ref="payment.acquirer_form"/>
<field name="arch" type="xml">
<xpath expr='//group[@name="acquirer_display"]' position='after'>
<group attrs="{'invisible': [('name', '!=', 'paypal')]}">
<group attrs="{'invisible': [('provider', '!=', 'paypal')]}">
<group>
<group>
<field name="paypal_email_account"/>

View File

@ -3,7 +3,8 @@
<data noupdate="1">
<record id="payment_acquirer_transfer" model="payment.acquirer">
<field name="name">transfer</field>
<field name="name">Wire Transfer</field>
<field name="provider">transfer</field>
<field name="company_id" ref="base.main_company"/>
<field name="view_template_id" ref="transfer_acquirer_button"/>
<field name="validation">manual</field>

View File

@ -14,6 +14,11 @@ _logger = logging.getLogger(__name__)
class TransferPaymentAcquirer(osv.Model):
_inherit = 'payment.acquirer'
def _get_providers(self, cr, uid, context=None):
providers = super(TransferPaymentAcquirer, self)._get_providers(cr, uid, context=context)
providers.append(['transfer', 'Wire Transfer'])
return providers
def transfer_get_form_action_url(self, cr, uid, id, context=None):
return '/payment/transfer/feedback'

View File

@ -8,14 +8,14 @@ msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-12-21 17:06+0000\n"
"PO-Revision-Date: 2012-12-16 20:56+0000\n"
"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) <grzegorz@openglobe.pl>\n"
"PO-Revision-Date: 2014-04-04 19:08+0000\n"
"Last-Translator: Dariusz Żbikowski <Unknown>\n"
"Language-Team: Polish <pl@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-03-27 07:18+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-04-05 05:30+0000\n"
"X-Generator: Launchpad (build 16976)\n"
#. module: procurement
#: model:ir.ui.menu,name:procurement.menu_stock_sched
@ -493,7 +493,7 @@ msgstr "Nieprzeczytane wiadomości"
#. module: procurement
#: selection:mrp.property,composition:0
msgid "plus"
msgstr ""
msgstr "plus"
#. module: procurement
#: help:procurement.order,state:0
@ -515,6 +515,8 @@ msgid ""
"If the active field is set to False, it will allow you to hide the "
"orderpoint without removing it."
msgstr ""
"Jeśli pole nie jest aktywne, pozwoli ci ukryć punkt zamawiania bez jego "
"kasowania."
#. module: procurement
#: view:product.product:0
@ -547,8 +549,8 @@ msgid ""
"You have to select a product unit of measure in the same category than the "
"default unit of measure of the product"
msgstr ""
"Musisz wybrać jednostkę miary z tej samej kategorii do domyślna jednostka "
"produktu."
"Musisz wybrać jednostkę miary z tej samej kategorii, co domyślna jednostka "
"produktu"
#. module: procurement
#: view:procurement.order:0
@ -589,7 +591,7 @@ msgstr "Projekt"
#: model:ir.ui.menu,name:procurement.menu_stock_proc_schedulers
#: view:procurement.order.compute.all:0
msgid "Run Schedulers"
msgstr "uruchom planowanie"
msgstr "Uruchom planowanie"
#. module: procurement
#: view:procurement.order.compute:0
@ -1027,7 +1029,7 @@ msgstr "Zapotrzbowanie uruchomione późno"
#. module: procurement
#: selection:mrp.property,composition:0
msgid "min"
msgstr ""
msgstr "min."
#. module: procurement
#: view:make.procurement:0

View File

@ -223,7 +223,7 @@ class project(osv.osv):
'res_model': 'ir.attachment',
'type': 'ir.actions.act_window',
'view_id': False,
'view_mode': 'tree,form',
'view_mode': 'kanban,form',
'view_type': 'form',
'limit': 80,
'context': "{'default_res_model': '%s','default_res_id': %d}" % (self._name, res_id)
@ -1202,8 +1202,8 @@ class account_analytic_account(osv.osv):
'company_uom_id': fields.related('company_id', 'project_time_mode_id', type='many2one', relation='product.uom'),
}
def on_change_template(self, cr, uid, ids, template_id, context=None):
res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, context=context)
def on_change_template(self, cr, uid, ids, template_id, date_start=False, context=None):
res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, date_start=date_start, context=context)
if template_id and 'value' in res:
template = self.browse(cr, uid, template_id, context=context)
res['value']['use_tasks'] = template.use_tasks

View File

@ -530,8 +530,8 @@ class account_analytic_account(osv.Model):
'use_issues': fields.boolean('Issues', help="Check this field if this project manages issues"),
}
def on_change_template(self, cr, uid, ids, template_id, context=None):
res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, context=context)
def on_change_template(self, cr, uid, ids, template_id, date_start=False, context=None):
res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, date_start=date_start, context=context)
if template_id and 'value' in res:
template = self.browse(cr, uid, template_id, context=context)
res['value']['use_issues'] = template.use_issues

View File

@ -273,8 +273,8 @@ class account_analytic_account(osv.osv):
'use_phases': fields.boolean('Phases', help="Check this field if you plan to use phase-based scheduling"),
}
def on_change_template(self, cr, uid, ids, template_id, context=None):
res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, context=context)
def on_change_template(self, cr, uid, ids, template_id, date_start=False, context=None):
res = super(account_analytic_account, self).on_change_template(cr, uid, ids, template_id, date_start=date_start, context=context)
if template_id and 'value' in res:
template = self.browse(cr, uid, template_id, context=context)
res['value']['use_phases'] = template.use_phases

View File

@ -7,14 +7,14 @@ msgstr ""
"Project-Id-Version: OpenERP Server 6.0dev\n"
"Report-Msgid-Bugs-To: support@openerp.com\n"
"POT-Creation-Date: 2012-12-21 17:04+0000\n"
"PO-Revision-Date: 2012-12-22 15:56+0000\n"
"Last-Translator: Grzegorz Grzelak (OpenGLOBE.pl) <grzegorz@openglobe.pl>\n"
"PO-Revision-Date: 2014-04-04 19:47+0000\n"
"Last-Translator: Dariusz Żbikowski <Unknown>\n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-03-27 05:52+0000\n"
"X-Generator: Launchpad (build 16967)\n"
"X-Launchpad-Export-Date: 2014-04-05 05:30+0000\n"
"X-Generator: Launchpad (build 16976)\n"
#. module: stock
#: field:stock.inventory.line.split,line_exist_ids:0
@ -1420,7 +1420,7 @@ msgstr "Zapas fizyczny"
#: code:addons/stock/wizard/stock_move.py:214
#, python-format
msgid "Processing Error!"
msgstr ""
msgstr "Błąd przetwarzania!"
#. module: stock
#: help:stock.location,chained_company_id:0

View File

@ -206,7 +206,7 @@ class Website(openerp.addons.web.controllers.main.Home):
views_ids = [view.get('id') for view in views if view.get('active')]
domain = [('type', '=', 'view'), ('res_id', 'in', views_ids), ('lang', '=', lang)]
irt = request.registry.get('ir.translation')
return irt.search_read(request.cr, request.uid, domain, ['id', 'res_id', 'value'], context=request.context)
return irt.search_read(request.cr, request.uid, domain, ['id', 'res_id', 'value','state','gengo_translation'], context=request.context)
@http.route('/website/set_translations', type='json', auth='public', website=True)
def set_translations(self, data, lang):
@ -240,6 +240,9 @@ class Website(openerp.addons.web.controllers.main.Home):
'source': initial_content,
'value': new_content,
}
if t.get('gengo_translation'):
new_trans['gengo_translation'] = t.get('gengo_translation')
new_trans['gengo_comment'] = t.get('gengo_comment')
irt.create(request.cr, request.uid, new_trans)
return True

View File

@ -34,11 +34,17 @@
dialog.$el.modal('hide');
self.translate().then(function () {
mysuper.call(self);
if(self.gengo_translate){
self.translation_gengo_display()
}
});
});
} else {
this.translate().then(function () {
mysuper.call(self);
if(self.gengo_translate){
self.translation_gengo_display()
}
});
}
},
@ -68,7 +74,7 @@
var source_attr = 'data-oe-source-id';
var $editables = $('[data-oe-model="ir.ui.view"]')
.not('link, script')
.not('.oe_snippets,.oe_snippet, .oe_snippet *')
.not('.oe_snippets,.oe_snippet, .oe_snippet *, .navbar-toggle')
.not('[data-oe-type]');
$editables.each(function () {
@ -92,7 +98,7 @@
self.sanitizeNode($node[0]);
}
if (self.getInitialContent($node[0]) !== $node.text()) {
$node.addClass('oe_dirty').removeClass('oe_translatable_todo');
$node.addClass('oe_dirty').removeClass('oe_translatable_todo oe_translatable_inprogress');
}
}, 0);
});
@ -119,6 +125,9 @@
});
if (trans.length) {
node.setAttribute('data-oe-translation-id', trans[0].id);
if(trans[0].gengo_translation && (trans[0].state == 'inprogress' || trans[0].state == 'to_translate')){
node.className += ' oe_translatable_inprogress';
}
} else {
node.className += ' oe_translatable_todo';
}

View File

@ -38,7 +38,7 @@
</section>
</div>
<div class="modal-footer">
<div class="pull-left">
<div class="pull-right">
<input type="checkbox" name="do_not_show"/>
Do not show this dialog later.
</div>

View File

@ -511,13 +511,13 @@
<img class="oe_snippet_thumbnail_img" src="/website/static/src/img/blocks/block_button.png"/>
<span class="oe_snippet_thumbnail_title">Button</span>
</div>
<section class="oe_snippet_body jumbotron oe_dark">
<section class="oe_snippet_body jumbotron">
<div class="container">
<div class="row">
<div class="col-md-9">
<div class="col-md-9 text-muted">
<p class="mb0">
<strong>50,000+ companies run Odoo to grow their businesses.</strong>
</p><p class="mb0 text-muted">
</p><p class="mb0">
Join us and make your company a better place.
</p>
</div>

View File

@ -593,8 +593,57 @@
<link rel='stylesheet' href='/website/static/src/css/website.css'/>
<script type="text/javascript" src="/web/static/lib/jquery/jquery.js"></script>
<script type="text/javascript" src="/web/static/lib/bootstrap/js/bootstrap.js"></script>
<script>
$(document).ready(function() {
var button = $('#reset_templates_button');
button.click(function() {
var dialog = $('#reset_template_confirmation').modal('show');
var input = dialog.find('input[type="text"]').val('').focus();
var dialog_form = dialog.find('form');
dialog_form.submit(function() {
if (input.val() == dialog.find('.confirm_word').text()) {
dialog.modal('hide');
button.prop('disabled', true).text('Working...');
$('#reset_templates_form').trigger('submit');
} else {
input.val('').focus();
}
return false;
});
return false;
});
});
</script>
</head>
<body>
<div id="reset_template_confirmation" class="modal" tabindex="-1" role="dialog" aria-hidden="true" t-ignore="true">
<div class="modal-dialog">
<form class="form-horizontal" role="form">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h3 class="modal-title">Reset templates</h3>
</div>
<div class="modal-body">
<div class="form-group mb0">
<label for="page-name" class="col-sm-9">
<p>The selected templates will be reset to their factory settings.</p>
<p>Type '<i class="confirm_word">yes</i>' in the box below if you want to confirm.</p>
</label>
<div class="col-sm-3 mt16">
<input type="text" class="form-control" required="required" placeholder="yes"/>
</div>
</div>
</div>
<div class="modal-footer">
<input type="submit" value="Confirm" class="btn btn-primary"/>
<button type="button" class="btn" data-dismiss="modal" aria-hidden="true">Cancel</button>
</div>
</div>
</form>
</div>
</div>
<div id="wrapwrap">
<div class="navbar navbar-default navbar-static-top">
<div class="container">
@ -616,7 +665,7 @@
<h4>Template fallback</h4>
<p>An error occured while rendering the template <code t-esc="qweb_exception.qweb['template']"/>.</p>
<p>If this error is caused by a change of yours in the templates, you have the possibility to reset one or more templates to their <strong>factory settings</strong>.</p>
<form action="/website/reset_templates" method="post">
<form action="/website/reset_templates" method="post" id="reset_templates_form">
<ul class="oe_template_fallback">
<li t-foreach="views" t-as="view">
<label>
@ -626,7 +675,7 @@
</li>
</ul>
<input type="hidden" name="redirect" t-att-value="request.httprequest.path"/>
<input type="submit" value="Reset selected templates"/>
<button id="reset_templates_button">Reset selected templates</button>
</form>
</div>
</div>

View File

@ -19,13 +19,46 @@
#
##############################################################################
import datetime
import werkzeug
from openerp import tools
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.website.models.website import slug
from openerp.osv.orm import browse_record
from openerp.tools.translate import _
from openerp import SUPERUSER_ID
import werkzeug
class QueryURL(object):
def __init__(self, path='', path_args=None, **args):
self.path = path
self.args = args
self.path_args = set(path_args or [])
def __call__(self, path=None, path_args=None, **kw):
path = path or self.path
for k, v in self.args.items():
kw.setdefault(k, v)
path_args = set(path_args or []).union(self.path_args)
paths, fragments = [], []
for key, value in kw.items():
if value and key in path_args:
if isinstance(value, browse_record):
paths.append((key, slug(value)))
else:
paths.append((key, value))
elif value:
if isinstance(value, list) or isinstance(value, set):
fragments.append(werkzeug.url_encode([(key, item) for item in value]))
else:
fragments.append(werkzeug.url_encode([(key, value)]))
for key, value in paths:
path += '/' + key + '/%s' % value
if fragments:
path += '?' + '&'.join(fragments)
return path
class WebsiteBlog(http.Controller):
@ -37,15 +70,17 @@ class WebsiteBlog(http.Controller):
groups = blog_post_obj.read_group(request.cr, request.uid, [], ['name', 'create_date'],
groupby="create_date", orderby="create_date asc", context=request.context)
for group in groups:
group['date'] = "%s_%s" % (group['__domain'][0][2], group['__domain'][1][2])
begin_date = datetime.datetime.strptime(group['__domain'][0][2], tools.DEFAULT_SERVER_DATETIME_FORMAT).date()
end_date = datetime.datetime.strptime(group['__domain'][1][2], tools.DEFAULT_SERVER_DATETIME_FORMAT).date()
group['date_begin'] = '%s' % datetime.date.strftime(begin_date, tools.DEFAULT_SERVER_DATE_FORMAT)
group['date_end'] = '%s' % datetime.date.strftime(end_date, tools.DEFAULT_SERVER_DATE_FORMAT)
return groups
@http.route([
'/blog',
'/blog/page/<int:page>',
], type='http', auth="public", website=True, multilang=True)
def blogs(self, page=1):
BYPAGE = 60
def blogs(self, page=1, **post):
cr, uid, context = request.cr, request.uid, request.context
blog_obj = request.registry['blog.post']
total = blog_obj.search(cr, uid, [], count=True, context=context)
@ -53,13 +88,15 @@ class WebsiteBlog(http.Controller):
url='/blog',
total=total,
page=page,
step=BYPAGE,
step=self._blog_post_per_page,
)
bids = blog_obj.search(cr, uid, [], offset=(page-1)*BYPAGE, limit=BYPAGE, context=context)
blogs = blog_obj.browse(cr, uid, bids, context=context)
post_ids = blog_obj.search(cr, uid, [], offset=(page-1)*self._blog_post_per_page, limit=self._blog_post_per_page, context=context)
posts = blog_obj.browse(cr, uid, post_ids, context=context)
blog_url = QueryURL('', ['blog', 'tag'])
return request.website.render("website_blog.latest_blogs", {
'blogs': blogs,
'pager': pager
'posts': posts,
'pager': pager,
'blog_url': blog_url,
})
@http.route([
@ -67,12 +104,8 @@ class WebsiteBlog(http.Controller):
'/blog/<model("blog.blog"):blog>/page/<int:page>',
'/blog/<model("blog.blog"):blog>/tag/<model("blog.tag"):tag>',
'/blog/<model("blog.blog"):blog>/tag/<model("blog.tag"):tag>/page/<int:page>',
'/blog/<model("blog.blog"):blog>/date/<string(length=21):date>',
'/blog/<model("blog.blog"):blog>/date/<string(length=21):date>/page/<int:page>',
'/blog/<model("blog.blog"):blog>/tag/<model("blog.tag"):tag>/date/<string(length=21):date>',
'/blog/<model("blog.blog"):blog>/tag/<model("blog.tag"):tag>/date/<string(length=21):date>/page/<int:page>',
], type='http', auth="public", website=True, multilang=True)
def blog(self, blog=None, tag=None, date=None, page=1, **opt):
def blog(self, blog=None, tag=None, page=1, **opt):
""" Prepare all values to display the blog.
:param blog: blog currently browsed.
@ -91,7 +124,7 @@ class WebsiteBlog(http.Controller):
- 'tag': current tag, if tag_id
- 'nav_list': a dict [year][month] for archives navigation
"""
BYPAGE = 10
date_begin, date_end = opt.get('date_begin'), opt.get('date_end')
cr, uid, context = request.cr, request.uid, request.context
blog_post_obj = request.registry['blog.post']
@ -102,28 +135,26 @@ class WebsiteBlog(http.Controller):
blog_ids = blog_obj.search(cr, uid, [], order="create_date asc", context=context)
blogs = blog_obj.browse(cr, uid, blog_ids, context=context)
path_filter = ""
domain = []
if blog:
path_filter += "%s" % blog.id
domain += [("id", "in", [post.id for post in blog.blog_post_ids])]
domain += [('blog_id', '=', blog.id)]
if tag:
path_filter += 'tag/%s' % tag.id
domain += [("id", "in", [post.id for post in tag.blog_post_ids])]
if date:
path_filter += "date/%s" % date
domain += [("create_date", ">=", date.split("_")[0]), ("create_date", "<=", date.split("_")[1])]
domain += [('tag_ids', 'in', tag.id)]
if date_begin and date_end:
domain += [("create_date", ">=", date_begin), ("create_date", "<=", date_end)]
blog_url = QueryURL('', ['blog', 'tag'], blog=blog, tag=tag, date_begin=date_begin, date_end=date_end)
post_url = QueryURL('', ['blogpost'], tag_id=tag and tag.id or None, date_begin=date_begin, date_end=date_end)
blog_post_ids = blog_post_obj.search(cr, uid, domain, order="create_date asc", context=context)
blog_posts = blog_post_obj.browse(cr, uid, blog_post_ids, context=context)
pager = request.website.pager(
url="/blog/%s" % path_filter,
url=blog_url(),
total=len(blog_posts),
page=page,
step=self._blog_post_per_page,
scope=BYPAGE
)
pager_begin = (page - 1) * self._blog_post_per_page
pager_end = page * self._blog_post_per_page
@ -141,15 +172,16 @@ class WebsiteBlog(http.Controller):
'blog_posts': blog_posts,
'pager': pager,
'nav_list': self.nav_list(),
'path_filter': path_filter,
'date': date,
'blog_url': blog_url,
'post_url': post_url,
'date': date_begin,
}
return request.website.render("website_blog.blog_post_short", values)
@http.route([
'/blogpost/<model("blog.post"):blog_post>',
], type='http', auth="public", website=True, multilang=True)
def blog_post(self, blog_post, tag=None, date=None, page=1, enable_editor=None, **post):
def blog_post(self, blog_post, tag_id=None, page=1, enable_editor=None, **post):
""" Prepare all values to display the blog.
:param blog_post: blog post currently browsed. If not set, the user is
@ -173,6 +205,7 @@ class WebsiteBlog(http.Controller):
- 'tag': current tag, if tag_id
- 'nav_list': a dict [year][month] for archives navigation
"""
date_begin, date_end = post.get('date_begin'), post.get('date_end')
pager_url = "/blogpost/%s" % blog_post.id
@ -187,6 +220,12 @@ class WebsiteBlog(http.Controller):
pager_end = page * self._post_comment_per_page
blog_post.website_message_ids = blog_post.website_message_ids[pager_begin:pager_end]
tag = None
if tag_id:
tag = request.registry['blog.tag'].browse(request.cr, request.uid, int(tag_id), context=request.context)
post_url = QueryURL('', ['blogpost'], blogpost=blog_post, tag_id=tag_id, date_begin=date_begin, date_end=date_end)
blog_url = QueryURL('', ['blog', 'tag'], blog=blog_post.blog_id, tag=tag, date_begin=date_begin, date_end=date_end)
cr, uid, context = request.cr, request.uid, request.context
blog_obj = request.registry['blog.blog']
blog_ids = blog_obj.search(cr, uid, [], context=context)
@ -196,22 +235,19 @@ class WebsiteBlog(http.Controller):
tag_ids = tag_obj.search(cr, uid, [], context=context)
tags = tag_obj.browse(cr, uid, tag_ids, context=context)
MONTHS = [None, _('January'), _('February'), _('March'), _('April'),
_('May'), _('June'), _('July'), _('August'), _('September'),
_('October'), _('November'), _('December')]
values = {
'blog': blog_post.blog_id,
'blogs': blogs,
'tags': tags,
'tag': tag and request.registry['blog.tag'].browse(cr, uid, int(tag), context=context) or None,
'tag': tag,
'blog_post': blog_post,
'main_object': blog_post,
'pager': pager,
'nav_list': self.nav_list(),
'enable_editor': enable_editor,
'date': date,
'date_name': date and "%s %s" % (MONTHS[int(date.split("-")[1])], date.split("-")[0]) or None
'date': date_begin,
'post_url': post_url,
'blog_url': blog_url,
}
return request.website.render("website_blog.blog_post_complete", values)

View File

@ -43,45 +43,45 @@
<section data-snippet-id="title" class="container">
<div class="row">
<div class="col-md-12 text-center">
<h1>Latest Blogs</h1>
<h1>Latest Posts</h1>
</div>
</div>
</section>
<section class="container">
<div class="row">
<t t-set="count" t-value="0"/>
<t t-foreach="blogs" t-as="blog">
<t t-foreach="posts" t-as="post">
<div class="col-md-4">
<h4>
<a t-attf-href="/blogpost/#{ slug(blog) }?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&amp;' or ''}#{ date and 'date=%s' % date or ''}" t-field="blog.name"></a>
<span t-if="not blog.website_published" class="text-warning">
<a t-attf-href="#{blog_url('', ['blogpost'], blogpost=post)}" t-field="post.name"></a>
<span t-if="not post.website_published" class="text-warning">
&amp;nbsp;
<span class="fa fa-warning" title="Not published"/>
</span>
</h4>
<div class="text-muted">
<span class="fa fa-calendar"> <span t-field="blog.create_date"/> &amp;nbsp;</span>
<span class="fa fa-calendar"> <span t-field="post.create_date"/> &amp;nbsp;</span>
<span class="fa fa-folder-open"> In
<a t-attf-href="/blog/#{ slug(blog.blog_id) }">
<span t-field="blog.blog_id"/>
<a t-attf-href="#{blog_url(blog=post.blog_id)}">
<span t-field="post.blog_id"/>
</a> &amp;nbsp;
</span>
</div>
<div class="text-muted fa fa-tags">
<span t-field="blog.website_meta_keywords"/>
<span t-if="editable and not blog.website_meta_keywords" class="label label-danger">
<span t-field="post.website_meta_keywords"/>
<span t-if="editable and not post.website_meta_keywords" class="label label-danger">
No keywords defined!
</span>
</div>
<div class="text-muted" t-if="len(blog.message_ids) &gt; 0">
<div class="text-muted" t-if="len(post.message_ids) &gt; 0">
<span class="fa fa-comment-o">
<a t-attf-href="/blogpost/#{ slug(blog) }/?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&amp;' or ''}#{ date and 'date=%s' % date or ''}#comments">
<t t-if="len(blog.message_ids) &lt;= 1" ><t t-esc="len(blog.message_ids)"/> comment</t>
<t t-if="len(blog.message_ids) > 1"><t t-esc="len(blog.message_ids)"/> comments</t>
<a t-attf-href="#{blog_url('', ['blogpost'], blogpost=post)}#comments">
<t t-if="len(post.message_ids) &lt;= 1" ><t t-esc="len(post.message_ids)"/> comment</t>
<t t-if="len(post.message_ids) > 1"><t t-esc="len(post.message_ids)"/> comments</t>
</a>
</span>
</div>
<div class="text-muted mb16" t-field="blog.website_meta_description"/>
<div class="text-muted mb16" t-field="post.website_meta_description"/>
</div>
<t t-set="count" t-value="count+1"/>
<div class="clearfix" t-if="(count % 3) == 0"/>
@ -110,12 +110,12 @@
<t t-foreach="blog_posts" t-as="blog_post">
<div t-att-data-publish="blog_post.website_published and 'on' or 'off'">
<h2 class="text-center">
<a t-attf-href="/blogpost/#{ slug(blog_post) }/?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&amp;' or ''}#{ date and 'date=%s' % date or ''}" t-field="blog_post.name"></a>
<a t-attf-href="#{post_url(blogpost=blog_post)}" t-field="blog_post.name"></a>
</h2>
<p class="post-meta text-muted text-center" name='blog_post_data'>
<span class="fa fa-calendar oe_date"> <span t-field="blog_post.create_date"/> &amp;nbsp;</span>
<span t-if="len(blog_post.message_ids) &gt; 0" class="fa fa-comment-o">
<a t-attf-href="/blogpost/#{ slug(blog_post) }/?#{ tag and 'tag=%s' % tag.id or '' }#{tag and date and '&amp;' or ''}#{ date and 'date=%s' % date or ''}#comments">
<a t-attf-href="#{post_url(blogpost=blog_post)}#comments">
<t t-if="len(blog_post.message_ids) &lt;= 1" ><t t-esc="len(blog_post.message_ids)"/> comment</t>
<t t-if="len(blog_post.message_ids) > 1"><t t-esc="len(blog_post.message_ids)"/> comments</t>
</a>
@ -145,7 +145,7 @@
<p class="post-meta text-muted text-center" t-if="len(blog_post.tag_ids)">
<span class="fa fa-tags"/>
<t t-foreach="blog_post.tag_ids" t-as="tag">
<a t-attf-href="/blog/#{ slug(blog) }/tag/#{ slug(tag) }" t-esc="tag.name"/> &amp;nbsp;
<a t-attf-href="#{blog_url(tag=tag)}" t-esc="tag.name"/> &amp;nbsp;
</t>
</p>
</xpath>
@ -210,10 +210,9 @@
<div class="row">
<div class="col-sm-9">
<ol class="breadcrumb">
<li><a t-attf-href="/blog/#{ slug(blog) }"><span t-field="blog.name"/></a></li>
<li t-if="tag"><a t-attf-href="/blog/#{ slug(blog) }/tag/#{ slug(tag) }"><span t-field="tag.name"/></a></li>
<li t-if="tag and date"><a t-attf-href="/blog/#{ slug(blog) }/tag/#{ slug(tag) }/date/#{ date }" t-esc="date_name"/></li>
<li t-if="not tag and date"><a t-attf-href="/blog/#{ slug(blog) }/date/#{ date }" t-esc="date_name"/></li>
<li><a t-attf-href="#{blog_url(tag=None, date_begin=None, date_end=None)}"><span t-field="blog.name"/></a></li>
<li t-if="tag"><a t-attf-href="#{blog_url(date_begin=None, date_end=None)}"><span t-field="tag.name"/></a></li>
<li t-if="date"><a t-attf-href="#{blog_url(tag=None)}" t-esc="date"/></li>
<li class="active"><span t-field="blog_post.name"/></li>
</ol>
</div><div class="col-sm-3">
@ -266,7 +265,7 @@
<p class="post-meta text-muted text-center" t-if="len(blog_post.tag_ids)">
<span class="fa fa-tags"/>
<t t-foreach="blog_post.tag_ids" t-as="tag">
<a t-attf-href="/blog/#{ slug(blog) }/tag/#{ slug(tag) }" t-esc="tag.name"/> &amp;nbsp;
<a t-attf-href="#{blog_url(tag=tag)}" t-esc="tag.name"/> &amp;nbsp;
</t>
</p>
</xpath>
@ -307,9 +306,9 @@
<section class="mt32">
<h4>Tags</h4>
<ul class="nav nav-pills nav-stacked">
<t t-foreach="tags" t-as="tag_id">
<li t-att-class="tag and tag_id.id == tag.id and 'active' or None" style="display: inline-block;">
<a t-attf-href="/blog/#{ slug(blog) }/tag/#{ slug(tag_id) }"><span t-field="tag_id.name"/></a>
<t t-foreach="tags" t-as="nav_tag">
<li t-att-class="tag and tag.id == nav_tag.id and 'active' or None" style="display: inline-block;">
<a t-attf-href="#{blog_url(tag=nav_tag)}"><span t-field="nav_tag.name"/></a>
</li>
</t>
</ul>
@ -325,8 +324,8 @@
<h4>Archives</h4>
<ul class="nav nav-pills nav-stacked">
<t t-foreach="nav_list" t-as="months">
<li t-att-class="months['date'] == date and 'active' or None">
<a t-ignore="True" t-attf-href="/blog/#{ slug(blog) }/#{ tag and 'tag/%s/' % slug(tag) or '' }date/#{ months['date'] }"><t t-esc="months['create_date']"/><span class="pull-right badge" t-esc="months['create_date_count']"/></a>
<li t-att-class="months['date_begin'] == date and 'active' or None">
<a t-ignore="True" t-attf-href="#{blog_url(date_begin=months['date_begin'], date_end=months['date_end'])}"><t t-esc="months['create_date']"/><span class="pull-right badge" t-esc="months['create_date_count']"/></a>
</li>
</t>
</ul>
@ -387,7 +386,7 @@
<ul class="nav nav-pills nav-stacked">
<t t-foreach="blogs" t-as="nav_blog">
<li t-att-class="nav_blog.id == blog.id and 'active' or ''">
<a t-attf-href="/blog/#{ slug(nav_blog) }">
<a t-attf-href="#{blog_url(blog=nav_blog)}">
<span t-field="nav_blog.name"/>
</a>
</li>

View File

@ -25,12 +25,14 @@ from openerp.addons.website.models.website import slug
class event_track_tag(osv.osv):
_name = "event.track.tag"
_order = 'name'
_columns = {
'name': fields.char('Event Track Tag')
}
class event_tag(osv.osv):
_name = "event.tag"
_order = 'name'
_columns = {
'name': fields.char('Event Tag')
}

View File

@ -0,0 +1,22 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
import controllers

View File

@ -0,0 +1,42 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP S.A. (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': 'Website Gengo Translator',
'category': 'Website',
'version': '1.0',
'description': """
Website Gengo Translator
========================
Translate you website in one click
""",
'author': 'OpenERP SA',
'depends': [
'website',
'base_gengo'
],
'data': [
'views/website_gengo.xml',
],
'qweb': [],
'installable': True,
}

View File

@ -0,0 +1 @@
import main

View File

@ -0,0 +1,60 @@
# -*- coding: utf-8 -*-
import openerp
from openerp.addons.web import http
from openerp.addons.web.http import request
import time
import json
from openerp.tools.translate import _
GENGO_DEFAULT_LIMIT = 20
class website_gengo(http.Controller):
@http.route('/website/get_translated_length', type='json', auth='user', website=True)
def get_translated_length(self, translated_ids, lang):
ir_translation_obj = request.registry['ir.translation']
result={"done":0}
gengo_translation_ids = ir_translation_obj.search(request.cr, request.uid, [('id','in',translated_ids),('gengo_translation','!=', False)])
for trans in ir_translation_obj.browse(request.cr, request.uid, gengo_translation_ids):
result['done'] += len(trans.source.split())
return result
@http.route('/website/check_gengo_set', type='json', auth='user', website=True)
def check_gengo_set(self):
user = request.registry['res.users'].browse(request.cr, request.uid, request.uid)
company_flag = 0
if not user.company_id.gengo_public_key or not user.company_id.gengo_private_key:
company_flag = user.company_id.id
return company_flag
@http.route('/website/set_gengo_config', type='json', auth='user', website=True)
def set_gengo_config(self,config):
user = request.registry['res.users'].browse(request.cr, request.uid, request.uid)
if user.company_id:
request.registry['res.company'].write(request.cr, request.uid, user.company_id.id,config)
return True
@http.route('/website/post_gengo_jobs', type='json', auth='user', website=True)
def post_gengo_jobs(self):
request.registry['base.gengo.translations']._sync_request(request.cr, request.uid, limit=GENGO_DEFAULT_LIMIT, context=request.context)
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)

View File

@ -0,0 +1,3 @@
.oe_translatable_inprogress {
background: #b7e4ff;
}

View File

@ -0,0 +1,188 @@
(function () {
'use strict';
var website = openerp.website;
website.add_template_file('/website_gengo/static/src/xml/website.gengo.xml');
website.EditorBar.include({
events: _.extend({}, website.EditorBar.prototype.events, {
'click a[data-action=translation_gengo_post]': 'translation_gengo_post',
'click a[data-action=translation_gengo_info]': 'translation_gengo_info',
}),
edit:function () {
this.gengo_translate = true;
this._super.apply(this, arguments);
var self = this;
var gengo_langs = ["ar_SY","id_ID","nl_NL","fr_CA","pl_PL","zh_TW","sv_SE","ko_KR","pt_PT","en_US","ja_JP","es_ES","zh_CN","de_DE","fr_FR","fr_BE","ru_RU","it_IT","pt_BR","pt_BR","th_TH","nb_NO","ro_RO","tr_TR","bg_BG","da_DK","en_GB","el_GR","vi_VN","he_IL","hu_HU","fi_FI"];
if (gengo_langs.indexOf(website.get_context()['lang']) != -1){
self.$('.gengo_post,.gengo_wait,.gengo_inprogress,.gengo_info').remove();
self.$('button[data-action=save]')
.after(openerp.qweb.render('website.ButtonGengoTranslator'));
}
},
translation_gengo_display:function(){
var self = this;
if($('.oe_translatable_todo').length == 0){
self.$el.find('.gengo_post').addClass("hidden");
self.$el.find('.gengo_inprogress').removeClass("hidden");
}
},
translation_gengo_post: function () {
var self = this;
var translatable_list = $.find('.oe_translatable_todo');
this.new_words = 0;
$('.oe_translatable_todo').each(function () {
self.new_words += $(this).text().trim().replace(/ +/g," ").split(" ").length;
});
openerp.jsonRpc('/website/check_gengo_set', 'call', {
}).then(function (res) {
if (res == 0){
var dialog = new website.GengoTranslatorPostDialog(self.new_words);
dialog.appendTo($(document.body));
dialog.on('service_level', this, function () {
var gengo_service_level = dialog.$el.find(".form-control").val();
dialog.$el.modal('hide');
self.$el.find('.gengo_post').addClass("hidden");
self.$el.find('.gengo_wait').removeClass("hidden");
var trans ={}
$('.oe_translatable_todo').each(function () {
var $node = $(this);
var data = $node.data();
if (!trans[data.oeTranslationViewId]) {
trans[data.oeTranslationViewId] = [];
}
trans[data.oeTranslationViewId].push({
initial_content: self.getInitialContent(this),
new_content:self.getInitialContent(this),
translation_id: data.oeTranslationId || null,
gengo_translation: gengo_service_level,
gengo_comment:"Original page:" + document.URL
});
});
openerp.jsonRpc('/website/set_translations', 'call', {
'data': trans,
'lang': website.get_context()['lang'],
}).then(function () {
$('.oe_translatable_todo').addClass('oe_translatable_inprogress').removeClass('oe_translatable_todo');
self.$el.find('.gengo_wait').addClass("hidden");
self.$el.find('.gengo_inprogress,.gengo_discard').removeClass("hidden");
openerp.jsonRpc('/website/post_gengo_jobs', 'call', {});
self.save();
}).fail(function () {
alert("Could not Post translation");
});
});
}else{
var dialog = new website.GengoApiConfigDialog(res);
dialog.appendTo($(document.body));
dialog.on('set_config', this, function () {
dialog.$el.modal('hide');
});
}
});
},
translation_gengo_info: function () {
var repr = $(document.documentElement).data('mainObject');
var view_id = repr.match(/.+\((.+), (\d+)\)/)[2];
var translated_ids = [];
$('.oe_translatable_text').not(".oe_translatable_inprogress").each(function(){
translated_ids.push($(this).attr('data-oe-translation-id'));
});
openerp.jsonRpc('/website/get_translated_length', 'call', {
'translated_ids': translated_ids,
'lang': website.get_context()['lang'],
}).done(function(res){
var dialog = new website.GengoTranslatorStatisticDialog(res);
dialog.appendTo($(document.body));
});
},
});
website.GengoTranslatorPostDialog = openerp.Widget.extend({
events: _.extend({}, website.EditorBar.prototype.events, {
'hidden.bs.modal': 'destroy',
'click button[data-action=service_level]': function (ev) {
this.trigger('service_level');
},
}),
template: 'website.GengoTranslatorPostDialog',
init:function(new_words){
this.new_words = new_words;
return this._super.apply(this, arguments);
},
start: function () {
this.$el.modal();
},
});
website.GengoTranslatorStatisticDialog = openerp.Widget.extend({
events: _.extend({}, website.EditorBar.prototype.events, {
'hidden.bs.modal': 'destroy',
}),
template: 'website.GengoTranslatorStatisticDialog',
init:function(res){
var self = this;
this.inprogess = 0;
this.new_words = 0;
this.done = res.done;
$('.oe_translatable_todo').each(function () {
self.new_words += $(this).text().trim().replace(/ +/g," ").split(" ").length;
});
$('.oe_translatable_inprogress').each(function () {
self.inprogess += $(this).text().trim().replace(/ +/g," ").split(" ").length;
});
this.total = this.done + this.inprogess;
return this._super.apply(this, arguments);
},
start: function (res) {
this.$el.modal(this.res);
},
});
website.GengoApiConfigDialog = openerp.Widget.extend({
events: _.extend({}, website.EditorBar.prototype.events, {
'hidden.bs.modal': 'destroy',
'click button[data-action=set_config]': 'set_config'
}),
template: 'website.GengoApiConfigDialog',
init:function(company_id){
this.company_id = company_id;
return this._super.apply(this, arguments);
},
start: function (res) {
this.$el.modal(this.res);
},
set_config:function(ev){
var self = this;
var public_key = this.$el.find("#gengo_public_key")[0].value;
var private_key = this.$el.find("#gengo_private_key")[0].value;
var auto_approve = this.$el.find("#gengo_auto_approve")[0].checked;
var sandbox = this.$el.find("#gengo_sandbox")[0].checked;
var pub_el = this.$el.find(".gengo_group_public")[0];
var pri_el = this.$el.find(".gengo_group_private")[0];
if(! public_key){
$(pub_el).addClass("has-error");
}
else{
$(pub_el).removeClass("has-error");
}
if(! private_key){
$(pri_el).addClass("has-error");
}
else{
$(pri_el).removeClass("has-error");
}
if(public_key && private_key){
openerp.jsonRpc('/website/set_gengo_config', 'call', {
'config': {'gengo_public_key':public_key,'gengo_private_key':private_key,'gengo_auto_approve':auto_approve,'gengo_sandbox':sandbox},
}).then(function () {
self.trigger('set_config');
}).fail(function () {
alert("Could not submit ! Try Again");
});
}
}
});
})();

View File

@ -0,0 +1,163 @@
<?xml version="1.0" encoding="utf-8"?>
<templates id="template" xml:space="preserve">
<t t-name="website.ButtonGengoTranslator">
<a class="btn btn-danger gengo_post" data-action="translation_gengo_post" href="#">Auto Translate</a>
<a class="btn btn-danger hidden gengo_wait disabled" href="#"><i class="fa fa-spinner fa-spin"></i> Wait</a>
<a class="btn btn-danger hidden gengo_inprogress disabled" href="#"> <i class="fa fa-clock-o"></i> Translation in Progress</a>
<a class="btn btn-link gengo_info" data-action="translation_gengo_info">Count Words</a>
</t>
<t t-name="website.TranslatorDialog">
<div class="modal fade oe_website_translator" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button title="Close" type="button" class="close" data-dismiss="modal">×</button>
<h2 class="modal-title">Translate this page</h2>
</div>
<div class="modal-body">
<section>
<p>You are about to enter the translation mode.</p>
<p>
Here are the visuals used to help you translate efficiently:
<ul class="oe_translate_examples">
<li style="background:#ffffb6;">
Content to translate or you can post them to <b><a href="http://gengo.com/" >Gengo</a></b> for translation.
</li>
<li class="oe_translatable_inprogress">
Translation in process (Gengo)
</li>
<li class="oe_translatable_text">
Already translated content
</li>
</ul>
</p>
<p>
In this mode, you can translate texts or post texts to Gengo for translation.
To change the structure of the page, you must edit the
master page.
</p>
</section>
</div>
<div class="modal-footer">
<div>
<input type="checkbox" name="do_not_show"/>
Do not show this dialog later.
</div>
<div>
<button type="button" data-action="activate" class="btn btn-primary">Ok</button>
or
<a data-action="discard" data-dismiss="modal" href="#">Cancel</a>
</div>
</div>
</div>
</div>
</div>
</t>
<t t-name="website.GengoTranslatorPostDialog">
<div class="modal fade oe_website_translator" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button title="Close" type="button" class="close" data-dismiss="modal">×</button>
<h2 class="modal-title">Select Gengo Translation Service Level</h2>
</div>
<div class="modal-body">
<section>
<select class="form-control" required="required" autofocus="autofocus">
<option value="machine">By Machine (Free)</option>
<option value="standard">Standard - $ <t t-esc="(widget.new_words * 0.05).toFixed(2)"></t> </option>
<option value="pro">Pro - $ <t t-esc="(widget.new_words * 0.10).toFixed(2)"></t></option>
<option value="ultra">Ultra - $ <t t-esc="(widget.new_words * 0.15).toFixed(2)"></t></option>
</select>
</section>
</div>
<div class="modal-footer">
<button type="button" data-action="service_level" class="btn btn-primary">Post</button>
or
<a data-action="discard" data-dismiss="modal" href="#">Cancel</a>
</div>
</div>
</div>
</div>
</t>
<t t-name="website.GengoTranslatorStatisticDialog">
<div class="modal fade oe_website_translator" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button title="Close" type="button" class="close" data-dismiss="modal">×</button>
<h2 class="modal-title">Translator statistics for this page</h2>
</div>
<div class="modal-body">
<b>
<div class="text-muted mb16"> <i class="fa fa-search-plus"></i> <t t-esc="widget.new_words"></t> new words found on this page.</div>
<h4><i class="fa fa-dashboard"></i> Gengo Statistics <a href="https://gengo.com/c/dashboard" class="pull-right" target="new">Gengo Dashboard</a></h4>
<hr class="mt8"/>
<div class="text-info mb8"> <i class="fa fa-align-left"></i> Words posted for translate <t t-esc="widget.total"></t></div>
<div class="text-warning mb8"> <i class="fa fa-cogs"></i> Words in progress <t t-esc="widget.inprogess"></t></div>
<div class="text-success mb8"> <i class="fa fa-check"></i> Translated words <t t-esc="widget.done"></t></div>
</b>
</div>
<div class="modal-footer">
<a data-action="discard" data-dismiss="modal" href="#">Close</a>
</div>
</div>
</div>
</div>
</t>
<t t-name="website.GengoApiConfigDialog">
<div class="modal fade oe_website_translator" tabindex="-1" role="dialog">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button title="Close" type="button" class="close" data-dismiss="modal">×</button>
<h2 class="modal-title">Gengo API is not configured</h2>
</div>
<div class="modal-body">
<b> <h3>Steps for configure Gengo </h3>
<div class="mb16"> 1. Go To your <b><a target="new" href="https://gengo.com/account/api_settings/">Gengo account</a></b> and generate API Keys.</div>
<div class="mb16"> 2. Then paste generated keys in given form</div>
<ul class="list-group">
<li class="list-group-item form-group gengo_group_public">
<h4 class="list-group-item-heading">
<label class="control-label">Public key</label>
</h4>
<input type="text" class="form-control url url-source" id="gengo_public_key" placeholder="Paste public key here"/>
</li>
<li class="list-group-item form-group gengo_group_private">
<h4 class="list-group-item-heading">
<label for="link-external" class="control-label">Private key</label>
</h4>
<input type="text" class="form-control url url-source" id="gengo_private_key" placeholder="Paste private key here"/>
</li>
<li class="list-group-item form-group">
<div>
<label>
<input type="checkbox" id="gengo_auto_approve" class="window-new" checked="1"/>
Auto Approve Translation <small class="text-muted">- Jobs are Automatically Approved by Gengo.</small>
</label>
</div>
<div>
<label>
<input type="checkbox" id="gengo_sandbox" class="window-new"/>
Sandbox <small class="text-muted">- Enable if you using testing account</small>
</label>
</div>
</li>
</ul>
</b>
</div>
<div class="modal-footer">
<button type="button" data-action="set_config" class="btn btn-primary">Submit</button>
or
<a data-action="discard" data-dismiss="modal" href="#">Close</a>
</div>
</div>
</div>
</div>
</t>
</templates>

View File

@ -0,0 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="gengo_editor_head" inherit_id="website.editor_head" name="Editor Head" groups="base.group_website_publisher">
<xpath expr='//script[@src="/website/static/src/js/website.translator.js"]' position="after">
<link rel="stylesheet" href="/website_gengo/static/src/css/website_gengo.css"></link>
<script t-if="translatable" type="text/javascript" src="/website_gengo/static/src/js/website_gengo.js"></script>
</xpath>
</template>
</data>
</openerp>

View File

@ -14,6 +14,7 @@ OpenERP E-Commerce
'data/website_sale_data.xml',
'views/website_sale.xml',
'views/website_sale_backend.xml',
'views/payment.xml',
'security/ir.model.access.csv',
'security/website_sale.xml',
],

View File

@ -709,7 +709,8 @@ class Ecommerce(http.Controller):
message = '<p>The payment seems to have been canceled.</p>'
elif state == 'pending' and tx.acquirer_id.validation == 'manual':
message = '<p>Your transaction is waiting confirmation.</p>'
message += tx.acquirer_id.post_msg
if tx.acquirer_id.post_msg:
message += tx.acquirer_id.post_msg
else:
message = '<p>Your transaction is waiting confirmation.</p>'
validation = tx.acquirer_id.validation

View File

@ -73,11 +73,11 @@
},
{
title: "select payment",
element: '#payment_method label:has(img[title="transfer"]) input',
element: '#payment_method label:has(img[title="Wire Transfer"]) input',
},
{
title: "Pay Now",
waitFor: '#payment_method label:has(input:checked):has(img[title="transfer"])',
waitFor: '#payment_method label:has(input:checked):has(img[title="Wire Transfer"])',
element: '.oe_sale_acquirer_button .btn[name="submit"]:visible',
},
{

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="transaction_form_website_sale" model="ir.ui.view">
<field name="name">payment.transaction.form.website_sale</field>
<field name="model">payment.transaction</field>
<field name="inherit_id" ref="payment.transaction_form"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='reference']" position="after">
<field name="sale_order_id"/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -958,7 +958,7 @@
<input t-att-value="acquirer.id" type="radio" name="acquirer" t-att-checked="acquirers[0] == acquirer"/>
<img class="media-object" style="width: 60px; display: inline-block;"
t-att-title="acquirer.name"
t-att-src="'/payment_%s/static/src/img/%s_icon.png' % (acquirer.name, acquirer.name)"/>
t-att-src="'/payment_%s/static/src/img/%s_icon.png' % (acquirer.provider, acquirer.provider)"/>
<span t-field="acquirer.name"/>
</label>
</li>