diff --git a/addons/website_sale_quote/__openerp__.py b/addons/website_sale_quote/__openerp__.py index 1db0f379226..da6c2175db3 100644 --- a/addons/website_sale_quote/__openerp__.py +++ b/addons/website_sale_quote/__openerp__.py @@ -16,6 +16,7 @@ OpenERP Sale Quote Roller 'sale_quote_data.xml' ], 'demo': [ + 'sale_quote_demo.xml' ], 'qweb': ['static/src/xml/*.xml'], 'installable': True, diff --git a/addons/website_sale_quote/controllers/main.py b/addons/website_sale_quote/controllers/main.py index 8f682136902..a710d650b06 100644 --- a/addons/website_sale_quote/controllers/main.py +++ b/addons/website_sale_quote/controllers/main.py @@ -13,31 +13,31 @@ from openerp.addons.website.models import website class sale_quote(http.Controller): def get_quote(self, token): - quote_pool = request.registry.get('sale.quote') - quote_id = quote_pool.search(request.cr, SUPERUSER_ID, [('access_token', '=', token)], context=request.context) - return quote_id - + order_pool = request.registry.get('sale.order') + order_id = order_pool.search(request.cr, SUPERUSER_ID, [('access_token', '=', token)], context=request.context) + return order_id + @website.route(['/quote/'], type='http', auth="public") def view(self, token=None, **post): values = {} - # http://hostname:8069/quote?id= - quote_pool = request.registry.get('sale.quote') - quotation = quote_pool.browse(request.cr, SUPERUSER_ID, self.get_quote(token))[0] + order_pool = request.registry.get('sale.order') + quotation = order_pool.browse(request.cr, SUPERUSER_ID, self.get_quote(token))[0] + render_template = 'website_sale_quote.so_quotation' values.update({ 'quotation' : quotation, }) - return request.website.render('website_sale_quote.quotation', values) + return request.website.render(render_template, values) @website.route(['/quote//accept'], type='http', auth="public") def accept(self, token=None , **post): values = {} - quotation = request.registry.get('sale.quote').write(request.cr, SUPERUSER_ID, self.get_quote(token), {'state': 'accept'}) + quotation = request.registry.get('sale.order').write(request.cr, SUPERUSER_ID, self.get_quote(token), {'state': 'manual'}) return request.redirect("/quote/%s" % token) @website.route(['/quote//decline'], type='http', auth="public") def decline(self, token=None , **post): values = {} - quotation = request.registry.get('sale.quote').write(request.cr, SUPERUSER_ID, self.get_quote(token), {'state': 'cancel'}) + quotation = request.registry.get('sale.order').write(request.cr, SUPERUSER_ID, self.get_quote(token), {'state': 'cancel'}) return request.redirect("/quote/%s" % token) @website.route(['/quote//post'], type='http', auth="public") @@ -46,7 +46,7 @@ class sale_quote(http.Controller): if post.get('new_message'): request.session.body = post.get('new_message') if 'body' in request.session and request.session.body: - request.registry.get('sale.quote').message_post(request.cr, SUPERUSER_ID, self.get_quote(token), + request.registry.get('sale.order').message_post(request.cr, SUPERUSER_ID, self.get_quote(token), body=request.session.body, type='comment', subtype='mt_comment', diff --git a/addons/website_sale_quote/models/order.py b/addons/website_sale_quote/models/order.py index adca999b588..9e5ab9ff327 100644 --- a/addons/website_sale_quote/models/order.py +++ b/addons/website_sale_quote/models/order.py @@ -23,22 +23,29 @@ from openerp.osv import osv, fields import hashlib import time -class sale_quote(osv.Model): - _name = "sale.quote" - _inherit = ['mail.thread', 'ir.needaction_mixin'] - _description = "Sales Quotations" +class sale_order_line(osv.osv): + _inherit = "sale.order.line" + _description = "Sales Order Line" _columns = { -# 'template_id': fields.many2one('ir.ui.view', 'Template'), - 'order_id': fields.many2one('sale.order', 'Order', required=True), - 'state': fields.selection([ - ('draft', 'Draft Quotation'), - ('sent', 'Quotation Sent'), - ('accept', 'Accept'), - ('cancel', 'Cancelled'), - ('done', 'Done'), - ], 'Status'), - 'to_email': fields.char('Customers Email'), - 'access_token':fields.char('Quotation Token', size=256), + '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}) + print res + return res + +class sale_order(osv.osv): + _inherit = 'sale.order' + _columns = { + 'quote_url': fields.char('URL'), + 'access_token':fields.char('Quotation Token', size=256), + 'template_id': fields.many2one('sale.order','Quote Template'), + 'website_description': fields.html('Description'), + 'is_template': fields.boolean('Is Template'), } def new_quotation_token(self, cr, uid, record_id): @@ -47,56 +54,34 @@ class sale_quote(osv.Model): return self.write(cr, uid, [record_id],{'access_token': quotation_token} ) def create(self, cr, uid, vals, context=None): - if context is None: - context = {} - new_id = super(sale_quote, self).create(cr, uid, vals, context=context) + new_id = super(sale_order, self).create(cr, uid, vals, context=context) self.new_quotation_token(cr, uid, new_id) return new_id - - -class sale_order(osv.osv): - _inherit = 'sale.order' - _columns = { - 'quote_url': fields.char('URL'), - } - -# def action_quotation_send(self, cr, uid, ids, context=None): -# ''' -# This function opens a window to compose an email, with the edi sale template message loaded by default -# ''' -# data_pool = self.pool.get('ir.model.data') -# sale_quote = self.pool.get('sale.quote') -# try: -# compose_form_id = data_pool.get_object_reference(cr, uid, 'mail', 'email_compose_message_wizard_form')[1] -# except ValueError: -# compose_form_id = False -# model,template_id = data_pool.get_object_reference(cr, uid, 'website_sale_quote', "email_template_sale_quote") -# ctx = dict(context) -# for order in self.browse(cr, uid, ids, context): -# if not order.quote_id: -# new_id = sale_quote.create(cr, uid,{ -# 'state' : 'draft', -# 'to_email': order.partner_id.email, -# }) -# self.write(cr, uid, [order.id] ,{'quote_id': new_id}, context) -# ctx.update({ -# 'default_model': 'sale.order', -# 'default_res_id': order.id, -# 'default_use_template': bool(template_id), -# 'default_template_id': template_id, -# 'default_composition_mode': 'comment', -# 'mark_so_as_sent': True -# }) -# return { -# 'type': 'ir.actions.act_window', -# 'view_type': 'form', -# 'view_mode': 'form', -# 'res_model': 'mail.compose.message', -# 'views': [(compose_form_id, 'form')], -# 'view_id': compose_form_id, -# 'target': 'new', -# 'context': ctx, -# } + + def write(self, cr, uid, ids, vals, context=None): + template_id = vals.get('template_id', False) + lines = [] + line_pool = self.pool.get('sale.order.line') + if template_id: + order_template = self.browse(cr, uid, template_id, context) + for line in order_template.order_line: + line_pool.create(cr, uid,{ + 'name': line.name, + 'sequence': line.sequence, + 'order_id': ids[0], + 'price_unit': line.price_unit, + 'product_uom_qty': line.product_uom_qty, + 'discount': line.discount, + 'product_id': line.product_id.id, + 'tax_id': [(6, 0, [x.id for x in line.tax_id])], + 'website_description':line.website_description, + }, context=context) + vals.update({ + 'quote_url': self.get_signup_url(cr, uid, ids, context), + 'website_description': order_template.website_description, + }) + res = super(sale_order, self).write(cr, uid, ids, vals, context=context) + return res def action_quotation_send(self, cr, uid, ids, context=None): quote = super(sale_order, self).action_quotation_send(cr, uid,ids, context) @@ -114,8 +99,9 @@ class sale_order(osv.osv): def get_signup_url(self, cr, uid, ids, context=None): url = False - quote_id = self.pool.get('sale.quote').search(cr, uid, [('order_id','=', ids[0])], context=context) - for quote in self.pool.get('sale.quote').browse(cr, uid, quote_id, context=context): - base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url', default='http://localhost:8069', context=context) - url = "%s/quote/%s" % (base_url, quote.access_token) + order = self.browse(cr, uid, ids, context=context)[0] + base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url', default='http://localhost:8069', context=context) + url = "%s/quote/%s" % (base_url, order.access_token) return url + + diff --git a/addons/website_sale_quote/sale_quote_demo.xml b/addons/website_sale_quote/sale_quote_demo.xml new file mode 100644 index 00000000000..daee6db3edc --- /dev/null +++ b/addons/website_sale_quote/sale_quote_demo.xml @@ -0,0 +1,431 @@ + + + + + + + + + + + + +
+
+
+
+

Want to start selling OpenERP to your customers?

+

Join our partner network

+
+

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.

+
+
+ +
+
+
+
+
+

Why should you become a partner?

+

Enjoy building a business based on happy customers

+
+
+
+
+

A Valuable Product

+
+
+

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.

+
+
+
+
+
+
+

A Strong Demand

+
+
+

Enjoy the traction of the fastest growing management software in the world. Benefit from the growing customer demand and the OpenERP brand.

+
+
+
+
+
+
+

High Margins

+
+
+

Grow by developing a recurring revenue stream from OpenERP Enterprise's commission system. Get high billing rates as you deliver a highly valuable software.

+
+
+
+
+
+
+
+
+
+
+

Get Big discounts on OpenERP Enterprise

+

Grow through recurring revenue streams from your customer base

+
+
+ +
+
+

+ 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. +

+
+
+
+
+

Benefit From A Dedicated Account Manager

+

Our role is to help you succeed

+
+
+ +
+
+

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.

+
+
+
+
+

Get access to our consultants and technical experts

+

Get access to experts for an extra fee

+

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.

+
+
+
+
+

Get recognition as an official certified partner

+

We give you visibility in our official partner list

+

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.

+
+
+
+
+

Access to the Lead Generation Program

+

We give you visibility in our official partner list

+

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..

+
+
+
+
+

Benefit from the OpenERP branding

+

Get rights to use the OpenERP trademark

+

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..

+
+
+
+
+
+
+
+
+

Get Trained on OpenERP

+

Technical training, functional training and sales training

+

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:

+
+
+
+
+

The Technical Training

+
+
+

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)

+
+
+
+
+
+
+

The Functional Training

+
+
+

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)

+
+
+
+
+
+
+

The Sales Training

+
+
+

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.

+
+
+
+
+
+
+

Get access to online training materials

+

Train yourself on every new release using online videosGet rights to use the OpenERP trademark

+

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.

+
+
+
+
+
+
+
+
+

Get access to our functional support services

+

Don't be stuck on your implementation project, we can help you.

+

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.

+
+
+
+
+

Get technical support services

+

We help your developers with bugs or support questions

+

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.

+
+
+ +
+
+

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.

+
+
+
+
+

Test all your developments automatically

+

Your dedicated test integration platform

+
+
+ +
+
+

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.

+
+
+
+
+
+
+
+
+

Get The Partnership Level That Suits You

+

The OpenERP eco system is designed to ensure that OpenERP’s 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.

+
+
+
+
+
+
+

Ready Partners

+
+
+

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)

+
+
+
+
+
+
+

Silver Partners

+
+
+

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)

+
+
+
+
+
+
+

Gold Partners

+
+
+

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)

+
+
+
+
+
+
+
+
+ + + + Gold Partner + + 1 + 1 + + 12950.00 + +
+
+
+
+

Why you'll love an iPad.

+

+ Right from the start, there’s a lot to love about + iPad. It’s simple yet powerful. Thin and light yet + full-featured. It can do just about everything and + be just about anything. +

+ And because it’s so easy to use, it’s easy to love. +

+
+
+ +
+
+
+
+
+
+
+
+ +
+
+

The full iPad experience.

+

There is less of it, but no less to it.

+

+ Everything you love about iPad — the beautiful + screen, fast and fluid performance, FaceTime and + iSight cameras, thousands of amazing apps, 10-hour + battery life* — is everything you’ll love about + iPad mini, too. And you can hold it in one hand. +

+
+
+
+
+
+
+ + + + Functional Training + + 1 + 1 + + 00.00 + +
+
+
+
+

Bose Mini Bluetooth Speaker.

+

+ The Bose® SoundLink® mini is Bose's smallest portable Bluetooth speaker. Its ultra-compact size fits in the + palm of your hand, yet gives you full, natural sound wirelessly from your iPhone, iPad, or iPod. Grab it and go + full-featured. It can do just about everything and + experience music just about anywhere. +

+ +
+
+

Characteristics

+
+
+
    +
  • Sleek, compact design
  • +
  • Efficient, high-quality audio
  • +
  • Remote control for power, volume, track seek
  • +
  • Auxiliary input for portable devices
  • +
  • Universal iPod docking station fits most iPod/iPhone models
  • +
  • Charges iPod/iPhone
  • +
  • Volume control on main system
  • +
+
+
+ +
+
+ +
+
+
+
+
+
+
+
+

Plays where you play

+

+ The SoundLink® Mini speaker is small and light enough + to tuck into your bag. It weighs in at just 1.5 pounds. + Its low profile lets you place it almost anywhere and + provides a low center of gravity that makes it nearly + impossible to tip over. +

+

+ The rechargeable lithium-ion battery delivers up to seven hours of playtime. + And at home, you can listen even longer—the charging cradle lets + you listen while it charges. +

+
+
+ +
+
+

Bluetooth connectivity

+

+ The speaker has a range of about 30 feet, so you can enjoy + the sound you want without wires. It pairs easily with your + smartphone, iPad® or other Bluetooth device. + And it remembers the most recent six devices you've used, + so reconnecting is even simpler. +

+
+
+
+
+
+
+
+
+ +
+
+

More features.

+

+ Charging cradle recharges the battery and serves as a convenient + home base for your speaker, and it lets you play while it charges. +

+

+ Wall charger can be plugged into the cradle or directly into the speaker +

+

+ Auxiliary port lets you connect other audio sources, like an MP3 player +

+

+ USB port allows for software update to ensure ongoing Bluetooth device compatibility +

+

+ Soft covers are available separately in blue, green or orange. Pick a color to match your style. +

+
+
+
+
+
+
+ + + + + + + + manual + + +
+
diff --git a/addons/website_sale_quote/sale_quote_view.xml b/addons/website_sale_quote/sale_quote_view.xml index b5120ace33a..e3c62e94d63 100644 --- a/addons/website_sale_quote/sale_quote_view.xml +++ b/addons/website_sale_quote/sale_quote_view.xml @@ -1,17 +1,27 @@ - - - sale.order.form.payment - sale.order - - - - - - + sale.order.form.payment + sale.order + + + +
+ +
+
+ + + + + + + + + + +
diff --git a/addons/website_sale_quote/views/website_sale_quote.xml b/addons/website_sale_quote/views/website_sale_quote.xml index 2280a91ae00..f5d2eb7b6ec 100644 --- a/addons/website_sale_quote/views/website_sale_quote.xml +++ b/addons/website_sale_quote/views/website_sale_quote.xml @@ -91,232 +91,189 @@ -