diff --git a/addons/edi/static/src/xml/edi_sale_purchase.xml b/addons/edi/static/src/xml/edi_sale_purchase.xml index 8191660c5c9..8d6bab67761 100644 --- a/addons/edi/static/src/xml/edi_sale_purchase.xml +++ b/addons/edi/static/src/xml/edi_sale_purchase.xml @@ -33,9 +33,12 @@ - +

Quotation :

+ +

Request for Quotation :

+

Order :

diff --git a/addons/purchase/edi/purchase_order.py b/addons/purchase/edi/purchase_order.py index 3a82e990a14..42cbb04842c 100644 --- a/addons/purchase/edi/purchase_order.py +++ b/addons/purchase/edi/purchase_order.py @@ -57,6 +57,7 @@ PURCHASE_ORDER_EDI_STRUCT = { 'amount_total': True, 'amount_untaxed': True, 'amount_tax': True, + 'state':True, } class purchase_order(osv.osv, EDIMixin): diff --git a/addons/purchase/edi/purchase_order_action_data.xml b/addons/purchase/edi/purchase_order_action_data.xml index edfded48915..70d402de598 100644 --- a/addons/purchase/edi/purchase_order_action_data.xml +++ b/addons/purchase/edi/purchase_order_action_data.xml @@ -48,7 +48,7 @@

Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},

-

Here is a purchase order confirmation from ${object.company_id.name}:

+

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

  REFERENCES
@@ -65,7 +65,7 @@

- You can view the order confirmation document and download it using the following link: + You can view the ${object.state in ('draft', 'sent') and 'request for quotation' or 'order confirmation'} document and download it using the following link:

View Order @@ -111,7 +111,7 @@ '%(object.validator.user_email) or ''} -You can view the order confirmation and download it using the following link: - ${ctx.get('edi_web_url_view') or 'n/a'} - -If you have any question, do not hesitate to contact us. - -Thank you! - - --- -${object.validator.name} ${object.validator.user_email and '<%s>'%(object.validator.user_email) or ''} -${object.company_id.name} -% if object.company_id.street: -${object.company_id.street or ''} -% endif -% if object.company_id.street2: -${object.company_id.street2} -% endif -% if object.company_id.city or object.company_id.zip: -${object.company_id.zip or ''} ${object.company_id.city or ''} -% endif -% if object.company_id.country_id: -${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''} -% endif -% if object.company_id.phone: -Phone: ${object.company_id.phone} -% endif -% if object.company_id.website: -${object.company_id.website or ''} -% endif - ]]> - - - - Automated Quataion Request Notification Mail - ${object.validator.user_email or ''} - ${object.company_id.name} Order (Ref ${object.name or 'n/a' }) - ${object.partner_id.email} - - - - -

Hello${object.partner_id.name and ' ' or ''}${object.partner_id.name or ''},

- -

Here is a request for quotation from ${object.company_id.name}:

- -

-   REFERENCES
-   Order number: ${object.name}
-   Order total: ${object.amount_total} ${object.pricelist_id.currency_id.name}
-   Order date: ${object.date_order}
- % if object.origin: -   Order reference: ${object.origin}
- % endif - % if object.partner_ref: -   Your reference: ${object.partner_ref}
- % endif -   Your contact: ${object.validator.name} -

- -

- You can view the request for quotation and download it using the following link: -

- View Order - -
-

If you have any question, do not hesitate to contact us.

-

Thank you!

-
-
-
-

- ${object.company_id.name}

-
-
- - % if object.company_id.street: - ${object.company_id.street}
- % endif - % if object.company_id.street2: - ${object.company_id.street2}
- % endif - % if object.company_id.city or object.company_id.zip: - ${object.company_id.zip} ${object.company_id.city}
- % endif - % if object.company_id.country_id: - ${object.company_id.state_id and ('%s, ' % object.company_id.state_id.name) or ''} ${object.company_id.country_id.name or ''}
- % endif -
- % if object.company_id.phone: -
- Phone:  ${object.company_id.phone} -
- % endif - % if object.company_id.website: - - %endif -

-
- - ]]>
- - % endif - | Your contact: ${object.validator.name} ${object.validator.user_email and '<%s>'%(object.validator.user_email) or ''} - -You can view the quotation and download it using the following link: +You can view the ${object.state in ('draft', 'sent') and 'request for quotation' or 'order confirmation'} and download it using the following link: ${ctx.get('edi_web_url_view') or 'n/a'} If you have any question, do not hesitate to contact us. diff --git a/addons/purchase/purchase.py b/addons/purchase/purchase.py index 6e92d1f9e4e..03dee93c164 100644 --- a/addons/purchase/purchase.py +++ b/addons/purchase/purchase.py @@ -144,7 +144,7 @@ class purchase_order(osv.osv): STATE_SELECTION = [ ('draft', 'Draft PO'), ('wait', 'Waiting'), - ('send', 'RFQ Sent'), + ('sent', 'RFQ Sent'), ('confirmed', 'Waiting Approval'), ('approved', 'Purchase Order'), ('except_picking', 'Shipping Exception'), @@ -334,10 +334,7 @@ class purchase_order(osv.osv): def wkf_send_rfq(self, cr, uid, ids, context=None): mod_obj = self.pool.get('ir.model.data') - if context.get('send_rfq', False): - template = mod_obj.get_object_reference(cr, uid, 'purchase', 'email_template_edi_purchase_quatation') - else: - template = mod_obj.get_object_reference(cr, uid, 'purchase', 'email_template_edi_purchase') + template = mod_obj.get_object_reference(cr, uid, 'purchase', 'email_template_edi_purchase') template_id = template and template[1] or False res = mod_obj.get_object_reference(cr, uid, 'mail', 'email_compose_message_wizard_form') res_id = res and res[1] or False diff --git a/addons/purchase/purchase_view.xml b/addons/purchase/purchase_view.xml index a9d55923ef4..c43b53ceb68 100644 --- a/addons/purchase/purchase_view.xml +++ b/addons/purchase/purchase_view.xml @@ -132,18 +132,18 @@
-