diff options
| author | Turkesh Patel (Open ERP) <tpa@tinyerp.com> | 2014-04-04 18:48:01 +0530 |
|---|---|---|
| committer | Turkesh Patel (Open ERP) <tpa@tinyerp.com> | 2014-04-04 18:48:01 +0530 |
| commit | ad8a9c0e4fca83fffa776cc72bc4b88bae51ddc2 (patch) | |
| tree | baaba134201a5481655385d42624c1e7aa212eaa | |
| parent | 51d22836d1e345b45ff58ee8e501886e4a737353 (diff) | |
| parent | ba52cde0b5138dc1c9ee7a47162e735433a8d477 (diff) | |
[MRG] merge with lp:openobject-addons
bzr revid: tpa@tinyerp.com-20140404131801-k6bkbdsjhscvx2cv
| -rw-r--r-- | addons/event/event.py | 40 | ||||
| -rw-r--r-- | addons/payment/models/payment_acquirer.py | 33 | ||||
| -rw-r--r-- | addons/payment/views/payment_acquirer.xml | 13 | ||||
| -rw-r--r-- | addons/payment_adyen/data/adyen.xml | 3 | ||||
| -rw-r--r-- | addons/payment_adyen/models/adyen.py | 18 | ||||
| -rw-r--r-- | addons/payment_adyen/views/payment_acquirer.xml | 2 | ||||
| -rw-r--r-- | addons/payment_ogone/data/ogone.xml | 3 | ||||
| -rw-r--r-- | addons/payment_ogone/models/ogone.py | 7 | ||||
| -rw-r--r-- | addons/payment_ogone/views/payment_acquirer.xml | 2 | ||||
| -rw-r--r-- | addons/payment_paypal/data/paypal.xml | 3 | ||||
| -rw-r--r-- | addons/payment_paypal/models/paypal.py | 5 | ||||
| -rw-r--r-- | addons/payment_paypal/views/payment_acquirer.xml | 2 | ||||
| -rw-r--r-- | addons/payment_transfer/data/transfer.xml | 3 | ||||
| -rw-r--r-- | addons/payment_transfer/models/payment_acquirer.py | 5 | ||||
| -rw-r--r-- | addons/website_sale/__openerp__.py | 1 | ||||
| -rw-r--r-- | addons/website_sale/controllers/main.py | 3 | ||||
| -rw-r--r-- | addons/website_sale/static/src/js/website.tour.sale.js | 4 | ||||
| -rw-r--r-- | addons/website_sale/views/payment.xml | 17 | ||||
| -rw-r--r-- | addons/website_sale/views/website_sale.xml | 2 |
19 files changed, 122 insertions, 44 deletions
diff --git a/addons/event/event.py b/addons/event/event.py index d13d455bc73..92b237687d7 100644 --- a/addons/event/event.py +++ b/addons/event/event.py @@ -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)]}), diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py index 9ad77b3c4cf..464cb0c8f5c 100644 --- a/addons/payment/models/payment_acquirer.py +++ b/addons/payment/models/payment_acquirer.py @@ -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) diff --git a/addons/payment/views/payment_acquirer.xml b/addons/payment/views/payment_acquirer.xml index 5dbd748bda7..325bb774ee6 100644 --- a/addons/payment/views/payment_acquirer.xml +++ b/addons/payment/views/payment_acquirer.xml @@ -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> diff --git a/addons/payment_adyen/data/adyen.xml b/addons/payment_adyen/data/adyen.xml index 8f6e7e218e4..5ca0f4d71e9 100644 --- a/addons/payment_adyen/data/adyen.xml +++ b/addons/payment_adyen/data/adyen.xml @@ -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> diff --git a/addons/payment_adyen/models/adyen.py b/addons/payment_adyen/models/adyen.py index 80103f50dae..607d65738c5 100644 --- a/addons/payment_adyen/models/adyen.py +++ b/addons/payment_adyen/models/adyen.py @@ -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() diff --git a/addons/payment_adyen/views/payment_acquirer.xml b/addons/payment_adyen/views/payment_acquirer.xml index 1510a110c43..396bf9c32d5 100644 --- a/addons/payment_adyen/views/payment_acquirer.xml +++ b/addons/payment_adyen/views/payment_acquirer.xml @@ -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"/> diff --git a/addons/payment_ogone/data/ogone.xml b/addons/payment_ogone/data/ogone.xml index e94276ba3e1..ade39cfb79c 100644 --- a/addons/payment_ogone/data/ogone.xml +++ b/addons/payment_ogone/data/ogone.xml @@ -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> diff --git a/addons/payment_ogone/models/ogone.py b/addons/payment_ogone/models/ogone.py index 2ae9722b655..f6cab44f0b5 100644 --- a/addons/payment_ogone/models/ogone.py +++ b/addons/payment_ogone/models/ogone.py @@ -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): diff --git a/addons/payment_ogone/views/payment_acquirer.xml b/addons/payment_ogone/views/payment_acquirer.xml index accce4d70d2..f297eb9431a 100644 --- a/addons/payment_ogone/views/payment_acquirer.xml +++ b/addons/payment_ogone/views/payment_acquirer.xml @@ -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"/> diff --git a/addons/payment_paypal/data/paypal.xml b/addons/payment_paypal/data/paypal.xml index fe28ed30331..0ea6cd5a848 100644 --- a/addons/payment_paypal/data/paypal.xml +++ b/addons/payment_paypal/data/paypal.xml @@ -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> diff --git a/addons/payment_paypal/models/paypal.py b/addons/payment_paypal/models/paypal.py index a5e31e9571c..de852702880 100644 --- a/addons/payment_paypal/models/paypal.py +++ b/addons/payment_paypal/models/paypal.py @@ -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( diff --git a/addons/payment_paypal/views/payment_acquirer.xml b/addons/payment_paypal/views/payment_acquirer.xml index 835d96f42e9..3fb5db184f6 100644 --- a/addons/payment_paypal/views/payment_acquirer.xml +++ b/addons/payment_paypal/views/payment_acquirer.xml @@ -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"/> diff --git a/addons/payment_transfer/data/transfer.xml b/addons/payment_transfer/data/transfer.xml index c2863971d34..5eabe29a17f 100644 --- a/addons/payment_transfer/data/transfer.xml +++ b/addons/payment_transfer/data/transfer.xml @@ -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> diff --git a/addons/payment_transfer/models/payment_acquirer.py b/addons/payment_transfer/models/payment_acquirer.py index 90b1329ff25..63883b3df30 100644 --- a/addons/payment_transfer/models/payment_acquirer.py +++ b/addons/payment_transfer/models/payment_acquirer.py @@ -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' diff --git a/addons/website_sale/__openerp__.py b/addons/website_sale/__openerp__.py index 121bb519103..e9ab1820804 100644 --- a/addons/website_sale/__openerp__.py +++ b/addons/website_sale/__openerp__.py @@ -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', ], diff --git a/addons/website_sale/controllers/main.py b/addons/website_sale/controllers/main.py index ed6cb147828..7511e308b95 100644 --- a/addons/website_sale/controllers/main.py +++ b/addons/website_sale/controllers/main.py @@ -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 diff --git a/addons/website_sale/static/src/js/website.tour.sale.js b/addons/website_sale/static/src/js/website.tour.sale.js index c9dd7e5e301..0fa01addede 100644 --- a/addons/website_sale/static/src/js/website.tour.sale.js +++ b/addons/website_sale/static/src/js/website.tour.sale.js @@ -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', }, { diff --git a/addons/website_sale/views/payment.xml b/addons/website_sale/views/payment.xml new file mode 100644 index 00000000000..f4bec2323bb --- /dev/null +++ b/addons/website_sale/views/payment.xml @@ -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> diff --git a/addons/website_sale/views/website_sale.xml b/addons/website_sale/views/website_sale.xml index 71573e3dac5..0f973c51424 100644 --- a/addons/website_sale/views/website_sale.xml +++ b/addons/website_sale/views/website_sale.xml @@ -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> |
