[IMP] website_quote: add default quote template

(Closes #1380)
This commit is contained in:
avo-odoo
2014-08-04 16:23:14 +02:00
committed by Richard Mathot
parent 2aed2108fa
commit df75edbec7
2 changed files with 79 additions and 1 deletions
@@ -82,5 +82,74 @@
]]></field>
</record>
<record id="website_quote_template_default" model="sale.quote.template">
<field name="name">Default Template</field>
<field name="number_of_days">30</field>
<field name="website_description" type="xml">
<section data-snippet-id="title">
<center><h1 class="page-header">Our offer</h1></center>
</section>
<section data-snippet-id="text-block">
<div class="row">
<div class="col-md-12">
<p>
<h3 class="text-muted">Our offer is based on 3 commitments, which drive our business and our partners:</h3>
</p>
</div>
</div>
</section>
<section data-snippet-id="quality">
<div class="row mt32">
<div class="col-md-4">
<div class="panel panel-info">
<div class="panel-heading">
<center><h3 class="panel-title">Quality</h3></center>
</div>
<div class="panel-body">
<p>
Quality in many ways, our reputation was built on the first value.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-info">
<div class="panel-heading">
<center><h3 class="panel-title">Service</h3></center>
</div>
<div class="panel-body">
<p>
We are always reachable to help you, do not hesitate to contact us at any time.
</p>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-info">
<div class="panel-heading">
<center><h3 class="panel-title">Price</h3></center>
</div>
<div class="panel-body">
<p>
Our prices are the lowest in the region, if you find cheaper elsewhere, we will refund the difference
</p>
</div>
</div>
</div>
</div>
</section>
<section data-snippet-id="text-block">
<center><h2>Your products/services</h2></center>
<p>
<h3 class="text-muted">
The description of products/services from your quotation will be displayed below
</h3>
</p>
<p>
<b> To write a quotation description, edit your product, go the sales tab and add a text in "Description for quotations"</b>
</p>
</section>
</field>
</record>
</data>
</openerp>
+10 -1
View File
@@ -118,8 +118,17 @@ class sale_order(osv.osv):
'amount_undiscounted': fields.function(_get_total, string='Amount Before Discount', type="float",
digits_compute=dp.get_precision('Account'))
}
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())
'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):