mirror of
https://github.com/OCA/account-financial-tools.git
synced 2025-02-02 12:47:26 +02:00
[FIX] Correction regarding Nicolas Bessi - Camptocamp comments
This commit is contained in:
@@ -17,6 +17,6 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
import account_invoice
|
||||
from . import account_invoice
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -25,10 +25,7 @@
|
||||
"description": """Constraint to not be able to cancel on invoice if already import in payment order
|
||||
""",
|
||||
'website': 'http://www.camptocamp.com',
|
||||
'init_xml': [],
|
||||
'update_xml': [
|
||||
],
|
||||
'demo_xml': [],
|
||||
'data' : [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
}
|
||||
|
||||
@@ -37,14 +37,14 @@ class account_invoice(orm.TransientModel):
|
||||
FROM payment_line as pl
|
||||
INNER JOIN payment_order AS po
|
||||
ON pl.id = order_id
|
||||
WHERE move_line_id IN (SELECT id FROM account_move_line WHERE move_id = %s)""",
|
||||
WHERE move_line_id IN (SELECT id FROM account_move_line WHERE move_id = %s) LIMIT 1""",
|
||||
(invoice['move_id'][0],))
|
||||
payment_orders = cr.dictfetchall()
|
||||
payment_orders = cr.dictfetchone()
|
||||
if payment_orders:
|
||||
raise osv.except_osv(_('Error !'),
|
||||
_("Invoice already import in payment"
|
||||
"order (%s) at %s on line %s" %
|
||||
(payment_orders[0]['payment_name'],
|
||||
payment_orders[0]['payment_date'],
|
||||
payment_orders[0]['name'],)))
|
||||
(payment_orders['payment_name'],
|
||||
payment_orders['payment_date'],
|
||||
payment_orders['name'],)))
|
||||
return super(account_invoice,self).action_cancel(cr, uid, ids, *args)
|
||||
Reference in New Issue
Block a user