summaryrefslogtreecommitdiff
path: root/addons/website_quote/models
diff options
context:
space:
mode:
authorfda-odoo <fda@odoo.com>2017-12-21 11:32:42 +0100
committerfda-odoo <fda@odoo.com>2018-01-24 15:33:53 +0100
commitb7a064af9f2e1f9e9a4d7c28b7bcbb8af7842f4e (patch)
treeaf8afc9c3d6519ae6652d602ebf9bdca2a5af061 /addons/website_quote/models
parent196f491e12e6789784c350b0b159061b67d18834 (diff)
[FIX] portal, website_quote: change display of a button and default quotation template option
-> Move a button into its wizard and not in the void -> In the sale order, set the default value for require_payment related to sale_portal_confirmation_options.
Diffstat (limited to 'addons/website_quote/models')
-rw-r--r--addons/website_quote/models/sale_order.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/addons/website_quote/models/sale_order.py b/addons/website_quote/models/sale_order.py
index 3e96864c45c..6824284b84e 100644
--- a/addons/website_quote/models/sale_order.py
+++ b/addons/website_quote/models/sale_order.py
@@ -51,6 +51,9 @@ class SaleOrder(models.Model):
template = self.env.ref('website_quote.website_quote_template_default', raise_if_not_found=False)
return template and template.active and template or False
+ def _get_default_online_payment(self):
+ return 1 if self.env['ir.config_parameter'].sudo().get_param('sale.sale_portal_confirmation_options', default='none') == 'pay' else 0
+
template_id = fields.Many2one(
'sale.quote.template', 'Quotation Template',
readonly=True,
@@ -66,7 +69,7 @@ class SaleOrder(models.Model):
quote_viewed = fields.Boolean('Quotation Viewed')
require_payment = fields.Selection([
(0, 'Online Signature'),
- (1, 'Online Payment')], default=0, string='Confirmation Mode',
+ (1, 'Online Payment')], default=_get_default_online_payment, string='Confirmation Mode',
help="Choose how you want to confirm an order to launch the delivery process. You can either "
"request a digital signature or an upfront payment. With a digital signature, you can "
"request the payment when issuing the invoice.")