Skip to content

Commit

Permalink
[IMP] website_quote: onboarding
Browse files Browse the repository at this point in the history
Views and labels improvements
  • Loading branch information
mba-odoo authored and rim-odoo committed Oct 13, 2014
1 parent af311c5 commit bf92a5b
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 22 deletions.
14 changes: 6 additions & 8 deletions addons/sale/sale_view.xml
Original file line number Diff line number Diff line change
Expand Up @@ -334,13 +334,12 @@
<p class="oe_view_nocontent_create">
Click to create a quotation, the first step of a new sale.
</p><p>
Odoo will help you handle efficiently the complete sale flow:
Odoo will help you handling efficiently the complete sale flow:
from the quotation to the sales order, the
delivery, the invoicing and the payment collection.
</p><p>
The social feature helps you organize discussions on each sales
order, and allow your customers to keep track of the evolution
of the sales order.
The social feature helps you organizing discussions on each sales
order, and allows your customers to keep track of the sales orders' evolution.
</p>
</field>
</record>
Expand Down Expand Up @@ -631,13 +630,12 @@
<p class="oe_view_nocontent_create">
Click to create a quotation, the first step of a new sale.
</p><p>
Odoo will help you handle efficiently the complete sale flow:
Odoo will help you handling efficiently the complete sale flow:
from the quotation to the sales order, the
delivery, the invoicing and the payment collection.
</p><p>
The social feature helps you organize discussions on each sales
order, and allow your customers to keep track of the evolution
of the sales order.
The social feature helps you organizing discussions on each sales
order, and allows your customers to keep track of the sales orders' evolution.
</p>
</field>
</record>
Expand Down
4 changes: 2 additions & 2 deletions addons/website_quote/data/website_quotation_demo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -235,7 +235,7 @@
through our 2000+ automated unit tests.
</p><p>
Our automated testing server software is called Runbot,
and you can try it out here: http://runbot.openerp.com.
and you can try it out here: http://runbot.odoo.com.
A dedicated runbot server is available for every
partner.
</p>
Expand Down Expand Up @@ -275,7 +275,7 @@
<h2>Structure of the Training</h2>
</div>
<div class="col-md-5 col-md-offset-1 mt16 mb16">
<img class="img img-responsive" src="https://www.openerp.com/saas_master/static/site_new/img/layout/online_training.png"/>
<img class="img img-responsive" src="https://www.odoo.com/saas_master/static/site_new/img/layout/online_training.png"/>
</div>
<div class="col-md-6 mt32">
<h4><strong>There are three components to the training</strong></h4>
Expand Down
12 changes: 7 additions & 5 deletions addons/website_quote/models/order.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ class sale_quote_template(osv.osv):
_columns = {
'name': fields.char('Quotation Template', required=True),
'website_description': fields.html('Description', translate=True),
'quote_line': fields.one2many('sale.quote.line', 'quote_id', 'Quote Template Lines', copy=True),
'quote_line': fields.one2many('sale.quote.line', 'quote_id', 'Quotation Template Lines', copy=True),
'note': fields.text('Terms and conditions'),
'options': fields.one2many('sale.quote.option', 'template_id', 'Optional Products Lines', copy=True),
'number_of_days': fields.integer('Quote Duration', help='Number of days for the validaty date computation of the quotation'),
'number_of_days': fields.integer('Quotation Duration', help='Number of days for the validity date computation of the quotation'),
}
def open_template(self, cr, uid, quote_id, context=None):
return {
Expand Down Expand Up @@ -140,11 +140,12 @@ def _get_total(self, cr, uid, ids, name, arg, context=None):

_columns = {
'access_token': fields.char('Security Token', required=True, copy=False),
'template_id': fields.many2one('sale.quote.template', 'Quote Template', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}),
'template_id': fields.many2one('sale.quote.template', 'Quotation Template', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}),
'website_description': fields.html('Description'),
'options' : fields.one2many('sale.order.option', 'order_id', 'Optional Products Lines', readonly=True, states={'draft': [('readonly', False)], 'sent': [('readonly', False)]}),
'amount_undiscounted': fields.function(_get_total, string='Amount Before Discount', type="float",
digits_compute=dp.get_precision('Account'))
digits_compute=dp.get_precision('Account')),
'quote_viewed': fields.boolean('Quotation Viewed')
}

def _get_template_id(self, cr, uid, context=None):
Expand All @@ -161,6 +162,7 @@ def _get_template_id(self, cr, uid, context=None):

def open_quotation(self, cr, uid, quote_id, context=None):
quote = self.browse(cr, uid, quote_id[0], context=context)
self.write(cr, uid, quote_id[0], {'quote_viewed': True}, context=context)
return {
'type': 'ir.actions.act_url',
'target': 'self',
Expand Down Expand Up @@ -238,7 +240,7 @@ def get_access_action(self, cr, uid, id, context=None):

class sale_quote_option(osv.osv):
_name = "sale.quote.option"
_description = "Quote Option"
_description = "Quotation Option"
_columns = {
'template_id': fields.many2one('sale.quote.template', 'Quotation Template Reference', ondelete='cascade', select=True, required=True),
'name': fields.text('Description', required=True, translate=True),
Expand Down
7 changes: 7 additions & 0 deletions addons/website_quote/static/src/css/website_quotation.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@
border-radius: 5px;
}

/* mobile preview: the left menu overlaps the quote */
@media (max-width: 768px) {
.o_website_quote .bs-sidebar {
position: relative;
}
}

.o_website_quote .bs-sidenav {
padding-top: 10px;
padding-bottom: 10px;
Expand Down
55 changes: 48 additions & 7 deletions addons/website_quote/views/website_quotation_backend.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,29 @@
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//header/button[@name='action_button_confirm']" position="before">
<button name="open_quotation" string="Preview Quotation" type="object"
attrs="{'invisible': [('template_id','=',False)]}"/>
<button name="open_quotation" string="Preview Quotation" type="object" class="oe_highlight"
attrs="{'invisible': ['|',('template_id','=',False),('quote_viewed','=',True)]}"/>
</xpath>
<xpath expr="//header/button[@name='action_button_confirm']" position="before">
<button name="open_quotation" string="Preview Quotation" type="object" attrs="{'invisible': ['|',('template_id','=',False),('quote_viewed','=',False)]}"/>
</xpath>
<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>
<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[@string='Order Lines']" position="after">
<page string="Suggested Products">
<label string="Optional Products &amp; Services" for="options"/>
<field name="quote_viewed" invisible="1"/>
<field name="options">
<tree string="Sales Quote Template Lines" editable="bottom">
<tree string="Sales Quotation Template Lines" editable="bottom">
<field name="product_id" on_change="on_change_product_id(product_id)"/>
<field name="name"/>
<field name="quantity"/>
Expand Down Expand Up @@ -58,7 +73,7 @@
<notebook>
<page string="Lines">
<field name="quote_line">
<form string="Sales Quote Template Lines">
<form string="Sales Quotation Template Lines">
<group>
<group>
<field name="product_id" on_change="on_change_product_id(product_id)"/>
Expand All @@ -83,7 +98,7 @@
</page>
</notebook>
</form>
<tree string="Sales Quote Template Lines" editable="bottom">
<tree string="Sales Quotation Template Lines" editable="bottom">
<field name="sequence" widget="handle"/>
<field name="product_id" on_change="on_change_product_id(product_id)"/>
<field name="name"/>
Expand All @@ -97,7 +112,7 @@
</page>
<page string="Suggested Products">
<field name="options">
<tree string="Sales Quote Template Lines" editable="bottom">
<tree string="Sales Quotation Template Lines" editable="bottom">
<field name="product_id" on_change="on_change_product_id(product_id)"/>
<field name="name"/>
<field name="quantity"/>
Expand All @@ -120,7 +135,7 @@
<field name="model">sale.quote.template</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Sale Quote Template">
<tree string="Sale Quotation Template">
<field name="name"/>
</tree>
</field>
Expand All @@ -131,6 +146,32 @@
<field name="res_model">sale.quote.template</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click here to create your template.
</p><p>
Use templates to create polished, professional quotes in minutes.
Send these quotes by email and let your customers sign online.
Use cross-selling and discounts to push and boost your sales.
</p>
</field>
</record>

<record id="sale.action_quotations" model="ir.actions.act_window">
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to create a quotation, the first step of a new sale.
</p><p>
Odoo will help you handling efficiently the complete sale flow:
from the quotation to the sales order, the
delivery, the invoicing and the payment collection.
</p><p>
Promote products with a designed quotation template you send by email.
</p><p>
The social feature helps you organizing discussions on each sales
order, and allows your customers to keep track of the sales orders' evolution.
</p>
</field>
</record>

<menuitem action="action_sale_quotation_template" id="menu_sale_quote_template" parent="base.menu_sales_config" sequence="1" name="Quotation Templates" groups="base.group_sale_salesman,base.group_sale_manager"/>
Expand Down

0 comments on commit bf92a5b

Please sign in to comment.