This question has been flagged
4 Replies
12319 Views

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

Avatar
Discard
Best Answer

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.

Avatar
Discard
Author

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?

See the edit to my answer above.

Author

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.

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.

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.

See my edit above

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.

I edited my answer to create a second button instead.

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.

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.

Best Answer

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, 
            }

 

Avatar
Discard
Best Answer

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?

Avatar
Discard

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

Best Answer

Try trought Email templates in Configuration-Tecnical-Email

Avatar
Discard