Skip to content

Commit

Permalink
[IMP] website_sale: update the record's state field value with 'pendi…
Browse files Browse the repository at this point in the history
…ng', due to constrains on state field. in that constrains check the payment method is allowed or not to set manual capture mode
  • Loading branch information
jpr-odoo committed Mar 22, 2017
1 parent ba4f2a4 commit a33390c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions addons/website_sale/controllers/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -937,10 +937,12 @@ def payment_confirmation(self, **post):
order = request.env['sale.order'].sudo().browse(sale_order_id)
values = {
'order': order,
# check post msg set or not in payment method
# always return default value (<p><br></p>) of html type field
# if html type field is empty
'post_msg': True if (order.payment_acquirer_id.post_msg != '<p><br></p>') else False,
# check post msg set or not in payment method
# first time return False
# when we go to the post_msg field(html)
# and put on cursor then record save it
# always return value(<p><br></p>), if field is empty
'post_msg': True if (order.payment_acquirer_id.post_msg not in ['<p><br></p>', False]) else False,
}
return request.render("website_sale.confirmation", values)
else:
Expand Down
2 changes: 1 addition & 1 deletion addons/website_sale/data/demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1041,7 +1041,7 @@ Weight: 31 grams</field>
<field name="sale_order_id" ref="website_sale_order_13"/>
<field name="reference" ref="website_sale_order_13"/>
<field name="type">form</field>
<field name="state">authorized</field>
<field name="state">pending</field>
<field name="amount">1799.0</field>
<field name="currency_id" ref="base.USD"/>
<field name="partner_id" ref="base.res_partner_3"/>
Expand Down

0 comments on commit a33390c

Please sign in to comment.