From 6fffcd42bdb623c78fbcad5ea277cff74514e20a Mon Sep 17 00:00:00 2001 From: "ajay javiya (OpenERP)" Date: Fri, 6 Dec 2013 19:27:20 +0530 Subject: [PATCH] [IMP]: onchange template in so bzr revid: aja@tinyerp.com-20131206135720-s2e0z9k5phr4rwwt --- addons/im/static/src/js/im.js | 4 +- addons/website_sale_quote/controllers/main.py | 2 +- addons/website_sale_quote/models/order.py | 73 +-- addons/website_sale_quote/sale_quote_data.xml | 3 +- addons/website_sale_quote/sale_quote_demo.xml | 454 +++++++++--------- addons/website_sale_quote/sale_quote_view.xml | 4 +- .../views/website_sale_quote.xml | 32 +- 7 files changed, 272 insertions(+), 300 deletions(-) diff --git a/addons/im/static/src/js/im.js b/addons/im/static/src/js/im.js index 6fbf452f974..a8487a59696 100644 --- a/addons/im/static/src/js/im.js +++ b/addons/im/static/src/js/im.js @@ -83,7 +83,7 @@ }); }, calc_box: function() { - var $topbar = instance.client.$(".oe_topbar"); + var $topbar = instance.client.$(".navbar"); var top = $topbar.offset().top + $topbar.height(); top = Math.max(top - $(window).scrollTop(), 0); this.$el.css("top", top); @@ -174,4 +174,4 @@ openerp.webclient.to_kitten(); }; -})(); \ No newline at end of file +})(); diff --git a/addons/website_sale_quote/controllers/main.py b/addons/website_sale_quote/controllers/main.py index a710d650b06..974e2c7705d 100644 --- a/addons/website_sale_quote/controllers/main.py +++ b/addons/website_sale_quote/controllers/main.py @@ -48,7 +48,7 @@ class sale_quote(http.Controller): if 'body' in request.session and request.session.body: request.registry.get('sale.order').message_post(request.cr, SUPERUSER_ID, self.get_quote(token), body=request.session.body, - type='comment', + type='email', subtype='mt_comment', ) request.session.body = False diff --git a/addons/website_sale_quote/models/order.py b/addons/website_sale_quote/models/order.py index 9e5ab9ff327..53a5c25a31a 100644 --- a/addons/website_sale_quote/models/order.py +++ b/addons/website_sale_quote/models/order.py @@ -48,60 +48,39 @@ class sale_order(osv.osv): 'is_template': fields.boolean('Is Template'), } - def new_quotation_token(self, cr, uid, record_id): + def new_quotation_token(self, cr, uid, record_id,context=None): db_uuid = self.pool.get('ir.config_parameter').get_param(cr, uid, 'database.uuid') quotation_token = hashlib.sha256('%s-%s-%s' % (time.time(), db_uuid, record_id)).hexdigest() - return self.write(cr, uid, [record_id],{'access_token': quotation_token} ) + return self.write(cr, uid, [record_id],{'access_token': quotation_token,'quote_url': self.get_signup_url(cr, uid, quotation_token, context)} ) def create(self, cr, uid, vals, context=None): - new_id = super(sale_order, self).create(cr, uid, vals, context=context) - self.new_quotation_token(cr, uid, new_id) - return new_id - - 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 + new_id = super(sale_order, self).create(cr, uid, vals, context=context) + self.new_quotation_token(cr, uid, new_id,context) + return new_id - def action_quotation_send(self, cr, uid, ids, context=None): - quote = super(sale_order, self).action_quotation_send(cr, uid,ids, context) - sale_quote = self.pool.get('sale.quote') - for order in self.browse(cr, uid, ids, context): - q_id = sale_quote.search(cr, uid, [('order_id','=', order.id)], context=context) - if not q_id: - new_id = sale_quote.create(cr, uid,{ - 'order_id' : order.id, - 'state' : 'draft', - 'to_email': order.partner_id.email, - }) - self.write(cr, uid, order.id, {'quote_url': self.get_signup_url(cr, uid, [order.id], context)}) - return quote - - def get_signup_url(self, cr, uid, ids, context=None): - url = False - order = self.browse(cr, uid, ids, context=context)[0] + def get_signup_url(self, cr, uid, token, context=None): 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) + url = "%s/quote/%s" % (base_url ,token) return url + def _get_sale_order_line(self, cr, uid,template_id, context=None): + line_pool = self.pool.get('sale.order.line') + lines = [] + order_template = self.browse(cr, uid, template_id, context) + for line in order_template.order_line: + lines.append((0,0,{ + 'name': line.name, + 'sequence': line.sequence, + '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, + })) + return {'order_line':lines,'website_description': order_template.website_description} + def onchange_template_id(self, cr, uid,ids, template_id, context=None): + data = self._get_sale_order_line(cr, uid, template_id, context) + return {'value':data} diff --git a/addons/website_sale_quote/sale_quote_data.xml b/addons/website_sale_quote/sale_quote_data.xml index ff7c3cfc972..e1b7209f59b 100644 --- a/addons/website_sale_quote/sale_quote_data.xml +++ b/addons/website_sale_quote/sale_quote_data.xml @@ -1,6 +1,5 @@ - Sales Quotation - Send by Email (Quote) @@ -16,7 +15,7 @@

Here is your ${object.state in ('draft', 'sent') and 'quotation' or 'order confirmation'} from ${object.company_id.name}:

- <% set signup_url = object.get_quote_url() %> + <% set signup_url = object.get_signup_url(object.access_token) %>

You can access this document and pay online via our Customer Portal:

diff --git a/addons/website_sale_quote/sale_quote_demo.xml b/addons/website_sale_quote/sale_quote_demo.xml index daee6db3edc..7817f0670e1 100644 --- a/addons/website_sale_quote/sale_quote_demo.xml +++ b/addons/website_sale_quote/sale_quote_demo.xml @@ -10,250 +10,242 @@ -
-
-
-
-

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.

+

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.

+
+
+
-
-
-
-
-

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)

-
+
+
+
+

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.

-
-
-
-

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)

-
+
+
+
+
+

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.

-
-
-
-

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)

-
+
+
+
+
+

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)

+
+
+
+
+
+ +
diff --git a/addons/website_sale_quote/sale_quote_view.xml b/addons/website_sale_quote/sale_quote_view.xml index e3c62e94d63..11ab98d2339 100644 --- a/addons/website_sale_quote/sale_quote_view.xml +++ b/addons/website_sale_quote/sale_quote_view.xml @@ -7,13 +7,13 @@ -
+
- + diff --git a/addons/website_sale_quote/views/website_sale_quote.xml b/addons/website_sale_quote/views/website_sale_quote.xml index f5d2eb7b6ec..e5ce3176f70 100644 --- a/addons/website_sale_quote/views/website_sale_quote.xml +++ b/addons/website_sale_quote/views/website_sale_quote.xml @@ -207,9 +207,10 @@
  • - + Discuss +
  • @@ -225,21 +226,23 @@
    - + +
    @@ -253,8 +256,7 @@
    -
    -
    +