[FIX] sale: function changed name in refactoring is now applied everywhere
Somehow, we forgot to change some calls to action_button_confirm the to new action_confirm on the sale.order object This applies to the following modules: portal_sale website_event website_quote website_sale
This commit is contained in:
@@ -22,14 +22,14 @@ class sale_order(osv.Model):
|
||||
pass
|
||||
return action_dict
|
||||
|
||||
def action_button_confirm(self, cr, uid, ids, context=None):
|
||||
def action_confirm(self, cr, uid, ids, context=None):
|
||||
# fetch the partner's id and subscribe the partner to the sale order
|
||||
assert len(ids) == 1
|
||||
document = self.browse(cr, uid, ids[0], context=context)
|
||||
partner = document.partner_id
|
||||
if partner not in document.message_partner_ids:
|
||||
self.message_subscribe(cr, uid, ids, [partner.id], context=context)
|
||||
return super(sale_order, self).action_button_confirm(cr, uid, ids, context=context)
|
||||
return super(sale_order, self).action_confirm(cr, uid, ids, context=context)
|
||||
|
||||
def get_signup_url(self, cr, uid, ids, context=None):
|
||||
assert len(ids) == 1
|
||||
|
||||
@@ -47,7 +47,7 @@ class website_event(website_event):
|
||||
|
||||
# free tickets -> order with amount = 0: auto-confirm, no checkout
|
||||
if not order.amount_total:
|
||||
order.action_button_confirm() # tde notsure: email sending ?
|
||||
order.action_confirm() # tde notsure: email sending ?
|
||||
attendees = request.registry['event.registration'].browse(cr, uid, list(attendee_ids), context=context)
|
||||
# clean context and session, then redirect to the confirmation page
|
||||
request.website.sale_reset(context=context)
|
||||
|
||||
@@ -132,7 +132,7 @@
|
||||
</t>
|
||||
</td>
|
||||
<td>
|
||||
<a t-if="invoice.state == 'open'" t-attf-href="/website_payment/pay?reference=#{invoice.number}&amount=#{invoice.amount_total}&currency_id=#{invoice.currency_id.id}&partner_id=#{invoice.partner_id.id}&country_id=#{invoice.partner_id.country_id.id}" alt="Pay Now" class="btn btn-xs btn-primary"><i class="fa fa-arrow-circle-right"/> Pay Now</a>
|
||||
<a t-if="invoice.state == 'open'" t-attf-href="/website_payment/pay?reference=#{invoice.number}&amount=#{invoice.amount_total}&currency_id=#{invoice.currency_id.id}&country_id=#{invoice.partner_id.country_id.id}" alt="Pay Now" class="btn btn-xs btn-primary"><i class="fa fa-arrow-circle-right"/> Pay Now</a>
|
||||
</td>
|
||||
<td><span t-esc="invoice.amount_total" t-esc-options='{"widget": "monetary", "display_currency": "invoice.currency_id"}'/></td>
|
||||
</tr>
|
||||
|
||||
@@ -196,6 +196,6 @@ class sale_quote(http.Controller):
|
||||
|
||||
# confirm the quotation
|
||||
if tx.acquirer_id.auto_confirm == 'at_pay_now':
|
||||
request.registry['sale.order'].action_button_confirm(cr, SUPERUSER_ID, [order.id], context=request.context)
|
||||
request.registry['sale.order'].action_confirm(cr, SUPERUSER_ID, [order.id], context=request.context)
|
||||
|
||||
return tx_id
|
||||
|
||||
@@ -23,6 +23,6 @@ class PaymentTransaction(orm.Model):
|
||||
if hasattr(self, tx_find_method_name):
|
||||
tx = getattr(self, tx_find_method_name)(cr, uid, data, context=context)
|
||||
if tx and tx.state == 'done' and tx.acquirer_id.auto_confirm == 'at_pay_confirm' and tx.sale_order_id and tx.sale_order_id.state in ['draft', 'sent']:
|
||||
self.pool['sale.order'].action_button_confirm(cr, SUPERUSER_ID, [tx.sale_order_id.id], context=context)
|
||||
self.pool['sale.order'].action_confirm(cr, SUPERUSER_ID, [tx.sale_order_id.id], context=context)
|
||||
|
||||
return res
|
||||
|
||||
@@ -800,7 +800,7 @@ class website_sale(http.Controller):
|
||||
|
||||
# confirm the quotation
|
||||
if tx.acquirer_id.auto_confirm == 'at_pay_now':
|
||||
request.registry['sale.order'].action_button_confirm(cr, SUPERUSER_ID, [order.id], context=request.context)
|
||||
request.registry['sale.order'].action_confirm(cr, SUPERUSER_ID, [order.id], context=request.context)
|
||||
|
||||
return tx_id
|
||||
|
||||
@@ -868,7 +868,7 @@ class website_sale(http.Controller):
|
||||
if (not order.amount_total and not tx):
|
||||
# Orders are confirmed by payment transactions, but there is none for free orders,
|
||||
# (e.g. free events), so confirm immediately
|
||||
order.with_context(dict(context, send_email=True)).action_button_confirm()
|
||||
order.with_context(dict(context, send_email=True)).action_confirm()
|
||||
elif tx and tx.state == 'cancel':
|
||||
# cancel the quotation
|
||||
sale_order_obj.action_cancel(cr, SUPERUSER_ID, [order.id], context=request.context)
|
||||
|
||||
@@ -23,7 +23,7 @@ class PaymentTransaction(orm.Model):
|
||||
if hasattr(self, tx_find_method_name):
|
||||
tx = getattr(self, tx_find_method_name)(cr, uid, data, context=context)
|
||||
if tx and tx.state == 'done' and tx.acquirer_id.auto_confirm == 'at_pay_confirm' and tx.sale_order_id and tx.sale_order_id.state in ['draft', 'sent']:
|
||||
self.pool['sale.order'].action_button_confirm(cr, SUPERUSER_ID, [tx.sale_order_id.id], context=dict(context, send_email=True))
|
||||
self.pool['sale.order'].action_confirm(cr, SUPERUSER_ID, [tx.sale_order_id.id], context=dict(context, send_email=True))
|
||||
elif tx and tx.state not in ['cancel'] and tx.sale_order_id and tx.sale_order_id.state in ['draft']:
|
||||
self.pool['sale.order'].force_quotation_send(cr, SUPERUSER_ID, [tx.sale_order_id.id], context=context)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user