Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

2

Emailing Purchase Orders

By
rishi kesh
on 4/8/13, 12:00 PM 4,523 views

I do not have an option to send a purchase order by email to a supplier. Are there any workarounds for this?

4

Ray Carnes

--Ray Carnes--
15717
| 9 7 9
Greater Los Angeles, United States
--Ray Carnes--

Senior Odoo Analyst

OpenERP 6.1, 7.0 and Odoo 8.0, 9.0 (Since 2012)

Completed Functional and Technical Training.

Major Skills:

  • Needs Discovery and Requirements Analysis;

  • Function and Technical Specifications;

  • Project Planning;

  • Prototyping and Proof of concepts;

  • Data migration;

  • Configuration & Customization (UI and modules);

  • Integration - data, business logic and service levels;

  • Training and Knowledge transfer;

  • Go Live support;

  • Help desk;

  • Version Migration.

I have over 20 years of experience empowering and enabling users with enterprise information systems that make a real and measurable difference in their ability to proactively manage their businesses and organizations. 

Ray Carnes
On 4/8/13, 8:43 PM

I just created a brand new database on today's release of 7.0 and installed JUST the Purchases module.

The option was there and the only time it isn't is if the purchase order is already approved.

If this is the case for you, you need to PRINT the PO and email the PDF.


EDIT:

Regarding your comment "But i still don't see that option in openerp demo site. "

I do - what I see is below - I think you are looking in a different place, or I don't understand your problem.

image description


EDIT:

The visibility of the email button is controlled by the form view definition.

To change the view definition:

1) Enter debug mode (From the About OpenERP window).

2) Open an approved Purchase Order.

3) Go to the debug menu (top left).

4) Select Edit Form View.

5) Change:

<button 
 name="wkf_send_rfq" 
 states="sent" 
 string="Send by Email" 
 type="object" 
 context="{'send_rfq':True}"/>

to

<button 
 name="wkf_send_rfq" 
 states="sent" 
 string="Send RFQ by Email" 
 type="object" 
 context="{'send_rfq':True}"/>

6) Add a new button:

<button 
 name="wkf_send_rfq" 
 states="approved" 
 string="Send PO by Email" 
 type="object" 
 context="{'send_rfq':False}"/>

To persist these changes through upgrades, inherit and override this view either via the UI or in a module.

Thats a good news. But i still don't see that option in openerp demo site. Is there any easy way to update to the latest build?

rishi kesh
on 4/9/13, 5:21 AM

See the edit to my answer above.

Bista Solutions US, Ray Carnes
on 4/9/13, 2:31 PM

Yes but i am talking about the purchase orders page. Once you confirm an order you have no option to send that to your customer.

rishi kesh
on 4/9/13, 2:50 PM

Re-read my answer. I posted "The option was there and the only time it isn't is if the purchase order is already approved". You are correct. I also posted "If this is the case for you, you need to PRINT the PO and email the PDF." Do you mean 'Supplier' a PO is when you purchase something, not sell something.

Bista Solutions US, Ray Carnes
on 4/9/13, 2:56 PM

I'm also wishing there was a button "Send by Email" for a confirmed PO. In general, a "Send by email' button makes a process doable from my smart phone or tablet because the alternative (save a pdf, rename a pdf, write an email, attach the pdf) can be quite a drag.

Gilles Lehoux
on 3/9/14, 3:32 PM

See my edit above

Bista Solutions US, Ray Carnes
on 3/9/14, 4:42 PM

The code change in the form view, as provided in the answer above, creates a "Send by Email" button. The email template is correct for sending a PO but the attached file is the RFQ instead of the PO.

Gilles Lehoux
on 3/9/14, 5:10 PM

I edited my answer to create a second button instead.

Bista Solutions US, Ray Carnes
on 3/9/14, 5:26 PM

The button "Send RFQ by Email" doesn't appear either in the RFQ or the PO view. There is still the original "Send by Email" button in the RFQ view. The "Send PO by Email" appears in the PO view but the attachment is the RFQ.

Gilles Lehoux
on 3/9/14, 5:41 PM

OK. It is more complicated than I originally thought. Getting the correct report will require some coding. I will look at this if I have some spare time this week.

Bista Solutions US, Ray Carnes
on 3/9/14, 10:34 PM
1
Fabian Semal
On 10/20/14, 6:26 AM

You can override the method wfk_send_rfq. Jsut add a conditional statement on the order status to change the value of default_template_id:       

def wkf_send_rfq(self, cr, uid, ids, context=None):
            '''
            This function opens a window to compose an email, with the edi purchase template message loaded by default
            '''
            ir_model_data = self.pool.get('ir.model.data')
            try:
                template_id = ir_model_data.get_object_reference(cr, uid, 'purchase', 'email_template_edi_purchase')[1]
            except ValueError:
                template_id = False
            try:
                compose_form_id = ir_model_data.get_object_reference(cr, uid, 'mail', 'email_compose_message_wizard_form')[1]
            except ValueError:
                compose_form_id = False 
            ctx = dict(context)
            ctx.update({
                'default_model': 'purchase.order',
                'default_res_id': ids[0],
                'default_use_template': bool(template_id),
                'default_template_id': template_id,
                'default_composition_mode': 'comment',
            })
            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, 
            }

 

0
Mike Lindsay
On 4/8/13, 8:28 PM

I'm just starting my testing of OpenERP 7 today. So far I have learned some of the email functions are controlled by the Chatter module, have you looked at that yet?

Good Thinking - but you can't install the Purchases module without the modules that is depends on to work - stock, procurement, product, account and mail (Social Networking/Chatter).

Bista Solutions US, Ray Carnes
on 4/8/13, 8:38 PM
0
G Reyes
On 6/24/14, 4:36 PM

Try trought Email templates in Configuration-Tecnical-Email

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 4/8/13, 12:00 PM
Seen: 4523 times
Last updated: 3/16/15, 8:10 AM