[IMP] Quotation template buttons

This commit is contained in:
Fabien Pinckaers
2015-11-20 01:25:43 +01:00
parent 7ca296b090
commit 72707806cc
3 changed files with 7 additions and 22 deletions
+2 -2
View File
@@ -136,11 +136,11 @@
type="action" context="{'default_advance_payment_method': 'percentage'}"
attrs="{'invisible': ['|',('invoice_status', '!=', 'no'), ('state', '!=', 'sale')]}"/>
<button name="action_quotation_send" string="Send by Email" type="object" states="draft" class="btn-primary"/>
<button name="action_quotation_send" string="Send by Email" type="object" states="sent,sale"/>
<button name="print_quotation" string="Print" type="object" states="draft" class="btn-primary"/>
<button name="print_quotation" string="Print" type="object" states="sent,sale"/>
<button name="action_confirm" states="sent" string="Confirm Sale" class="btn-primary" type="object" context="{'show_sale': True}"/>
<button name="action_confirm" states="draft" string="Confirm Sale" type="object" context="{'show_sale': True}"/>
<button name="print_quotation" string="Print" type="object" states="sent,sale"/>
<button name="action_quotation_send" string="Send by Email" type="object" states="sent,sale"/>
<button name="action_cancel" states="draft,sent,sale" type="object" string="Cancel"/>
<button name="action_draft" states="cancel" type="object" string="Set to Quotation"/>
<button name="action_done" type="object" string="Set to Done" states="sale"
-8
View File
@@ -155,16 +155,8 @@ 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):
@@ -6,20 +6,11 @@
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//header/button[@name='action_quotation_send'][1]" position="replace">
<button name="action_quotation_send" string="Send by Email" type="object"
groups="base.group_user"
attrs="{'invisible': ['|',('quote_viewed','=',True),('state','!=', 'draft')]}"/>
<button name="action_quotation_send" string="Send by Email" type="object" groups="base.group_user"
class="oe_highlight"
attrs="{'invisible': ['|',('quote_viewed','=',False),('state','!=', 'draft')]}"/>
<xpath expr="//header/button[@name='action_confirm'][1]" position="after">
<button name="open_quotation" type="object"
class="oe_highlight o_open_quotation" string="View Online Quotation"
class="o_open_quotation" string="Preview"
attrs="{'invisible': [('template_id', '=', False)]}"/>
</xpath>
<xpath expr="//header/button[@name='print_quotation'][1]" position="replace">
<button name="print_quotation" string="Print" type="object" states="draft" groups="base.group_user"/>
</xpath>
<xpath expr="//page/field[@name='order_line']/.." position="after">
<page string="Suggested Products">
<field name="quote_viewed" invisible="1"/>
@@ -39,7 +30,9 @@
<xpath expr="//field[@name='project_id']" position="before">
<label for="template_id"/>
<div>
<field name="template_id" context="{'company_id': company_id}" on_change="onchange_template_id(template_id, partner_id, fiscal_position_id, pricelist_id)"/>
<field name="template_id" context="{'company_id': company_id}"
on_change="onchange_template_id(template_id, partner_id, fiscal_position_id, pricelist_id)"
options="{'no_create': True, 'no_open': True}"/>
</div>
</xpath>
<xpath expr="//field[@name='client_order_ref']" position="after">