diff --git a/addons/website_quote/models/order.py b/addons/website_quote/models/order.py index f2f6caa8308..ac1bbaf117a 100644 --- a/addons/website_quote/models/order.py +++ b/addons/website_quote/models/order.py @@ -166,8 +166,16 @@ class sale_order(osv.osv): ], 'Payment', help="Require immediate payment by the customer when validating the order from the website quote"), } + def _get_template_id(self, cr, uid, context=None): + try: + template_id = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'website_quote', 'website_quote_template_default')[1] + except ValueError: + template_id = False + return template_id + _defaults = { 'access_token': lambda self, cr, uid, ctx={}: str(uuid.uuid4()), + 'template_id': _get_template_id, } def open_quotation(self, cr, uid, quote_id, context=None):