Update for new Transaction

This commit is contained in:
Cédric Krier committed 2010-08-19 22:03:14 +02:00
1 parent 3148f9a73d
commit 31a0dbaa3a
2 files changed
+7 -9

No files matched your search

+2 -2
View File
@@ -4,8 +4,8 @@ Installing trytond_account_invoice_line_standalone
Prerequisites
-------------
* Python 2.4 or later (http://www.python.org/)
* trytond 0.0.x (http://www.tryton.org/)
* Python 2.5 or later (http://www.python.org/)
* trytond (http://www.tryton.org/)
* trytond_account_invoice (http://www.tryton.org/)
Installation
+5 -7
View File
@@ -1,8 +1,9 @@
#This file is part of Tryton. The COPYRIGHT file at the top level of
#this repository contains the full copyright notices and license terms.
import copy
from trytond.model import ModelView, ModelSQL, fields
from trytond.pyson import Eval
import copy
from trytond.transaction import Transaction
class Invoice(ModelSQL, ModelView):
@@ -35,14 +36,11 @@ Invoice()
class InvoiceLine(ModelSQL, ModelView):
_name = 'account.invoice.line'
def _view_look_dom_arch(self, cursor, user, tree, type, context=None):
if context is None:
context = {}
if type == 'form' and context.get('standalone'):
def _view_look_dom_arch(self, tree, type):
if type == 'form' and Transaction().context.get('standalone'):
tree_root = tree.getroottree().getroot()
if tree_root.get('cursor') == 'product':
tree_root.set('cursor', 'party')
return super(InvoiceLine, self)._view_look_dom_arch(cursor, user, tree,
type, context=context)
return super(InvoiceLine, self)._view_look_dom_arch(tree, type)
InvoiceLine()