[IMP] several cleaning

bzr revid: fp@tinyerp.com-20140101154754-cp4m9u84okx7m057
This commit is contained in:
Fabien Pinckaers 2014-01-01 16:47:54 +01:00
commit 9cbe77bc90
15 changed files with 1032 additions and 5 deletions

View File

@ -50,7 +50,7 @@ class mail_compose_message(osv.TransientModel):
res.update(
self.onchange_template_id(
cr, uid, [], context['default_template_id'], res.get('composition_mode'),
res.get('model'), res.get('res_id'), context=context
res.get('model'), res.get('res_id', context.get('active_id')), context=context
)['value']
)
return res
@ -113,7 +113,6 @@ class mail_compose_message(osv.TransientModel):
values['attachment_ids'].append(ir_attach_obj.create(cr, uid, data_attach, context=context))
else:
values = self.default_get(cr, uid, ['subject', 'body', 'email_from', 'email_to', 'email_cc', 'partner_to', 'reply_to', 'attachment_ids', 'mail_server_id'], context=context)
if values.get('body_html'):
values['body'] = values.pop('body_html')
return {'value': values}
@ -168,7 +167,6 @@ class mail_compose_message(osv.TransientModel):
# filter template values
fields = ['subject', 'body_html', 'email_from', 'email_to', 'partner_to', 'email_cc', 'reply_to', 'attachment_ids', 'attachments', 'mail_server_id']
values = dict.fromkeys(res_ids, False)
template_values = self.pool.get('email.template').generate_email_batch(cr, uid, template_id, res_ids, context=context)
for res_id in res_ids:
res_id_values = dict((field, template_values[res_id][field]) for field in fields if template_values[res_id].get(field))

View File

@ -12,4 +12,4 @@ access_sale_order_line_public,sale.order.line.public,model_sale_order_line,base.
access_product_attribute,product.attribute.public,website_sale.model_product_attribute,,1,0,0,0
access_product_attribute_value,product.attribute.value.public,website_sale.model_product_attribute_value,,1,0,0,0
access_product_attribute_product,product.attribute.product.public,website_sale.model_product_attribute_product,,1,0,0,0
access_website_product_style,website.product.style.public,website_sale.model_website_product_style,,1,0,0,0
access_website_product_style,website.product.style.public,website_sale.model_website_product_style,,1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
12 access_product_attribute product.attribute.public website_sale.model_product_attribute 1 0 0 0
13 access_product_attribute_value product.attribute.value.public website_sale.model_product_attribute_value 1 0 0 0
14 access_product_attribute_product product.attribute.product.public website_sale.model_product_attribute_product 1 0 0 0
15 access_website_product_style website.product.style.public website_sale.model_website_product_style 1 0 0 0

View File

@ -45,4 +45,4 @@
</record>
</data>
</openerp>
</openerp>

View File

@ -0,0 +1,2 @@
import controllers
import models

View File

@ -0,0 +1,24 @@
{
'name': 'Quote Roller',
'category': 'Website',
'summary': 'Send Live Quotation',
'version': '1.0',
'description': """
OpenERP Sale Quote Roller
==================
""",
'author': 'OpenERP SA',
'depends': ['website_sale','portal_sale', 'mail'],
'data': [
'views/website_sale_quote.xml',
'sale_quote_view.xml',
'sale_quote_data.xml',
'security/ir.model.access.csv',
],
'demo': [
'sale_quote_demo.xml'
],
'qweb': ['static/src/xml/*.xml'],
'installable': True,
}

View File

@ -0,0 +1,3 @@
import main
# vim:expandtab:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,106 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp import SUPERUSER_ID
from openerp.addons.web import http
from openerp.addons.web.http import request
from openerp.addons.website.models import website
class sale_quote(http.Controller):
def _get_partner_user(self, order_id):
order_pool = request.registry.get('sale.order')
user_pool = request.registry.get('res.users')
partner = order_pool.browse(request.cr, SUPERUSER_ID, order_id, context=request.context).partner_id.id
if partner:
user = user_pool.search(request.cr, SUPERUSER_ID, [('partner_id', '=', partner)])[0]
return user
def _get_message(self, order):
total = 0
for msg in order.message_ids:
if msg.subtype_id.name in ['Sales Order Confirmed', 'Discussions']:
total += 1
return total
@website.route(["/quote/<int:order_id>/<token>"], type='http', auth="public")
def view(self, order_id, token, **post):
# use SUPERUSER_ID allow to access/view order for public user
order = request.registry.get('sale.order').browse(request.cr, SUPERUSER_ID, order_id)
assert token == order.access_token, 'Access denied, wrong token!'
values = {
'quotation': order,
'message': self._get_message(order)
}
return request.website.render('website_sale_quote.so_quotation', values)
@website.route(['/quote/<int:order_id>/<token>/accept'], type='http', auth="public")
def accept(self, order_id, token, **post):
order = request.registry.get('sale.order').browse(request.cr, SUPERUSER_ID, order_id)
assert token == order.access_token, 'Access denied, wrong token!'
request.registry.get('sale.order').write(request.cr, self._get_partner_user(order_id), [order_id], {'state': 'manual'})
return request.redirect("/quote/%s/%s" % (order_id, token)
def decline(self, order_id):
return request.registry.get('sale.order').write(request.cr, self._get_partner_user(order_id), [order_id], {'state': 'cancel'})
@website.route(['/quote/<int:order_id>/<token>/post'], type='http', auth="public")
def post(self, order_id=None, token, **post):
# use SUPERUSER_ID allow to access/view order for public user
order = request.registry.get('sale.order').browse(request.cr, SUPERUSER_ID, order_id)
assert token == order.access_token, 'Access denied, wrong token!'
if post.get('new_message'):
request.session.body = post.get('new_message')
if post.get('decline_message'):
self.decline(order_id)
request.session.body = post.get('decline_message')
if 'body' in request.session and request.session.body:
request.registry.get('sale.order').message_post(request.cr, self._get_partner_user(order_id), order_id,
body=request.session.body,
type='comment',
subtype='mt_comment',
)
request.session.body = False
return request.redirect("/quote/%s/%s#chat" % (order_id, self._get_token(order_id)))
@website.route(['/quote/update_line'], type='json', auth="public")
def update(self, line_id=None, remove=False, unlink=False, order_id=None, **post):
if unlink:
return request.registry.get('sale.order.line').unlink(request.cr, SUPERUSER_ID, [int(line_id)], context=request.context)
val = self._update_order_line(line_id=int(line_id), number=(remove and -1 or 1))
order = request.registry.get('sale.order').browse(request.cr, SUPERUSER_ID, order_id)
return [str(val), str(order.amount_total)]
def _update_order_line(self, line_id, number):
order_line_obj = request.registry.get('sale.order.line')
order_line_val = order_line_obj.read(request.cr, SUPERUSER_ID, [line_id], [], context=request.context)[0]
quantity = order_line_val['product_uom_qty'] + number
order_line_obj.write(request.cr, SUPERUSER_ID, [line_id], {'product_uom_qty': (quantity)}, context=request.context)
return quantity
@website.route(["/template/<model('sale.quote.template'):quote>"], type='http', auth="public")
def template_view(self, quote=None, **post):
quote = request.registry.get('sale.quote.template').browse(request.cr, request.uid, quote.id)
values = {
'template': quote,
}
return request.website.render('website_sale_quote.so_template', values)

View File

@ -0,0 +1 @@
import order

View File

@ -0,0 +1,119 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013-Today OpenERP SA (<http://www.openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from openerp.osv import osv, fields
import uuid
import time
class sale_quote_template(osv.osv):
_name = "sale.quote.template"
_description = "Sale Quotation Template"
_columns = {
'name': fields.char('Quotation Template', size=256, required=True),
'website_description': fields.html('Description'),
'quote_line': fields.one2many('sale.quote.line', 'quote_id', 'Quote Template Lines'),
'note': fields.text('Terms and conditions'),
}
def open_template(self, cr, uid, quote_id, context=None):
return {
'action': 'ir.act.url',
'url': '/template/%d' % quote_id
}
class sale_quote_line(osv.osv):
_name = "sale.quote.line"
_description = "Quotation Template Lines"
_columns = {
'quote_id': fields.many2one('sale.quote.template', 'Quotation Template Reference', required=True, ondelete='cascade', select=True),
'name': fields.text('Description', required=True),
'product_id': fields.many2one('product.product', 'Product', domain=[('sale_ok', '=', True)], change_default=True),
'website_description': fields.html('Line Description'),
'price_unit': fields.float('Unit Price', required=True),
'product_uom_qty': fields.float('Quantity', required=True),
}
_defaults = {
'product_uom_qty': 1,
}
def on_change_product_id(self, cr, uid, ids, product, context=None):
vals = {}
product_obj = self.pool.get('product.product').browse(cr, uid, product, context=context)
vals.update({
'price_unit': product_obj.list_price,
'website_description': product_obj.website_description,
'name': product_obj.name,
})
return {'value': vals}
class sale_order_line(osv.osv):
_inherit = "sale.order.line"
_description = "Sales Order Line"
_columns = {
'website_description': fields.html('Line Description'),
}
def product_id_change(self, cr, uid, ids, pricelist, product, qty=0, uom=False, qty_uos=0, uos=False, name='', partner_id=False, lang=False, update_tax=True, date_order=False, packaging=False, fiscal_position=False, flag=False, context=None):
res = super(sale_order_line, self).product_id_change(cr, uid, ids, pricelist, product, qty, uom, qty_uos, uos, name, partner_id, lang, update_tax, date_order, packaging, fiscal_position, flag, context)
if product:
desc = self.pool.get('product.product').browse(cr, uid, product, context).website_description
res.get('value').update({'website_description': desc})
return res
class sale_order(osv.osv):
_inherit = 'sale.order'
_columns = {
'access_token': fields.char('Quotation Token', size=256, required=True),
'template_id': fields.many2one('sale.quote.template', 'Quote Template'),
'website_description': fields.html('Description'),
}
_defaults = {
'access_token': lambda self, cr, uid, ctx={}: len(uuid.uuid4())
}
def _get_sale_order_line(self, cr, uid, template_id, context=None):
"""create order line from selected quote template line."""
def onchange_template_id(self, cr, uid, ids, template_id, context=None):
lines = []
quote_template = self.pool.get('sale.quote.template').browse(cr, uid, template_id, context)
for line in quote_template.quote_line:
lines.append((0, 0, {
'name': line.name,
'price_unit': line.price_unit,
'product_uom_qty': line.product_uom_qty,
'product_id': line.product_id.id,
'product_uom_id': line.product_id.uom_id.id,
'website_description': line.website_description,
'state': 'draft',
}))
data = {'order_line': lines, 'website_description': quote_template.website_description, 'note': quote_template.note}
return {'value': data}
def recommended_products(self, cr, uid, ids, context=None):
order_line = self.browse(cr, uid, ids[0], context=context).order_line
product_pool = self.pool.get('product.product')
products = []
for line in order_line:
products += line.product_id.product_tmpl_id.recommended_products(context=context)
return products

View File

@ -0,0 +1,27 @@
<openerp>
<data>
<!--
Update Email template to send right quote url
-->
<record id="sale.email_template_edi_sale" model="email.template">
<field name="body_html"><![CDATA[
<div style="font-family: 'Lucica Grande', Ubuntu, Arial, Verdana, sans-serif; font-size: 12px; color: rgb(34, 34, 34); background-color: rgb(255, 255, 255); ">
<p>Hello ${object.partner_id.name},</p>
<p>Here is your ${object.state in ('draft', 'sent') and 'quotation' or 'order confirmation'} from ${object.company_id.name}: </p>
<% set signup_url = object.quote_url %>
<p>
You can access this document and pay online via our Customer Portal:
</p>
<a style="display:block; width: 150px; height:20px; margin-left: 120px; color: #DDD; font-family: 'Lucida Grande', Helvetica, Arial, sans-serif; font-size: 13px; font-weight: bold; text-align: center; text-decoration: none !important; line-height: 1; padding: 5px 0px 0px 0px; background-color: #8E0000; border-radius: 5px 5px; background-repeat: repeat no-repeat;"
href="${signup_url}">View ${object.state in ('draft', 'sent') and 'Quotation' or 'Order'}</a>
</div>
]]></field>
</record>
</data>
</openerp>

View File

@ -0,0 +1,400 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="product_template_quote_1" model="product.template">
<field name="name">Functional Training</field>
<field name="categ_id" ref="product.product_category_5"/>
<field name="public_categ_id" ref="product.Computer_all_in_one"/>
<field name="standard_price">50000.0</field>
<field name="list_price">750000.0</field>
<field name="type">service</field>
<field name="uom_id" ref="product.product_uom_unit"/>
<field name="uom_po_id" ref="product.product_uom_unit"/>
<field name="description_sale">Learn directly from our team and network of OpenERP experts. Choose from the available training sessions for a better functional understanding of OpenERP</field>
</record>
<record id="product_product_quote_1" model="product.product">
<field name="website_published" eval="True"/>
<field name="product_tmpl_id" ref="product_template_quote_1"/>
<field name="default_code">QF11</field>
</record>
<record id="product_template_quote_2" model="product.template">
<field name="name">Technical Training</field>
<field name="categ_id" ref="product.product_category_5"/>
<field name="public_categ_id" ref="product.Computer_all_in_one"/>
<field name="standard_price">50000.0</field>
<field name="list_price">0.0</field>
<field name="type">service</field>
<field name="uom_id" ref="product.product_uom_unit"/>
<field name="uom_po_id" ref="product.product_uom_unit"/>
<field name="description_sale">Learn directly from our team and network of OpenERP experts. Choose from the available training sessions for a better technical understanding of OpenERP</field>
</record>
<record id="product_product_quote_2" model="product.product">
<field name="website_published" eval="True"/>
<field name="product_tmpl_id" ref="product_template_quote_2"/>
<field name="default_code">QF12</field>
</record>
<record id="product_template_quote_3" model="product.template">
<field name="name">Advanced CRM Functional</field>
<field name="categ_id" ref="product.product_category_5"/>
<field name="public_categ_id" ref="product.Computer_all_in_one"/>
<field name="standard_price">50000.0</field>
<field name="list_price">750000.0</field>
<field name="type">service</field>
<field name="uom_id" ref="product.product_uom_unit"/>
<field name="uom_po_id" ref="product.product_uom_unit"/>
<field name="description_sale">Learn directly from our team and network of OpenERP experts. Choose from the available training sessions for a better functional understanding of OpenERP</field>
</record>
<record id="product_product_quote_3" model="product.product">
<field name="website_published" eval="True"/>
<field name="product_tmpl_id" ref="product_template_quote_3"/>
<field name="default_code">QF13</field>
</record>
<record id="product_template_quote_4" model="product.template">
<field name="name">Advanced Account Functional </field>
<field name="categ_id" ref="product.product_category_6"/>
<field name="public_categ_id" ref="product.Computer_all_in_one"/>
<field name="standard_price">50000.0</field>
<field name="list_price">750000.0</field>
<field name="type">service</field>
<field name="uom_id" ref="product.product_uom_unit"/>
<field name="uom_po_id" ref="product.product_uom_unit"/>
<field name="description_sale">Learn directly from our team and network of OpenERP experts. Choose from the available training sessions for a better functional understanding of OpenERP</field>
</record>
<record id="product_product_quote_4" model="product.product">
<field name="website_published" eval="True"/>
<field name="product_tmpl_id" ref="product_template_quote_4"/>
<field name="default_code">QF14</field>
</record>
<record id="website_quote_template_1" model="sale.quote.template">
<field name="name">Partnership Contract with Training</field>
<field name="note">The 5-day training is modular, which means that you can choose to participate in the full training or to just 1 or 2 modules. Nevertheless, the first day of the training is compulsory for everyone. The Monday is compulsory because the introduction of OpenERP is important before going through the other modules.</field>
<field name="website_description" type="html">
<section id="whatsuit" class="tab-pane active oe_section jumbotron">
<div class="container panel panel-default tab-pane active oe_section">
<div class="row panel-body">
<div class="text-center">
<h2><strong>Want to start selling OpenERP to your customers?</strong></h2>
<h3><small>Join our partner network</small></h3>
<div class="col-md-7 mt16">
<p class="lead">Get all you need to grow your business and deliver quality services with the OpenERP Partner Program. It includes discounts on OpenERP Enterprise, technical and functional trainings, support services, marketing documents, access to the partner portal, rights to use the trademark and much more.</p>
</div>
<div class="col-md-3">
<img class="media-object" src="https://www.openerp.com/openerp_enterprise/static/img/openerp_gold_partner.png"/>
</div>
</div>
</div>
<div class="row">
<div class="text-center">
<h2><strong>Why should you become a partner?</strong></h2>
<h3><small>Enjoy building a business based on happy customers</small></h3>
</div>
<div class="col-md-4">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">A Valuable Product</h3>
</div>
<div class="panel-body">
<h4><small>Have strong value added services as you can rely on 3000 existing modules to deliver what the customer needs in a short period of time. Grow with your existing customer base by continuously proposing new modules.</small></h4>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">A Strong Demand</h3>
</div>
<div class="panel-body">
<h4><small>Enjoy the traction of the fastest growing management software in the world. Benefit from the growing customer demand and the OpenERP brand.</small></h4>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">High Margins</h3>
</div>
<div class="panel-body">
<h4><small>Grow by developing a recurring revenue stream from OpenERP Enterprise's commission system. Get high billing rates as you deliver a highly valuable software.</small></h4>
</div>
</div>
</div>
</div>
</div>
<div class="container panel panel-default">
<div class="row panel-body">
<div class="text-center">
<h2><strong>Get Big discounts on OpenERP Enterprise</strong></h2>
<h3><small>Grow through recurring revenue streams from your customer base</small></h3>
</div>
<div class="col-md-8 col-md-offset-4 mb32 text-center">
<img class="img img-responsive" src="https://www.openerp.com/openerp_enterprise/static/img/partner_icon_01.png"/>
</div>
<div class="col-md-8 col-md-offset-2 mb32 text-center">
<p>
As a partner, you get a big discount on OpenERP Enterprise.
This allows you to offer reduced prices to your customers and/or
to benefit from a commission on every subscription you sell to your customers.
</p>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-12 text-center">
<h2><strong>Benefit From A Dedicated Account Manager</strong></h2>
<h3><small>Our role is to help you succeed</small></h3>
</div>
<div class="col-md-5 col-md-offset-1 mt32 mb16">
<img class="img img-responsive" src="https://www.openerp.com/openerp_enterprise/static/img/partner_icon_02.png"/>
</div>
<div class="col-md-5">
<p>A dedicated account manager is assigned to every partner to help develop the OpenERP business. The account manager helps you get leads, close deals, gives you feedback and best practices, delivers sales training and is a direct point of contact for any request you may have.</p>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-12 text-center">
<h2><strong>Get access to our consultants and technical experts</strong></h2>
<h3><small>Get access to experts for an extra fee</small></h3>
<p>For an extra fee, partners can get access to OpenERP's core developers and functional experts. This can help you succeed in delivering more complex or bigger projects by getting the support of highly experienced consultants on demand.</p>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-12 text-center">
<h2><strong>Get recognition as an official certified partner</strong></h2>
<h3><small>We give you visibility in our official partner list</small></h3>
<p>OpenERP promotes its partners through various ways: publication on our website, official communication, publication of your success stories, etc. As soon as you become an OpenERP partner and have followed the official trainings, you will be visible on the partner directory listing.</p>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-12 text-center">
<h2><strong>Access to the Lead Generation Program</strong></h2>
<h3><small>We give you visibility in our official partner list</small></h3>
<p>Every year, we redirect more than 100,000 customer requests to our official partners. These are prospects that filled a form on the OpenERP website and wanted to use OpenERP. The right partner to fulfill the customer request is selected based on the customer localization (nearest partner) and the grade of the partner..</p>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-12 text-center">
<h2><strong>Benefit from the OpenERP branding</strong></h2>
<h3><small>Get rights to use the OpenERP trademark</small></h3>
<p>Every year, we redirect more than 100,000 customer requests to our official partners. These are prospects that filled a form on the OpenERP website and wanted to use OpenERP. The right partner to fulfill the customer request is selected based on the customer localization (nearest partner) and the grade of the partner..</p>
</div>
</div>
</div>
<div class="container panel panel-default">
<div class="row panel-body">
<div class="text-center">
<h2><strong>Get Trained on OpenERP</strong></h2>
<h3><small>Technical training, functional training and sales training</small></h3>
<p>Customers need qualified partners. That's why being trained and certified is a requirement to become an official partner. When you start as a partner, you are free to choose from the following training sessions:</p>
</div>
<div class="col-md-4">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">The Technical Training</h3>
</div>
<div class="panel-body">
<h4><small>Learn how to develop custom modules, including the development of new business objects, customization of screens, the design of new reports, the adaption of workflows and automated interfaceing with other programs or websites. (5 days)</small></h4>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">The Functional Training</h3>
</div>
<div class="panel-body">
<h4><small>Learn how to configure and customize OpenERP, all from within the software itself - no coding required. The main applications are covered by this 5-day training are: Sales, Project Management, Accounting, Inventory, Manufacturing Resource Planning and Human Resources. (5 days)</small></h4>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-success">
<div class="panel-heading">
<h3 class="panel-title">The Sales Training</h3>
</div>
<div class="panel-body">
<h4><small>This online training is designed specifically for salespeople and presales employees who will be given an introduction course on OpenERP key features and how to present it's unique selling propositions to a potential customer.</small></h4>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-12 text-center">
<h2><strong>Get access to online training materials</strong></h2>
<h3><small>Train yourself on every new release using online videosGet rights to use the OpenERP trademark</small></h3>
<p>Each partner gets access to our training videos which are available in the partner portal. The training material is updated for every new version of OpenERP. Special training sessions are organised to keep partners up to date for each new version of OpenERP.</p>
</div>
</div>
</div>
<div class="container panel panel-default">
<div class="row panel-body">
<div class="text-center">
<h2><strong>Get access to our functional support services</strong></h2>
<h3><small>Don't be stuck on your implementation project, we can help you.</small></h3>
<p>As you go through your first implementation of an OpenERP system it is normal to need some support. We are here to answer your questions regarding the functionality of the software, or how to configure the solution. Each partner is entitled to a certain number of support hours thanks to his or her partner program.</p>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-12 text-center">
<h2><strong>Get technical support services</strong></h2>
<h3><small>We help your developers with bugs or support questions</small></h3>
<p>Each partner gets access to our training videos which are available in the partner portal. The training material is updated for every new version of OpenERP. Special training sessions are organised to keep partners up to date for each new version of OpenERP.</p>
</div>
<div class="col-md-8 col-md-offset-4 mb32 text-center">
<img class="img img-responsive" src="https://www.openerp.com/openerp_enterprise/static/img/partner_icon_04.png"/>
</div>
<div class="col-md-8 col-md-offset-2 mb32 text-center">
<p>The OpenERP Support Team is 100% dedicated to helping our customers. You can contact the Support Team for any functional or technical questions and issues with regard to OpenERP development. They can help you develop custom modules.</p>
</div>
</div>
<div class="row">
<div class="col-xs-12 col-md-12 text-center">
<h2><strong>Test all your developments automatically</strong></h2>
<h3><small>Your dedicated test integration platform</small></h3>
</div>
<div class="col-md-5 col-md-offset-1 mt32 mb16">
<img class="img img-responsive" src="https://www.openerp.com/openerp_enterprise/static/img/partner_sc_01.png"/>
</div>
<div class="col-md-5">
<p>Save time in your implementation project by having your developments tested automatically by our automated test servers. At every code commit, you get a full OpenERP instance that you can try out online. When this instance is deployed, your code is automatically put through our 2000+ automated unit tests.
Our automated testing server software is called Runbot, and you can try it out here: http://runbot.openerp.com. A dedicated runbot server is available for every partner.</p>
</div>
</div>
</div>
<div class="container panel panel-default">
<div class="row panel-body">
<div class="text-center">
<h2><strong>Get The Partnership Level That Suits You</strong></h2>
<p>The OpenERP eco system is designed to ensure that OpenERPs users will enjoy the best customer experience with our products. The community brings a wealth of new functionality.
OpenERP as a software publisher is committed to continuously improving the quality of the software. Our local partners provide integration and support services.</p>
</div>
</div>
<div class="row">
<div class="col-md-4">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Ready Partners</h3>
</div>
<div class="panel-body">
<h3><small>The Ready membership level enables Partners to start and grow their OpenERP competencies. They benefit from a comprehensive set of services including training, support and access to leads which allow them to build their business at their own pace.
Ready partners also have a minimum of 1 certified OpenERP Functional Specialist on the latest OpenERP version (enforced starting Q3 2014)</small></h3>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Silver Partners</h3>
</div>
<div class="panel-body">
<h3><small>Partners which have qualified for the Silver Partner level are experienced in implementing OpenERP projects. Silver partners enjoy enhanced benefits as well as access to additional resources to support the growth of their business with OpenERP.
Silver partners also have a minimum of 2 certified OpenERP Functional Specialists on the latest OpenERP version (enforced starting Q3 2014)</small></h3>
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Gold Partners</h3>
</div>
<div class="panel-body">
<h3><small>Gold partners have a strategic relationship with OpenERP. OpenERP is at the core of their strategy. They have committed significant resources to develop and deploy OpenERP solutions. They benefit from the highest visibility in the OpenERP ecosystem.
Gold partners also have a minimum of 3 certified OpenERP Functional Specialists on the latest OpenERP version (enforced starting Q3 2014)</small></h3>
</div>
</div>
</div>
</div>
</div>
</section>
</field>
</record>
<record id="website_sale_order_line_1" model="sale.quote.line">
<field name="quote_id" ref="website_quote_template_1"/>
<field name="name">Fuctional Training</field>
<field name="product_id" ref="product_product_quote_1"/>
<field name="product_uom_qty">1</field>
<field name="price_unit">12950.00</field>
<field name="website_description" type="html">
<section data-snippet-id="text-image" class="tab-pane oe_section jumbotron">
<div class="container panel panel-default tab-pane active oe_section">
<div class="row panel-body">
<div class="text-center">
<h2><strong>Online Training + Certification</strong></h2>
<p><small>These courses feature the same high quality course content found in our traditional classroom trainings, supplemented with modular sessions and cloud-based labs. Many of our online learning courses also include dozens of recorded webinars and live sessions by our senior instructors. At the end of the training, you can pass the OpenERP Certification exam in one of the 5000+ Pearson VUE test centers worldwide.</small></p>
</div>
<div class="col-md-offset-1">
<p><strong>Your advantages</strong></p>
<ul>
<li>Modular approach applied to the learning method</li>
<li>New interactive learning experience</li>
<li>Lower training budget for the same quality courses</li>
<li>Better comfort to facilitate your learning process</li>
</ul>
</div>
</div>
<div class="col-xs-12 col-md-12 text-center">
<h2><strong>Structure of the Training</strong></h2>
</div>
<div class="col-md-5 col-md-offset-1 mt32 mb16">
<img class="img img-responsive" src="https://www.openerp.com/saas_master/static/site_new/img/layout/online_training.png"/>
</div>
<div class="col-md-5">
<p><strong>There are three components to the training</strong></p>
<ul>
<li>Videos with detailed demos</li>
<li>Hands-on exercises and their solutions</li>
<li>Live Q&amp;A sessions with a trainer</li>
</ul>
</div>
</div>
</section>
</field>
</record>
<record id="website_sale_order_line_2" model="sale.quote.line">
<field name="quote_id" ref="website_quote_template_1"/>
<field name="name">Technical Training</field>
<field name="product_id" ref="product_product_quote_2"/>
<field name="product_uom_qty">1</field>
<field name="price_unit">00.00</field>
<field name="website_description" type="html">
<section id="whatsuit" class="tab-pane active oe_section jumbotron">
<div class="container panel panel-default tab-pane active oe_section">
<div class="row panel-body">
<div class="text-center">
<h2><strong>Technical Training</strong></h2>
<p><small>This course is dedicated to partners, integrators and developers who need to have a grasp of the OpenERP development process. This course is for new developers or for IT professionals eager to learn more about the OpenERP's technical aspects.
This 5-day training takes place in the Headquarters of OpenERP, in Grand-Rosière (Belgium).</small></p>
</div>
</div>
<div class="col-xs-12 col-md-12 text-center">
<h2><strong>Objectives</strong></h2>
</div>
<div class="">
<p><strong>Having attended this course, participants should be able to</strong></p>
<ul>
<li>Videos with detailed demos</li>
<li>Hands-on exercises and their solutions</li>
<li>Live Q&amp;A sessions with a trainer</li>
</ul>
<p><strong>Structure of the Training</strong></p>
<h3><small>There are three components to the training:</small></h3>
<ul>
<li>Demo in class with the trainer</li>
<li>Hands-on exercises and their corresponding solutions</li>
<li>Q&amp;A sessions</li>
</ul>
</div>
</div>
</section>
</field>
</record>
</data>
</openerp>

View File

@ -0,0 +1,93 @@
<?xml version="1.0"?>
<openerp>
<data>
<record model="ir.ui.view" id="sale_order_form_quote">
<field name="name">sale.order.form.payment</field>
<field name="model">sale.order</field>
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="//header" position="after">
<div class="oe_form_box_info oe_text_center" attrs="{'invisible': ['|',('quote_url', '=', False),('template_id','=',False)]}">
<field name="quote_url" widget="url"/>
</div>
</xpath>
<xpath expr="//field[@name='client_order_ref']" position="after">
<field name="template_id" on_change="onchange_template_id(template_id)"/>
<field name="website_description" invisible="1"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="view_sale_quote_template_form">
<field name="name">sale.quote.template.form</field>
<field name="model">sale.quote.template</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sale Quotation Template" version="7.0">
<sheet>
<div class="oe_button_box oe_right" name="buttons">
<button string="Template" type="object" name="open_template"/>
</div>
<div class="oe_title">
<label for="name" class="oe_edit_only">
<h1>
<field name="name"/>
</h1>
</div>
<field name="quote_line">
<form string="Sales Quote Template Lines" version="7.0">
<group>
<group>
<field name="product_id" on_change="on_change_product_id(product_id)"/>
<label for="product_uom_qty"/>
<div>
<field
name="product_uom_qty" class="oe_inline"/>
</div>
<field name="price_unit"/>
</group>
</group>
<notebook colspan="4">
<page string="Description">
<field name="name" />
</page>
<page string="Website Description">
<field name="website_description" />
</page>
</notebook>
</form>
<tree string="Sales Quote Template Lines" editable="bottom">
<field name="product_id" on_change="on_change_product_id(product_id)"/>
<field name="name"/>
<field name="product_uom_qty"/>
<field name="price_unit"/>
<field name="website_description" invisible="1"/>
</tree>
</field>
<field name="website_description" invisible="1"/>
<field name="note" placeholder="Terms and conditions..." nolable="1"/>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_sale_quote_template_tree">
<field name="name">sale.quote.template.tree</field>
<field name="model">sale.quote.template</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Sale Quote Template">
<field name="name"/>
</tree>
</field>
</record>
<record id="action_sale_quotation_template" model="ir.actions.act_window">
<field name="name">Sales Template</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">sale.quote.template</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem action="action_sale_quotation_template" id="menu_sale_quote_template" parent="base.menu_base_config" sequence="6" groups="base.group_sale_salesman,base.group_sale_manager"/>
</data>
</openerp>

View File

@ -0,0 +1,3 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_sale_order_portal,sale.order.portal,model_sale_order,base.group_portal,1,1,1,0
access_sale_order_public,sale.order.public,model_sale_order,base.group_public,1,1,1,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_sale_order_portal sale.order.portal model_sale_order base.group_portal 1 1 1 0
3 access_sale_order_public sale.order.public model_sale_order base.group_public 1 1 1 0

View File

@ -0,0 +1,24 @@
$(document).ready(function () {
$('a.js_update_line_json').on('click', function (ev) {
ev.preventDefault();
var $link = $(ev.currentTarget);
var href = $link.attr("href");
var order_id = $link.attr("href").match(/order_id=([0-9]+)/);
var line_id = href.match(/update_line\/([0-9]+)/);
openerp.jsonRpc("/quote/update_line/", 'call', {
'line_id': line_id[1],
'order_id': parseInt(order_id[1]),
'remove': $link.is('[href*="remove"]'),
'unlink': $link.is('[href*="unlink"]')
})
.then(function (data) {
if(!data){
location.reload();
}
$link.parents('.input-group:first').find('.js_quantity').val(data[0]);
$('[data-id="total_amount"]>span').html(data[1]);
});
return false;
});
});
//vim:et fdc=0 fdl=0 foldnestmax=3 fdm=syntax:

View File

@ -0,0 +1,227 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<template id="pricing" name="Price">
<section id="quote">
<table class="table table-hover">
<thead>
<tr>
<th>Products</th>
<th>Tax</th>
<th>Quantity</th>
<th>Unit Price</th>
<th>Price</th>
</tr>
</thead>
<tbody>
<tr t-foreach="quotation.order_line" t-as="line">
<td>
<div t-field="line.name"/>
</td>
<td>
<div class="input-group">
<span class="input-group-addon">
<a t-href="./update_line/#{ line.id }/?order_id=#{ quotation.id }&amp;remove=True" class="mb8 js_update_line_json">
<span class="fa fa-minus"/>
</a>
</span>
<input type="text" class="js_quantity form-control" t-att-data-id="line.id" t-att-value="line.product_uom_qty"/>
<span class="input-group-addon">
<a t-href="./update_line/#{ line.id }/?order_id=#{ quotation.id }" class="mb8 js_update_line_json">
<span class="fa fa-plus"/>
</a>
</span>
</div>
</td>
<td>
<!-- if discount, display it striked -->
<div t-field="line.price_unit" t-field-options='{"widget": "monetary","display_currency": "website.pricelist_id.currency_id"}'/>
</td>
<td>
<div t-field="line.price_subtotal" t-field-options='{"widget": "monetary", "display_currency": "website.pricelist_id.currency_id"}'/>
</td>
<td>
<a t-href="./update_line/#{ line.id }/?order_id=#{ quotation.id }&amp;unlink=True" class="mb8 js_update_line_json pull-right">
<span class="fa fa-trash-o"></span>
</a>
</td>
</tr>
<tr>
<td></td>
<td></td>
<td><h3>Total</h3></td>
<td class="text-left" colspan="2">
<h3>
<strong data-id="total_amount" t-field="quotation.amount_total" t-field-options='{"widget": "monetary","display_currency": "website.pricelist_id.currency_id"}'/>
</h3>
</td>
</tr>
</tbody>
</table>
</section>
</template>
<template id="quote_status">
<div class="btn-group btn-group-lg">
<a class="btn btn-success fa fa-check" type="submit" t-if="quotation.state != 'manual' and quotation.state != 'cancel'" t-href="/quote/#{ quotation.id }/accept">
Accept
</a>
<a class="btn btn-info fa fa-comment" type="submit" t-if="quotation.state != 'manual' and quotation.state != 'cancel'" href="#chat">
Send us a Feedback
<sup class="label label-info"><t t-esc="message"/></sup>
</a>
<a class="btn btn-danger fa fa-times" data-toggle="modal" data-target="#modeldecline">
Refuse
</a>
</div>
</template>
<template id="chatter">
<div id="chat" class="panel panel-default">
<div class="panel-heading">
<h3 class="panel-title">
<i class="fa fa-comment fa-flip-horizontal"></i> Recent Comments
</h3>
</div>
<div class="panel-body">
<ul class="list-group">
<t t-foreach="quotation.message_ids" t-as="message">
<t t-if="message.subtype_id.name == 'Sales Order Confirmed' or message.subtype_id.name == 'Discussions'" >
<li class="list-group-item">
<div class="row">
<div class="col-xs-2 col-md-1" t-if="message.author_id.image_small">
<img t-att-src="'data:image/png;base64,' + message.author_id.image_small" class="img-circle img-responsive" alt="" /></div>
<div class="col-xs-10 col-md-11">
<div>
<a href="http://www.jquery2dotnet.com/2013/10/google-style-login-page-desing-usign.html"/>
<t t-raw="message.body"/>
<div class="mic-info">
By: <a href="#"><t t-esc="message.author_id.name"/></a> on <t t-esc="message.date"/>
</div>
</div>
</div>
</div>
</li>
</t>
</t>
</ul>
</div>
</div>
<form id="post" accept-charset="UTF-8" method="POST" t-att-action="'/quote/%%s/post#post' %% quotation.id">
<textarea rows="3" id="new_message" name="new_message" placeholder="Your Comment....." class="form-control span7"> </textarea>
<button type="submit" t-att-id="quotation.id" class="btn btn-info">Post your Comment</button>
</form>
</template>
<template id="so_quotation" name="Product Quotation">
<t t-call="website.layout">
<t t-set="head">
<script type="text/javascript" src="/website_sale_quote/static/src/js/sale_quote.js"></script>
<t t-raw="head or ''"/>
</t>
<div class="col-xs-12 col-md-8 tab-content">
<t t-call="website_sale_quote.quote_status"/>
<div class="modal fade" id="modeldecline" role="dialog" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true"></button>
<h4 class="modal-title">Reason</h4>
</div>
<form id="post" accept-charset="UTF-8" method="POST" t-att-action="'/quote/%%s/post#post' %% (quotation.id)">
<div class="modal-body">
<textarea rows="3" id="decline_message" name="decline_message" placeholder="Your Comment....." class="form-control span7"> </textarea>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
<button type="submit" t-att-id="quotation.id" class="btn btn-info">Post</button>
</div>
</form>
</div>
</div>
</div>
<section id="introduction11" class="tab-pane active" t-field="quotation.website_description">
</section>
<t t-foreach="quotation.order_line" t-as="line">
<section class="tab-pane" t-att-id="line.id">
<div t-field="line.website_description" class="oe_structure"/>
</section>
</t>
<t t-call="website_sale_quote.pricing"/>
<t t-call="website_sale_quote.terms_and_conditions"/>
<t t-call="website_sale_quote.product_recommendation"/>
<t t-call="website_sale_quote.chatter"/>
</div>
<div class="col-xs-6 col-md-4 sidebar" id="sidebar">
<ul class="nav nav-pills nav-stacked" data-spy="affix">
<li class="active"><a href="#introduction11" data-toggle="tab"><i class="icon-chevron-right"></i> Introduction</a></li>
<t t-foreach="quotation.order_line" t-as="line">
<li><a t-att-href="'#%s'% line.id" data-toggle="tab"><i class="icon-chevron-right"></i><t t-raw="line.product_id.name_template"/> </a></li>
</t>
<li><a href="#quote" data-toggle="tab"><i class="icon-chevron-right"></i> Pricing</a></li>
<li><a href="#terms" data-toggle="tab"><i class="icon-chevron-right"></i> Terms &amp; Conditions</a></li>
</ul>
</div>
</t>
</template>
<template id="product_recommendation">
<div class="container mt32" t-if="quotation.recommended_products()">
<h3>Customers who have bought this product also bought:</h3>
<div class='row mt16' style="margin-left: 15px !important;">
<t t-foreach="quotation.recommended_products()" t-as="product">
<div class='col-md-2 thumbnail' style='width: 170px; margin-right: 16px;'>
<div class='mt16 text-center'>
<a href="#" t-field="product.name"/>
<span t-field="product.image_small" t-field-options='{"widget": "image", "class": "img-rounded"}'/>
</div>
</div>
</t>
</div>
</div>
</template>
<template id="terms_and_conditions" name="Terms &amp; Conditions">
<section id="terms" class="tab-pane oe_section jumbotron">
<div class="container panel panel-default tab-pane oe_section">
<div class="row panel-body">
<div class="text-center">
<h2><strong>Terms &amp; Conditions</strong></h2>
<p class="lead" t-field="quotation.note"/>
</div>
</div>
</div>
</section>
</template>
<template id="so_template" name="SO Template">
<t t-call="website.layout">
<div class="col-xs-12 col-md-8 tab-content">
<section id="template_introduction" class="tab-pane active" t-field="template.website_description">
</section>
<t t-foreach="template.quote_line" t-as="line">
<section class="tab-pane" t-att-id="line.id">
<div t-field="line.website_description" class="oe_structure"/>
</section>
</t>
<section id="templateterms" class="tab-pane oe_section jumbotron">
<div class="container panel panel-default tab-pane oe_section">
<div class="row panel-body">
<div class="text-center">
<h2><strong>Terms &amp; Conditions</strong></h2>
<p class="lead" t-field="template.note"/>
</div>
</div>
</div>
</section>
</div>
<div class="col-xs-6 col-md-4 sidebar" id="sidebar">
<ul class="nav nav-pills nav-stacked" data-spy="affix">
<li class="active"><a href="#template_introduction" data-toggle="tab"><i class="icon-chevron-right"></i> Introduction</a></li>
<t t-foreach="template.quote_line" t-as="line">
<li><a t-att-href="'#%s'% line.id" data-toggle="tab"><i class="icon-chevron-right"></i><t t-raw="line.product_id.name_template"/> </a></li>
</t>
<li><a href="#templateterms" data-toggle="tab"><i class="icon-chevron-right"></i> Terms &amp; Conditions</a></li>
</ul>
</div>
</t>
</template>
</data>
</openerp>