From d1dbd1876a30fad884032648f5b0dafdac598b77 Mon Sep 17 00:00:00 2001 From: Olivier Dony Date: Thu, 3 Nov 2011 00:52:24 +0100 Subject: [PATCH] [IMP] edi: sale.order EDI export: offer online payment only if prepaid bzr revid: odo@openerp.com-20111102235224-3sarzzsol6gzpsh0 --- .../edi/static/src/xml/edi_sale_purchase.xml | 62 ++++++++++--------- addons/sale/edi/sale_order.py | 1 + addons/sale/edi/sale_order_action_data.xml | 4 +- addons/sale/sale.py | 2 +- 4 files changed, 36 insertions(+), 33 deletions(-) diff --git a/addons/edi/static/src/xml/edi_sale_purchase.xml b/addons/edi/static/src/xml/edi_sale_purchase.xml index 95f3a39936f..a34158a6189 100644 --- a/addons/edi/static/src/xml/edi_sale_purchase.xml +++ b/addons/edi/static/src/xml/edi_sale_purchase.xml @@ -116,37 +116,39 @@ - -

Pay Online

- -
- - -
-

- You may directly pay this order online via Paypal's secure payment gateway:
- - - -

-
- -
- - -
-

- Please transfer to - (postal address on the order header) - using one of the following bank accounts. Be sure to mention the document - reference on the transfer: -

-

-
    - -
  • + + +

    Pay Online

    + +
    + + +
    +

    + You may directly pay this order online via Paypal's secure payment gateway:
    + + + +

    +
    + +
    + + +
    +

    + Please transfer to + (postal address on the order header) + using one of the following bank accounts. Be sure to mention the document + reference on the transfer: +

    +

    +
      + +
    • +
      +
    -
diff --git a/addons/sale/edi/sale_order.py b/addons/sale/edi/sale_order.py index 9fd332ed345..1b3c437f015 100644 --- a/addons/sale/edi/sale_order.py +++ b/addons/sale/edi/sale_order.py @@ -57,6 +57,7 @@ SALE_ORDER_EDI_STRUCT = { 'amount_untaxed': True, 'amount_tax': True, 'payment_term': True, + 'order_policy': True, } class sale_order(osv.osv, EDIMixin): diff --git a/addons/sale/edi/sale_order_action_data.xml b/addons/sale/edi/sale_order_action_data.xml index 4afc7c508af..e52778ddde4 100644 --- a/addons/sale/edi/sale_order_action_data.xml +++ b/addons/sale/edi/sale_order_action_data.xml @@ -56,7 +56,7 @@ View Order - % if object.company_id.paypal_account: + % if object.order_policy == 'prepaid' and object.company_id.paypal_account: <% comp_name = quote(object.company_id.name) order_name = quote(object.name) @@ -131,7 +131,7 @@ Your order for ${object.partner_id.name} has just been validated: You can view the order confirmation, download it and even pay online using the following link: ${ctx.get('edi_web_url_view') or 'n/a'} -% if object.company_id.paypal_account: +% if object.order_policy == 'prepaid' and object.company_id.paypal_account: <% comp_name = quote(object.company_id.name) order_name = quote(object.name) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index 294a1c29c00..3bd4e101e86 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -217,7 +217,7 @@ class sale_order(osv.osv): 'partner_shipping_id': fields.many2one('res.partner.address', 'Shipping Address', readonly=True, required=True, states={'draft': [('readonly', False)]}, help="Shipping address for current sales order."), 'incoterm': fields.many2one('stock.incoterms', 'Incoterm', help="Incoterm which stands for 'International Commercial terms' implies its a series of sales terms which are used in the commercial transaction."), - 'picking_policy': fields.selection([('direct', 'Deliver each products when available'), ('one', 'Deliver all products at once')], + 'picking_policy': fields.selection([('direct', 'Deliver each product when available'), ('one', 'Deliver all products at once')], 'Picking Policy', required=True, readonly=True, states={'draft': [('readonly', False)]}, help="""If you don't have enough stock available to deliver all at once, do you accept partial shipments or not?"""), 'order_policy': fields.selection([ ('prepaid', 'Pay before delivery'),