Re: [tryton-dev] After upgrade "Method" not callable

2018-06-28 Thread 'Hendrik Brandes' via tryton-dev
Am Montag, 25. Juni 2018 09:40:05 UTC+2 schrieb Cédric Krier:
> On 2018-06-25 00:10, 'Hendrik Brandes' via tryton-dev wrote:
> > Am Samstag, 23. Juni 2018 23:55:05 UTC+2 schrieb Cédric Krier:
> > > On 2018-06-23 09:31, 'Hendrik Brandes' via tryton-dev wrote:
> > > > I tried to migrate an existing tryton installation and get the 
> > > > following error:
> > > > 
> > > > AssertionError: .margin not callable
> > > 
> > > What is the traceback?
> > 
> > I started the trytond-admin command with parameter --all and finally got 
> > the following traceback:
> > 
> > Traceback (most recent call last):
> >   File "/opt/projekte/git/tryton2018/EBBTryton2018/bin/trytond-admin", line 
> > 21, in 
> > admin.run(options)
> >   File "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/admin.py", line 
> > 54, in run
> > activatedeps=options.activatedeps)
> >   File "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/pool.py", line 
> > 162, in init
> > lang=lang, activatedeps=activatedeps)
> >   File 
> > "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/__init__.py", 
> > line 406, in load_modules
> > _load_modules(update)
> >   File 
> > "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/__init__.py", 
> > line 376, in _load_modules
> > load_module_graph(graph, pool, update, lang)
> >   File 
> > "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/__init__.py", 
> > line 165, in load_module_graph
> > pool.setup(classes)
> >   File "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/pool.py", line 
> > 236, in setup
> > cls.__setup__()
> >   File 
> > "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/sale_margin/sale.py",
> >  line 109, in __setup__
> > super(SaleLine, cls).__setup__()
> >   File 
> > "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/sale_price_list/sale.py",
> >  line 49, in __setup__
> > super(SaleLine, cls).__setup__()
> >   File 
> > "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/sale_discount/sale.py",
> >  line 56, in __setup__
> > super(SaleLine, cls).__setup__()
> >   File 
> > "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/sale/sale.py", 
> > line 1120, in __setup__
> > super(SaleLine, cls).__setup__()
> >   File "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/model/order.py", 
> > line 15, in __setup__
> > super(SequenceOrderedMixin, cls).__setup__()
> >   File 
> > "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/model/modelsql.py", 
> > line 164, in __setup__
> > super(ModelSQL, cls).__setup__()
> >   File 
> > "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/model/modelstorage.py", 
> > line 59, in __setup__
> > super(ModelStorage, cls).__setup__()
> >   File 
> > "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/model/modelview.py", 
> > line 194, in __setup__
> > setup_field(name, field, attribute)
> >   File 
> > "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/model/modelview.py", 
> > line 175, in setup_field
> > "%s.%s not callable" % (cls, meth_name)
> > AssertionError: .margin not callable
> 
> 
> This looks like you have defined 'margin' in the methods argument of
> fields.depends. Something like: @fields.depends(methods=['margin'])
> But margin is a field not a method, so it should be:
> @fields.depends('margin')

Thank you! That did it, I looked inside the margin-field declaration, but it 
was in another field, which had this declaration inside. 

> 
> -- 
> Cédric Krier - B2CK SPRL
> Email/Jabber: cedric.kr...@b2ck.com
> Tel: +32 472 54 46 59
> Website: http://www.b2ck.com/

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/75af6140-3c3e-4c75-8b32-b52d8de3dfe7%40googlegroups.com.


Re: [tryton-dev] After upgrade "Method" not callable

2018-06-25 Thread Cédric Krier
On 2018-06-25 00:10, 'Hendrik Brandes' via tryton-dev wrote:
> Am Samstag, 23. Juni 2018 23:55:05 UTC+2 schrieb Cédric Krier:
> > On 2018-06-23 09:31, 'Hendrik Brandes' via tryton-dev wrote:
> > > I tried to migrate an existing tryton installation and get the following 
> > > error:
> > > 
> > > AssertionError: .margin not callable
> > 
> > What is the traceback?
> 
> I started the trytond-admin command with parameter --all and finally got the 
> following traceback:
> 
> Traceback (most recent call last):
>   File "/opt/projekte/git/tryton2018/EBBTryton2018/bin/trytond-admin", line 
> 21, in 
> admin.run(options)
>   File "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/admin.py", line 
> 54, in run
> activatedeps=options.activatedeps)
>   File "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/pool.py", line 
> 162, in init
> lang=lang, activatedeps=activatedeps)
>   File 
> "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/__init__.py", 
> line 406, in load_modules
> _load_modules(update)
>   File 
> "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/__init__.py", 
> line 376, in _load_modules
> load_module_graph(graph, pool, update, lang)
>   File 
> "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/__init__.py", 
> line 165, in load_module_graph
> pool.setup(classes)
>   File "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/pool.py", line 
> 236, in setup
> cls.__setup__()
>   File 
> "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/sale_margin/sale.py",
>  line 109, in __setup__
> super(SaleLine, cls).__setup__()
>   File 
> "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/sale_price_list/sale.py",
>  line 49, in __setup__
> super(SaleLine, cls).__setup__()
>   File 
> "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/sale_discount/sale.py",
>  line 56, in __setup__
> super(SaleLine, cls).__setup__()
>   File 
> "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/sale/sale.py", 
> line 1120, in __setup__
> super(SaleLine, cls).__setup__()
>   File "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/model/order.py", 
> line 15, in __setup__
> super(SequenceOrderedMixin, cls).__setup__()
>   File 
> "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/model/modelsql.py", line 
> 164, in __setup__
> super(ModelSQL, cls).__setup__()
>   File 
> "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/model/modelstorage.py", 
> line 59, in __setup__
> super(ModelStorage, cls).__setup__()
>   File 
> "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/model/modelview.py", line 
> 194, in __setup__
> setup_field(name, field, attribute)
>   File 
> "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/model/modelview.py", line 
> 175, in setup_field
> "%s.%s not callable" % (cls, meth_name)
> AssertionError: .margin not callable


This looks like you have defined 'margin' in the methods argument of
fields.depends. Something like: @fields.depends(methods=['margin'])
But margin is a field not a method, so it should be:
@fields.depends('margin')

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/20180625073624.GY30646%40kei.


Re: [tryton-dev] After upgrade "Method" not callable

2018-06-25 Thread 'Hendrik Brandes' via tryton-dev
Am Samstag, 23. Juni 2018 23:55:05 UTC+2 schrieb Cédric Krier:
> On 2018-06-23 09:31, 'Hendrik Brandes' via tryton-dev wrote:
> > I tried to migrate an existing tryton installation and get the following 
> > error:
> > 
> > AssertionError: .margin not callable
> 
> What is the traceback?

I started the trytond-admin command with parameter --all and finally got the 
following traceback:

Traceback (most recent call last):
  File "/opt/projekte/git/tryton2018/EBBTryton2018/bin/trytond-admin", line 21, 
in 
admin.run(options)
  File "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/admin.py", line 54, 
in run
activatedeps=options.activatedeps)
  File "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/pool.py", line 162, 
in init
lang=lang, activatedeps=activatedeps)
  File 
"/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/__init__.py", line 
406, in load_modules
_load_modules(update)
  File 
"/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/__init__.py", line 
376, in _load_modules
load_module_graph(graph, pool, update, lang)
  File 
"/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/__init__.py", line 
165, in load_module_graph
pool.setup(classes)
  File "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/pool.py", line 236, 
in setup
cls.__setup__()
  File 
"/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/sale_margin/sale.py",
 line 109, in __setup__
super(SaleLine, cls).__setup__()
  File 
"/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/sale_price_list/sale.py",
 line 49, in __setup__
super(SaleLine, cls).__setup__()
  File 
"/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/sale_discount/sale.py",
 line 56, in __setup__
super(SaleLine, cls).__setup__()
  File 
"/opt/projekte/git/tryton2018/EBBTryton2018/trytond/modules/sale/sale.py", line 
1120, in __setup__
super(SaleLine, cls).__setup__()
  File "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/model/order.py", 
line 15, in __setup__
super(SequenceOrderedMixin, cls).__setup__()
  File "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/model/modelsql.py", 
line 164, in __setup__
super(ModelSQL, cls).__setup__()
  File 
"/opt/projekte/git/tryton2018/EBBTryton2018/trytond/model/modelstorage.py", 
line 59, in __setup__
super(ModelStorage, cls).__setup__()
  File "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/model/modelview.py", 
line 194, in __setup__
setup_field(name, field, attribute)
  File "/opt/projekte/git/tryton2018/EBBTryton2018/trytond/model/modelview.py", 
line 175, in setup_field
"%s.%s not callable" % (cls, meth_name)
AssertionError: .margin not callable



> 
> -- 
> Cédric Krier - B2CK SPRL
> Email/Jabber: cedric.kr...@b2ck.com
> Tel: +32 472 54 46 59
> Website: http://www.b2ck.com/

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/29f80434-c1f0-4bd9-9583-f7bf9630c694%40googlegroups.com.


Re: [tryton-dev] After upgrade "Method" not callable

2018-06-23 Thread Cédric Krier
On 2018-06-23 09:31, 'Hendrik Brandes' via tryton-dev wrote:
> I tried to migrate an existing tryton installation and get the following 
> error:
> 
> AssertionError: .margin not callable

What is the traceback?

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: cedric.kr...@b2ck.com
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/20180623215343.GV30646%40kei.


[tryton-dev] After upgrade "Method" not callable

2018-06-23 Thread 'Hendrik Brandes' via tryton-dev
Hello,

I tried to migrate an existing tryton installation and get the following error:

AssertionError: .margin not callable

The definition of the field looks like this:

margin = fields.Function(fields.Numeric('Margin',
digits=(16, Eval('_parent_sale', {}).get('currency_digits', 2)),
states={
'invisible': ~Eval('type').in_(['line', 'subtotal']),
'readonly': ~Eval('_parent_sale'),
},
depends=['type', 'amount']),
'on_change_with_margin')

and for the implementation:

@fields.depends('type',  'amount', 'quantity', 'cost_price', 
'_parent_sale.currency',
'_parent_sale.lines')
def on_change_with_margin(self):
'''
Return the margin of each sale lines
'''
...

I thought, that it is enough, to declare all fields, which are used within the 
method.

Actual, I have read the documentation and saw, that the dependency of fields 
has been introduced, but I cannot understand, what is missing concretely in 
this case.

Thank you and best regards,
Hendrik Brandes

-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/6bb94289-7a1a-496a-acf1-2e605ad01fc5%40googlegroups.com.