From 74ff1a50fa141d40eff447bde782ce6a2d2611ef Mon Sep 17 00:00:00 2001 From: Christophe Simonis Date: Thu, 1 Sep 2016 15:35:39 +0200 Subject: [PATCH] Revert "[FIX] payment_paypal: missing Paypal link" Since 85bcd6fdd86123e26a022d07be21b1e8bc16a771, the field `paypal_account` has been removed. The field `paypal_url` cannot be computed correctly anymore. This reverts commit 2ab68047c11c0902b6a9e5d772b654862fba9c40. --- addons/payment_paypal/models/__init__.py | 1 - .../payment_paypal/models/account_invoice.py | 27 ------------------- 2 files changed, 28 deletions(-) delete mode 100644 addons/payment_paypal/models/account_invoice.py diff --git a/addons/payment_paypal/models/__init__.py b/addons/payment_paypal/models/__init__.py index e85dd257cf2..a1fe670f56f 100644 --- a/addons/payment_paypal/models/__init__.py +++ b/addons/payment_paypal/models/__init__.py @@ -1,4 +1,3 @@ # -*- coding: utf-8 -*- -import account_invoice import paypal diff --git a/addons/payment_paypal/models/account_invoice.py b/addons/payment_paypal/models/account_invoice.py deleted file mode 100644 index 7b7f3e377b7..00000000000 --- a/addons/payment_paypal/models/account_invoice.py +++ /dev/null @@ -1,27 +0,0 @@ -# -*- coding: utf-8 -*- - -from openerp import models, fields, api - -import werkzeug.urls - -class AccountInvoice(models.Model): - _inherit = 'account.invoice' - - paypal_url = fields.Char('Paypal Url', compute='_compute_paypal_url') - - @api.depends('type', 'number', 'company_id', 'currency_id') - def _compute_paypal_url(self): - for inv in self: - if inv.type == 'out_invoice' and inv.company_id.paypal_account: - params = { - "cmd": "_xclick", - "business": inv.company_id.paypal_account, - "item_name": "%s Invoice %s" % (inv.company_id.name, inv.number or ''), - "invoice": inv.number, - "amount": inv.residual, - "currency_code": inv.currency_id.name, - "button_subtype": "services", - "no_note": "1", - "bn": "Odoo_Invoice_PayNow_" + inv.currency_id.name, - } - inv.paypal_url = "https://www.paypal.com/cgi-bin/webscr?" + werkzeug.url_encode(params)