[IMP] website_quote: perform some code cleaning
* Remove dead code * Clean variable assignation to a record set and use a dedicated variable to hold the result instead of setting a property on records
This commit is contained in:
committed by
Thibault Delavallée
parent
232eea36ab
commit
f39628ae49
@@ -66,9 +66,9 @@ class sale_quote(http.Controller):
|
||||
'submit_class': 'btn btn-primary',
|
||||
'submit_txt': _('Pay & Confirm')
|
||||
}
|
||||
values['buttons'] = {}
|
||||
for acquirer in values['acquirers']:
|
||||
# TOFIX: very ugly/unreliable way to assign property to recordset, recordset added to list for shallow reference
|
||||
acquirer.button = acquirer.with_context(**extra_context).render(
|
||||
values['buttons'][acquirer.id] = acquirer.with_context(**extra_context).render(
|
||||
'/',
|
||||
Order.amount_total,
|
||||
Order.pricelist_id.currency_id.id,
|
||||
|
||||
@@ -146,15 +146,6 @@ class SaleOrder(models.Model):
|
||||
'url': '/quote/%s/%s' % (self.id, self.access_token)
|
||||
}
|
||||
|
||||
# no call to this method ???
|
||||
def recommended_products(self, cr, uid, ids, context=None):
|
||||
order_line = self.browse(cr, uid, ids[0], context=context).order_line
|
||||
# product_pool = self.pool.get('product.product')
|
||||
products = []
|
||||
for line in order_line:
|
||||
products += line.product_id.product_tmpl_id.recommended_products(context=context)
|
||||
return products
|
||||
|
||||
@api.multi
|
||||
def get_access_action(self):
|
||||
""" Override method that generated the link to access the document. Instead
|
||||
|
||||
@@ -333,7 +333,7 @@
|
||||
<h4>Payment Method:</h4>
|
||||
<ul class="list-unstyled">
|
||||
<li t-foreach="acquirers or []" t-as="acquirer">
|
||||
<label t-if="acquirer.button">
|
||||
<label t-if="buttons.get(acquirer.id)">
|
||||
<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"
|
||||
@@ -346,7 +346,7 @@
|
||||
<div class="col-md-6">
|
||||
<t t-foreach="acquirers or []" t-as="acquirer">
|
||||
<div t-att-data-id="acquirer.id" class="oe_quote_acquirer_button hidden pull-right">
|
||||
<div t-raw="acquirer.button"/>
|
||||
<div t-raw="buttons.get(acquirer.id)"/>
|
||||
<div t-field="acquirer.pre_msg"/>
|
||||
<button type="button" class="btn btn-link" data-dismiss="modal" style="padding: 0">Cancel</button>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user