Re: [tryton] Proteus success

2018-02-11 Thread Cato Nano
ok, I was failing to build the project before running the tests

I'm sorry for bothering :-/

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/8ffc692a-cb99-4af1-8213-f0f17fabd394%40googlegroups.com.


Re: [tryton] Proteus success

2018-02-11 Thread Cato Nano
I tried on a different computer, in a different environment and I get a 
different result:

Ran 266 tests in 55.654s

OK (skipped=6)


!!

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/121e63fc-de2f-451d-9b6e-29156c2bacc0%40googlegroups.com.


Re: [tryton] Proteus success

2018-02-11 Thread Cato Nano
Il giorno venerdì 2 febbraio 2018 10:19:18 UTC+1, Sergi Almacellas Abellana ha 
scritto:
> El 02/02/18 a les 08:39, Cato Nano ha escrit:
> > That' s my total !!
> > 
> > This is a way saner cycle than creating the xml for the fields, then 
> > logging in the client, open all the windows to reach the new field !!
> We normally use proteus to create doctest scenarios that ensure the
> module behaves as expected. Have a look at the docs:
> 
> http://doc.tryton.org/4.6/trytond/doc/topics/testing.html

I tried to add some tests but they don' t get run

In fact I added a test that should fail but when I run the tests they all pass 
:-/

Here
https://gitlab.com/humanitiesNerd/tributi/blob/master/tests/scenario_affissioni.rst#L66


The correct value should be
datetime.date(2019, 10, 16)

but instead I wrote 
datetime.date(2019, 10, 17)

just to see a test fail

It doesn' t

it always run 13 tests

This is what i get

(env) [catonano@localhost tributi] $ ./run-tests.py -m tributi -v
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/modules/__init__.py:143:
 DeprecationWarning: This method will be removed in future versions.  Use 
'parser.read_file()' instead.
  module_config.readfp(fp)
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/modules/__init__.py:143:
 DeprecationWarning: This method will be removed in future versions.  Use 
'parser.read_file()' instead.
  module_config.readfp(fp)
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:281:
 UserWarning: Unable to remove not null with SQLite backend
  warnings.warn('Unable to remove not null with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:245:
 UserWarning: Unable to drop foreign key with SQLite backend
  warnings.warn('Unable to drop foreign key with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:289:
 UserWarning: Unable to drop constraint with SQLite backend
  warnings.warn('Unable to drop constraint with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:176:
 UserWarning: Unable to set default on column with SQLite backend
  warnings.warn('Unable to set default on column with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:279:
 UserWarning: Unable to set not null with SQLite backend
  warnings.warn('Unable to set not null with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:286:
 UserWarning: Unable to add constraint with SQLite backend
  warnings.warn('Unable to add constraint with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/table.py:242:
 UserWarning: Unable to add foreign key with SQLite backend
  warnings.warn('Unable to add foreign key with SQLite backend')
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/model/fields/function.py:100:
 DeprecationWarning: inspect.getargspec() is deprecated, use 
inspect.signature() or inspect.getfullargspec()
  if 'names' in inspect.getargspec(method)[0]:
.
--
Ran 13 tests in 8.592s

OK
(env) [catonano@localhost tributi] $ 


I' m using this file, I just copied it from the Trytond repository
https://gitlab.com/humanitiesNerd/tributi/blob/master/run-tests.py


-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/00502566-a198-433a-8c38-a014e84e24e1%40googlegroups.com.


Re: [tryton] Proteus success

2018-02-02 Thread Sergi Almacellas Abellana
El 02/02/18 a les 08:39, Cato Nano ha escrit:
> That' s my total !!
> 
> This is a way saner cycle than creating the xml for the fields, then logging 
> in the client, open all the windows to reach the new field !!
We normally use proteus to create doctest scenarios that ensure the
module behaves as expected. Have a look at the docs:

http://doc.tryton.org/4.6/trytond/doc/topics/testing.html


-- 
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/a467b4f8-03da-d093-8455-efd99abcc3af%40koolpi.com.


Re: [tryton] Proteus

2018-01-21 Thread Cato Nano
Il giorno giovedì 18 gennaio 2018 09:51:51 UTC+1, Cato Nano ha scritto:
> Il giorno sabato 13 gennaio 2018 10:00:08 UTC+1, Cédric Krier ha scritto:
> > On 2018-01-12 23:16, Cato Nano wrote:
> > > Today the error message is different. Yesterday I probably messed up 
> > > because I was tired, it happens
> > > 
> > > So here I am now
> > > 
> > > >>> from proteus import config, Model, Wizard, Report 
> > > >>> config = config.set_trytond('sqlite:///:memory:') 
> > > /home/catonano/tributi/env/lib/python3.6/site-packages/trytond/modules/__init__.py:143:
> > >  DeprecationWarning: This method will be removed in future versions.  Use 
> > > 'parser.read_file()' instead.
> > >   module_config.readfp(fp)
> > > Traceback (most recent call last):
> > >   File "", line 1, in 
> > >   File 
> > > "/home/catonano/tributi/env/lib/python3.6/site-packages/proteus/config.py",
> > >  line 274, in set_trytond
> > > _CONFIG.current = TrytondConfig(database, user, 
> > > config_file=config_file)
> > >   File 
> > > "/home/catonano/tributi/env/lib/python3.6/site-packages/proteus/config.py",
> > >  line 228, in __init__
> > > self.pool.init()
> > >   File 
> > > "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/pool.py", 
> > > line 153, in init
> > > lang=lang, installdeps=installdeps)
> > >   File 
> > > "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/modules/__init__.py",
> > >  line 461, in load_modules
> > > with Transaction().start(database_name, 0):
> > >   File 
> > > "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/transaction.py",
> > >  line 106, in start
> > > Cache.clean(database.name)
> > >   File 
> > > "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/cache.py",
> > >  line 111, in clean
> > > cursor.execute(*table.select(table.timestamp, table.name))
> > > sqlite3.OperationalError: no such table: ir_cache
> > 
> > Now you are connecting to a database that was not setup:
> > http://doc.tryton.org/4.6/trytond/doc/topics/setup_database.html#topics-setup-database
> > 
> > For memory database, you can use create_db from
> > trytond.tests.test_tryton like it is done for the test.
> > Indeed the README is not useful: https://bugs.tryton.org/issue7056
> > 
> > -- 
> > Cédric Krier - B2CK SPRL
> > Email/Jabber: cedric.kr...@b2ck.com
> > Tel: +32 472 54 46 59
> > Website: http://www.b2ck.com/
> 
> I copied the test_tryton file in my project root, erased some stuff and left 
> the create_db function
> 
> I get this
> 
> ~/tributi/bridgehead2.py in create_db(name, lang)
>  51 None, 0, close=True, autocommit=True, _nocache=True) \
>  52 as transaction:
> ---> 53 transaction.database.create(transaction.connection, name)
>  54 
>  55 with Transaction().start(name, 0, _nocache=True) as 
> transaction,\
> 
> ~/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/database.py 
> in create(cls, connection, database_name)
> 300 path = os.path.join(config.get('database', 'path'),
> 301 database_name + '.sqlite')
> --> 302 with sqlite.connect(path) as conn:
> 303 cursor = conn.cursor()
> 304 cursor.close()
> 
> OperationalError: unable to open database file
> 
> 
> I could use soem help about how to setup this db
> 
> Thanks

ok I managed to get Proteus working

I figured out the passages of configuring and creating the database finally

Proteus is helping me less than I thought, though

Probably because I' d need more data to test properly

I' ll open a new thread 

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/b83a340c-da00-4cf4-88f1-c798ff2fb9f6%40googlegroups.com.


Re: [tryton] Proteus

2018-01-18 Thread Cato Nano
Il giorno sabato 13 gennaio 2018 10:00:08 UTC+1, Cédric Krier ha scritto:
> On 2018-01-12 23:16, Cato Nano wrote:
> > Today the error message is different. Yesterday I probably messed up 
> > because I was tired, it happens
> > 
> > So here I am now
> > 
> > >>> from proteus import config, Model, Wizard, Report 
> > >>> config = config.set_trytond('sqlite:///:memory:') 
> > /home/catonano/tributi/env/lib/python3.6/site-packages/trytond/modules/__init__.py:143:
> >  DeprecationWarning: This method will be removed in future versions.  Use 
> > 'parser.read_file()' instead.
> >   module_config.readfp(fp)
> > Traceback (most recent call last):
> >   File "", line 1, in 
> >   File 
> > "/home/catonano/tributi/env/lib/python3.6/site-packages/proteus/config.py", 
> > line 274, in set_trytond
> > _CONFIG.current = TrytondConfig(database, user, config_file=config_file)
> >   File 
> > "/home/catonano/tributi/env/lib/python3.6/site-packages/proteus/config.py", 
> > line 228, in __init__
> > self.pool.init()
> >   File 
> > "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/pool.py", 
> > line 153, in init
> > lang=lang, installdeps=installdeps)
> >   File 
> > "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/modules/__init__.py",
> >  line 461, in load_modules
> > with Transaction().start(database_name, 0):
> >   File 
> > "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/transaction.py",
> >  line 106, in start
> > Cache.clean(database.name)
> >   File 
> > "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/cache.py", 
> > line 111, in clean
> > cursor.execute(*table.select(table.timestamp, table.name))
> > sqlite3.OperationalError: no such table: ir_cache
> 
> Now you are connecting to a database that was not setup:
> http://doc.tryton.org/4.6/trytond/doc/topics/setup_database.html#topics-setup-database
> 
> For memory database, you can use create_db from
> trytond.tests.test_tryton like it is done for the test.
> Indeed the README is not useful: https://bugs.tryton.org/issue7056
> 
> -- 
> Cédric Krier - B2CK SPRL
> Email/Jabber: cedric.kr...@b2ck.com
> Tel: +32 472 54 46 59
> Website: http://www.b2ck.com/

I copied the test_tryton file in my project root, erased some stuff and left 
the create_db function

I get this

~/tributi/bridgehead2.py in create_db(name, lang)
 51 None, 0, close=True, autocommit=True, _nocache=True) \
 52 as transaction:
---> 53 transaction.database.create(transaction.connection, name)
 54 
 55 with Transaction().start(name, 0, _nocache=True) as 
transaction,\

~/tributi/env/lib/python3.6/site-packages/trytond/backend/sqlite/database.py in 
create(cls, connection, database_name)
300 path = os.path.join(config.get('database', 'path'),
301 database_name + '.sqlite')
--> 302 with sqlite.connect(path) as conn:
303 cursor = conn.cursor()
304 cursor.close()

OperationalError: unable to open database file


I could use soem help about how to setup this db

Thanks

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/0bcdcd5a-11dd-4b60-a1a6-c618265cbec5%40googlegroups.com.


Re: [tryton] Proteus

2018-01-13 Thread Cédric Krier
On 2018-01-12 23:16, Cato Nano wrote:
> Today the error message is different. Yesterday I probably messed up because 
> I was tired, it happens
> 
> So here I am now
> 
> >>> from proteus import config, Model, Wizard, Report 
> >>> config = config.set_trytond('sqlite:///:memory:') 
> /home/catonano/tributi/env/lib/python3.6/site-packages/trytond/modules/__init__.py:143:
>  DeprecationWarning: This method will be removed in future versions.  Use 
> 'parser.read_file()' instead.
>   module_config.readfp(fp)
> Traceback (most recent call last):
>   File "", line 1, in 
>   File 
> "/home/catonano/tributi/env/lib/python3.6/site-packages/proteus/config.py", 
> line 274, in set_trytond
> _CONFIG.current = TrytondConfig(database, user, config_file=config_file)
>   File 
> "/home/catonano/tributi/env/lib/python3.6/site-packages/proteus/config.py", 
> line 228, in __init__
> self.pool.init()
>   File 
> "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/pool.py", 
> line 153, in init
> lang=lang, installdeps=installdeps)
>   File 
> "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/modules/__init__.py",
>  line 461, in load_modules
> with Transaction().start(database_name, 0):
>   File 
> "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/transaction.py",
>  line 106, in start
> Cache.clean(database.name)
>   File 
> "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/cache.py", 
> line 111, in clean
> cursor.execute(*table.select(table.timestamp, table.name))
> sqlite3.OperationalError: no such table: ir_cache

Now you are connecting to a database that was not setup:
http://doc.tryton.org/4.6/trytond/doc/topics/setup_database.html#topics-setup-database

For memory database, you can use create_db from
trytond.tests.test_tryton like it is done for the test.
Indeed the README is not useful: https://bugs.tryton.org/issue7056

-- 
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" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/20180113085900.GF4227%40kei.


Re: [tryton] Proteus

2018-01-12 Thread Cato Nano
Il giorno venerdì 12 gennaio 2018 23:15:07 UTC+1, Cédric Krier ha scritto:
> On 2018-01-12 11:28, Cato Nano wrote:
> > Il giorno venerdì 12 gennaio 2018 19:10:06 UTC+1, Cédric Krier ha scritto:
> > > On 2018-01-12 09:35, Cato Nano wrote:
> > > > Ok, now I' m at this (The database ":memory:" does not exist)
> > > > 
> > > > This is the pip3 based setup. Which component is missing ?
> > > > 
> > > > >>> config = config.set_trytond('sqlite:///:memory:')
> > > > Traceback (most recent call last):
> > > >   File "", line 1, in 
> > > >   File 
> > > > "/home/catonano/tributi/env/lib/python3.6/site-packages/proteus/config.py",
> > > >  line 274, in set_trytond
> > > > _CONFIG.current = TrytondConfig(database, user, 
> > > > config_file=config_file)
> > > >   File 
> > > > "/home/catonano/tributi/env/lib/python3.6/site-packages/proteus/config.py",
> > > >  line 230, in __init__
> > > > with Transaction().start(self.database_name, 0) as transaction:
> > > >   File 
> > > > "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/transaction.py",
> > > >  line 88, in start
> > > > database = Database(database_name).connect()
> > > >   File 
> > > > "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/postgresql/database.py",
> > > >  line 96, in __new__
> > > > cursor_factory=LoggingCursor)
> > > >   File 
> > > > "/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/pool.py",
> > > >  line 161, in __init__
> > > > self, minconn, maxconn, *args, **kwargs)
> > > >   File 
> > > > "/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/pool.py",
> > > >  line 58, in __init__
> > > > self._connect()
> > > >   File 
> > > > "/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/pool.py",
> > > >  line 62, in _connect
> > > > conn = psycopg2.connect(*self._args, **self._kwargs)
> > > >   File 
> > > > "/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/__init__.py",
> > > >  line 130, in connect
> > > > conn = _connect(dsn, connection_factory=connection_factory, 
> > > > **kwasync)
> > > > psycopg2.OperationalError: FATALE:  il database ":memory:" non esiste
> > > 
> > > You seem to have already imported trytond before running the
> > > 'set_trytond' so the previous import setup PostgreSQL as database
> > > backend which does not have ':memory:' database.
> > > Tryton can not change the backend during the run time, so it must be
> > > set once at the beginning and not change during the execution.
> > 
> > Thank you Cédric, I'll try tomorrow. 
> > 
> > I tried these lines, in this order
> > 
> > >>> from proteus import config, Model, Wizard, Report
> > >>> config = config.set_trytond('sqlite:///:memory:')
> > 
> > because this is what I saw here
> > 
> > https://github.com/tryton/proteus
> > 
> > So I understand that I should run 
> > 
> > >>> config = config.set_trytond('sqlite:///:memory:')
> > 
> > as a first step ? 
> 
> No this is correct. So maybe you have TRYTOND_CONFIG environment
> variable set to a configuration file that configure postgresql as
> backend.
> 
> -- 
> Cédric Krier - B2CK SPRL
> Email/Jabber: cedric.kr...@b2ck.com
> Tel: +32 472 54 46 59
> Website: http://www.b2ck.com/

Good morning

Today the error message is different. Yesterday I probably messed up because I 
was tired, it happens

So here I am now

>>> from proteus import config, Model, Wizard, Report 
>>> config = config.set_trytond('sqlite:///:memory:') 
/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/modules/__init__.py:143:
 DeprecationWarning: This method will be removed in future versions.  Use 
'parser.read_file()' instead.
  module_config.readfp(fp)
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/home/catonano/tributi/env/lib/python3.6/site-packages/proteus/config.py", 
line 274, in set_trytond
_CONFIG.current = TrytondConfig(database, user, config_file=config_file)
  File 
"/home/catonano/tributi/env/lib/python3.6/site-packages/proteus/config.py", 
line 228, in __init__
self.pool.init()
  File 
"/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/pool.py", line 
153, in init
lang=lang, installdeps=installdeps)
  File 
"/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/modules/__init__.py",
 line 461, in load_modules
with Transaction().start(database_name, 0):
  File 
"/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/transaction.py",
 line 106, in start
Cache.clean(database.name)
  File 
"/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/cache.py", line 
111, in clean
cursor.execute(*table.select(table.timestamp, table.name))
sqlite3.OperationalError: no such table: ir_cache
>>> 

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/1d89afac-b2e9-4ae0-8b85-1b3ed0f7969f%40googlegroups.com.


Re: [tryton] Proteus

2018-01-12 Thread Mathias Behrle
* Cato Nano: " Re: [tryton] Proteus" (Fri, 12 Jan 2018 11:23:19 -0800 (PST)):

> So I bothered Mathias
> 
> Oh well :-/

Not a problem, be welcome.

Have fun,
Mathias

-- 

Mathias Behrle
MBSolutions
Gilgenmatten 10 A
D-79114 Freiburg

Tel: +49(761)471023
Fax: +49(761)4770816
http://www.m9s.biz
UStIdNr: DE 142009020
PGP/GnuPG key availabable from any keyserver, ID: 0xD6D09BE48405BBF6
AC29 7E5C 46B9 D0B6 1C71  7681 D6D0 9BE4 8405 BBF6

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/20180113011252.4bf0d7d7%40privatix.mbehrle.de.


pgpPMh9FNIHlP.pgp
Description: Digitale Signatur von OpenPGP


Re: [tryton] Proteus

2018-01-12 Thread Cédric Krier
On 2018-01-12 11:28, Cato Nano wrote:
> Il giorno venerdì 12 gennaio 2018 19:10:06 UTC+1, Cédric Krier ha scritto:
> > On 2018-01-12 09:35, Cato Nano wrote:
> > > Ok, now I' m at this (The database ":memory:" does not exist)
> > > 
> > > This is the pip3 based setup. Which component is missing ?
> > > 
> > > >>> config = config.set_trytond('sqlite:///:memory:')
> > > Traceback (most recent call last):
> > >   File "", line 1, in 
> > >   File 
> > > "/home/catonano/tributi/env/lib/python3.6/site-packages/proteus/config.py",
> > >  line 274, in set_trytond
> > > _CONFIG.current = TrytondConfig(database, user, 
> > > config_file=config_file)
> > >   File 
> > > "/home/catonano/tributi/env/lib/python3.6/site-packages/proteus/config.py",
> > >  line 230, in __init__
> > > with Transaction().start(self.database_name, 0) as transaction:
> > >   File 
> > > "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/transaction.py",
> > >  line 88, in start
> > > database = Database(database_name).connect()
> > >   File 
> > > "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/postgresql/database.py",
> > >  line 96, in __new__
> > > cursor_factory=LoggingCursor)
> > >   File 
> > > "/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/pool.py",
> > >  line 161, in __init__
> > > self, minconn, maxconn, *args, **kwargs)
> > >   File 
> > > "/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/pool.py",
> > >  line 58, in __init__
> > > self._connect()
> > >   File 
> > > "/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/pool.py",
> > >  line 62, in _connect
> > > conn = psycopg2.connect(*self._args, **self._kwargs)
> > >   File 
> > > "/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/__init__.py",
> > >  line 130, in connect
> > > conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
> > > psycopg2.OperationalError: FATALE:  il database ":memory:" non esiste
> > 
> > You seem to have already imported trytond before running the
> > 'set_trytond' so the previous import setup PostgreSQL as database
> > backend which does not have ':memory:' database.
> > Tryton can not change the backend during the run time, so it must be
> > set once at the beginning and not change during the execution.
> 
> Thank you Cédric, I'll try tomorrow. 
> 
> I tried these lines, in this order
> 
> >>> from proteus import config, Model, Wizard, Report
> >>> config = config.set_trytond('sqlite:///:memory:')
> 
> because this is what I saw here
> 
> https://github.com/tryton/proteus
> 
> So I understand that I should run 
> 
> >>> config = config.set_trytond('sqlite:///:memory:')
> 
> as a first step ? 

No this is correct. So maybe you have TRYTOND_CONFIG environment
variable set to a configuration file that configure postgresql as
backend.

-- 
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" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/20180112221125.GC4227%40kei.


Re: [tryton] Proteus

2018-01-12 Thread Cato Nano
Il giorno venerdì 12 gennaio 2018 19:10:06 UTC+1, Cédric Krier ha scritto:
> On 2018-01-12 09:35, Cato Nano wrote:
> > Ok, now I' m at this (The database ":memory:" does not exist)
> > 
> > This is the pip3 based setup. Which component is missing ?
> > 
> > >>> config = config.set_trytond('sqlite:///:memory:')
> > Traceback (most recent call last):
> >   File "", line 1, in 
> >   File 
> > "/home/catonano/tributi/env/lib/python3.6/site-packages/proteus/config.py", 
> > line 274, in set_trytond
> > _CONFIG.current = TrytondConfig(database, user, config_file=config_file)
> >   File 
> > "/home/catonano/tributi/env/lib/python3.6/site-packages/proteus/config.py", 
> > line 230, in __init__
> > with Transaction().start(self.database_name, 0) as transaction:
> >   File 
> > "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/transaction.py",
> >  line 88, in start
> > database = Database(database_name).connect()
> >   File 
> > "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/postgresql/database.py",
> >  line 96, in __new__
> > cursor_factory=LoggingCursor)
> >   File 
> > "/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/pool.py", 
> > line 161, in __init__
> > self, minconn, maxconn, *args, **kwargs)
> >   File 
> > "/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/pool.py", 
> > line 58, in __init__
> > self._connect()
> >   File 
> > "/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/pool.py", 
> > line 62, in _connect
> > conn = psycopg2.connect(*self._args, **self._kwargs)
> >   File 
> > "/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/__init__.py",
> >  line 130, in connect
> > conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
> > psycopg2.OperationalError: FATALE:  il database ":memory:" non esiste
> 
> You seem to have already imported trytond before running the
> 'set_trytond' so the previous import setup PostgreSQL as database
> backend which does not have ':memory:' database.
> Tryton can not change the backend during the run time, so it must be
> set once at the beginning and not change during the execution.

Thank you Cédric, I'll try tomorrow. 

I tried these lines, in this order

>>> from proteus import config, Model, Wizard, Report
>>> config = config.set_trytond('sqlite:///:memory:')

because this is what I saw here

https://github.com/tryton/proteus

So I understand that I should run 

>>> config = config.set_trytond('sqlite:///:memory:')

as a first step ? 
I'll try

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/042f2fd3-fdfe-40a9-9ade-5ed837fcfa68%40googlegroups.com.


Re: [tryton] Proteus

2018-01-12 Thread Cato Nano
> Another good example why you should never mess up an installation from 
> distribution with an installation from source.

Right

I had downloaded Proteus because I was _consideing_ to try to build and install 
it myself
But I never embarked in such a process. I never began

I just decomprrressed the tar.gz file there

I didn't expect that to interfere with the Debian supplied Proteus.

Rather, I'd say, because I was torred I overlooked the error message that was 
explicitly pointing to that decompressed folder, instead of a system provided 
one

So I bothered Mathias

Oh well :-/

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/ed7fe6d8-ce47-4688-acba-a9f1e6ed9d66%40googlegroups.com.


Re: [tryton] Proteus

2018-01-12 Thread Cédric Krier
On 2018-01-12 09:35, Cato Nano wrote:
> Ok, now I' m at this (The database ":memory:" does not exist)
> 
> This is the pip3 based setup. Which component is missing ?
> 
> >>> config = config.set_trytond('sqlite:///:memory:')
> Traceback (most recent call last):
>   File "", line 1, in 
>   File 
> "/home/catonano/tributi/env/lib/python3.6/site-packages/proteus/config.py", 
> line 274, in set_trytond
> _CONFIG.current = TrytondConfig(database, user, config_file=config_file)
>   File 
> "/home/catonano/tributi/env/lib/python3.6/site-packages/proteus/config.py", 
> line 230, in __init__
> with Transaction().start(self.database_name, 0) as transaction:
>   File 
> "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/transaction.py",
>  line 88, in start
> database = Database(database_name).connect()
>   File 
> "/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/postgresql/database.py",
>  line 96, in __new__
> cursor_factory=LoggingCursor)
>   File 
> "/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/pool.py", 
> line 161, in __init__
> self, minconn, maxconn, *args, **kwargs)
>   File 
> "/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/pool.py", 
> line 58, in __init__
> self._connect()
>   File 
> "/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/pool.py", 
> line 62, in _connect
> conn = psycopg2.connect(*self._args, **self._kwargs)
>   File 
> "/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/__init__.py",
>  line 130, in connect
> conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
> psycopg2.OperationalError: FATALE:  il database ":memory:" non esiste

You seem to have already imported trytond before running the
'set_trytond' so the previous import setup PostgreSQL as database
backend which does not have ':memory:' database.
Tryton can not change the backend during the run time, so it must be
set once at the beginning and not change during the execution.

-- 
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" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/20180112180747.GA4227%40kei.


Re: [tryton] Proteus

2018-01-12 Thread Axel Braun
Am Freitag, 12. Januar 2018, 18:35:21 CET schrieb Cato Nano:
> Ok, now I' m at this (The database ":memory:" does not exist)

What does
psql -l
say?

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


Re: [tryton] Proteus

2018-01-12 Thread Cato Nano
Ok, now I' m at this (The database ":memory:" does not exist)

This is the pip3 based setup. Which component is missing ?

>>> config = config.set_trytond('sqlite:///:memory:')
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/home/catonano/tributi/env/lib/python3.6/site-packages/proteus/config.py", 
line 274, in set_trytond
_CONFIG.current = TrytondConfig(database, user, config_file=config_file)
  File 
"/home/catonano/tributi/env/lib/python3.6/site-packages/proteus/config.py", 
line 230, in __init__
with Transaction().start(self.database_name, 0) as transaction:
  File 
"/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/transaction.py",
 line 88, in start
database = Database(database_name).connect()
  File 
"/home/catonano/tributi/env/lib/python3.6/site-packages/trytond/backend/postgresql/database.py",
 line 96, in __new__
cursor_factory=LoggingCursor)
  File 
"/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/pool.py", line 
161, in __init__
self, minconn, maxconn, *args, **kwargs)
  File 
"/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/pool.py", line 
58, in __init__
self._connect()
  File 
"/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/pool.py", line 
62, in _connect
conn = psycopg2.connect(*self._args, **self._kwargs)
  File 
"/home/catonano/tributi/env/lib/python3.6/site-packages/psycopg2/__init__.py", 
line 130, in connect
conn = _connect(dsn, connection_factory=connection_factory, **kwasync)
psycopg2.OperationalError: FATALE:  il database ":memory:" non esiste


-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/5802d634-f588-48c1-bbaa-f99035636acd%40googlegroups.com.


Re: [tryton] Proteus

2018-01-12 Thread Axel Braun
Am Freitag, 12. Januar 2018, 18:29:26 CET schrieb Cato Nano:
> Il giorno giovedì 11 gennaio 2018 15:00:06 UTC+1, Cédric Krier ha scritto:
> > On 2018-01-11 13:38, Mathias Behrle wrote:
> > > * Cédric Krier: " Re: [tryton] Proteus" (Thu, 11 Jan 2018 01:07:32 
+0100):
> > > > On 2018-01-10 11:52, Cato Nano wrote:
> > > > > When called from within a python3 prompt, Proteus gets found
> > > > > 
> > > > > But this time xmlrpclib is missing
> > > > > 
> > > > > Also, xmlrpclib is not declared as a dependency in the Proteus
> > > > > setup.py
> > > > > file
> > > > 
> > > > xmlrpclib is a standard library of Python so it should not be declared
> > > > as dependency.
> > > > But indeed xmlrpclib is the name for Python2, in Python3 it should be
> > > > xmlrpc.
> > > > Normally, when installing proteus with Python3, the code is
> > > > transformed
> > > > and xmlrpclib is changed for xmlrpc. So it seems the installation is
> > > > wrong. I guess it should be reported to the distribution you are
> > > > using.
> > > 
> > > Wrong guess.
> > > 
> > > JFTR: It was explained on the Debian mailing list to Cato Nano that he
> > > has to take care himself for 2to3 conversion when not using
> > > distribution packages and running instead from a downloaded package.
> > 
> > I do not see where it is a wrong guess. In previous email, Cato Nano
> > said: "Of course Proteus is installed with apt-get".
> 
> There was a local Proteus interfering with the Debian one

Another good example why you should never mess up an installation from 
distribution with an installation from source.

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


Re: [tryton] Proteus

2018-01-12 Thread Cato Nano
Il giorno giovedì 11 gennaio 2018 15:00:06 UTC+1, Cédric Krier ha scritto:
> On 2018-01-11 13:38, Mathias Behrle wrote:
> > * Cédric Krier: " Re: [tryton] Proteus" (Thu, 11 Jan 2018 01:07:32 +0100):
> > 
> > > On 2018-01-10 11:52, Cato Nano wrote:
> > > > When called from within a python3 prompt, Proteus gets found
> > > > 
> > > > But this time xmlrpclib is missing
> > > > 
> > > > Also, xmlrpclib is not declared as a dependency in the Proteus setup.py
> > > > file  
> > > 
> > > xmlrpclib is a standard library of Python so it should not be declared
> > > as dependency.
> > > But indeed xmlrpclib is the name for Python2, in Python3 it should be
> > > xmlrpc.
> > > Normally, when installing proteus with Python3, the code is transformed
> > > and xmlrpclib is changed for xmlrpc. So it seems the installation is
> > > wrong. I guess it should be reported to the distribution you are using.
> > 
> > Wrong guess. 
> > 
> > JFTR: It was explained on the Debian mailing list to Cato Nano that he has 
> > to
> > take care himself for 2to3 conversion when not using distribution packages 
> > and
> > running instead from a downloaded package.
> 
> I do not see where it is a wrong guess. In previous email, Cato Nano
> said: "Of course Proteus is installed with apt-get".
> 


There was a local Proteus interfering with the Debian one

Sorry

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/56d26ba8-1a28-4c24-aff6-72191ede1513%40googlegroups.com.


Re: [tryton] Proteus

2018-01-11 Thread Cato Nano
Il giorno giovedì 11 gennaio 2018 16:41:36 UTC+1, Sergi Almacellas Abellana ha 
scritto:
> El 11/01/18 a les 16:23, Cato Nano ha escrit:
> > 
> > I think Mathis is referring to my own Tryton module
> > 
> > He saw the path to my module in the stacktrace
> > 
> > Now I' m not sure I understand
> > 
> > Can't the Debian provided Proteus be used for developing your own Tryton 
> > modules? 
> > 
> > Does it only work with Debian provided modules ?
> 
> As far as your module is importable from the debian python interpreter
> it will work without problems.
> 
> How do you installed your module?
> 
> -- 
> Sergi Almacellas Abellana
> www.koolpi.com
> Twitter: @pokoli_srk

Sergi

thank you so much for your concern

I changed solution

I installed all with viertualenv and pip

For the server pip3, python3 and for the client pip2, python2 and a virtualenv 
that can access the pygtk provided by the local operating system (pygtk doesn' 
t install plainly so the one provided by the system is preferable)

I opened a python console and imported proteus a second ago and it works like a 
charm

I had stuck to the apt provided packages because I had assumed that they were 
reliable

I was wrong (to say at least)

Starting tomorrow I' ll try to debug my calculated field

Ugh !

Thank you so much to all of you for your help
Starting tomorrow I' ll try

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/e0f69a21-83f5-42c8-9916-81716b4eba3e%40googlegroups.com.


Re: [tryton] Proteus

2018-01-11 Thread Cato Nano
Il giorno giovedì 11 gennaio 2018 15:00:06 UTC+1, Cédric Krier ha scritto:
> On 2018-01-11 13:38, Mathias Behrle wrote:
> > * Cédric Krier: " Re: [tryton] Proteus" (Thu, 11 Jan 2018 01:07:32 +0100):
> > 
> > > On 2018-01-10 11:52, Cato Nano wrote:
> > > > When called from within a python3 prompt, Proteus gets found
> > > > 
> > > > But this time xmlrpclib is missing
> > > > 
> > > > Also, xmlrpclib is not declared as a dependency in the Proteus setup.py
> > > > file  
> > > 
> > > xmlrpclib is a standard library of Python so it should not be declared
> > > as dependency.
> > > But indeed xmlrpclib is the name for Python2, in Python3 it should be
> > > xmlrpc.
> > > Normally, when installing proteus with Python3, the code is transformed
> > > and xmlrpclib is changed for xmlrpc. So it seems the installation is
> > > wrong. I guess it should be reported to the distribution you are using.
> > 
> > Wrong guess. 
> > 
> > JFTR: It was explained on the Debian mailing list to Cato Nano that he has 
> > to
> > take care himself for 2to3 conversion when not using distribution packages 
> > and
> > running instead from a downloaded package.
> 
> I do not see where it is a wrong guess. In previous email, Cato Nano
> said: "Of course Proteus is installed with apt-get".
> 
> -- 


I think Mathis is referring to my own Tryton module

He saw the path to my module in the stacktrace

Now I' m not sure I understand

Can't the Debian provided Proteus be used for developing your own Tryton 
modules? 

Does it only work with Debian provided modules ? 


-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/e97f4fab-6e8f-4163-ac1f-d30312924016%40googlegroups.com.


Re: [tryton] Proteus

2018-01-11 Thread Mathias Behrle
* Cédric Krier: " Re: [tryton] Proteus" (Thu, 11 Jan 2018 01:07:32 +0100):

> On 2018-01-10 11:52, Cato Nano wrote:
> > When called from within a python3 prompt, Proteus gets found
> > 
> > But this time xmlrpclib is missing
> > 
> > Also, xmlrpclib is not declared as a dependency in the Proteus setup.py
> > file  
> 
> xmlrpclib is a standard library of Python so it should not be declared
> as dependency.
> But indeed xmlrpclib is the name for Python2, in Python3 it should be
> xmlrpc.
> Normally, when installing proteus with Python3, the code is transformed
> and xmlrpclib is changed for xmlrpc. So it seems the installation is
> wrong. I guess it should be reported to the distribution you are using.

Wrong guess. 

JFTR: It was explained on the Debian mailing list to Cato Nano that he has to
take care himself for 2to3 conversion when not using distribution packages and
running instead from a downloaded package.

-- 

Mathias Behrle
MBSolutions
Gilgenmatten 10 A
D-79114 Freiburg

Tel: +49(761)471023
Fax: +49(761)4770816
http://www.m9s.biz
UStIdNr: DE 142009020
PGP/GnuPG key availabable from any keyserver, ID: 0xD6D09BE48405BBF6
AC29 7E5C 46B9 D0B6 1C71  7681 D6D0 9BE4 8405 BBF6

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/2018033847.19cfc542%40monsterix.mbehrle.de.


pgpaxZT9Gz3AW.pgp
Description: Digitale Signatur von OpenPGP


Re: [tryton] Proteus

2018-01-10 Thread Cato Nano
Il giorno giovedì 11 gennaio 2018 01:10:06 UTC+1, Cédric Krier ha scritto:
> On 2018-01-10 11:52, Cato Nano wrote:
> > When called from within a python3 prompt, Proteus gets found
> > 
> > But this time xmlrpclib is missing
> > 
> > Also, xmlrpclib is not declared as a dependency in the Proteus setup.py file
> 
> xmlrpclib is a standard library of Python so it should not be declared
> as dependency.
> But indeed xmlrpclib is the name for Python2, in Python3 it should be
> xmlrpc.
> Normally, when installing proteus with Python3, the code is transformed
> and xmlrpclib is changed for xmlrpc. So it seems the installation is
> wrong. I guess it should be reported to the distribution you are using.
> 
> -- 
> Cédric Krier - B2CK SPRL
> Email/Jabber: cedric.kr...@b2ck.com
> Tel: +32 472 54 46 59
> Website: http://www.b2ck.com/

Thank you Cedric

I already opened a thread with the Debian Tryton mantainers

I'll report to them your observation 

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/dd5aa4e1-8248-4b9a-af16-2673d9c9d36d%40googlegroups.com.


Re: [tryton] Proteus

2018-01-10 Thread Cédric Krier
On 2018-01-10 11:52, Cato Nano wrote:
> When called from within a python3 prompt, Proteus gets found
> 
> But this time xmlrpclib is missing
> 
> Also, xmlrpclib is not declared as a dependency in the Proteus setup.py file

xmlrpclib is a standard library of Python so it should not be declared
as dependency.
But indeed xmlrpclib is the name for Python2, in Python3 it should be
xmlrpc.
Normally, when installing proteus with Python3, the code is transformed
and xmlrpclib is changed for xmlrpc. So it seems the installation is
wrong. I guess it should be reported to the distribution you are using.

-- 
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" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/20180111000732.GE3972%40kei.


Re: [tryton] Proteus

2018-01-10 Thread Cato Nano
Il giorno mercoledì 10 gennaio 2018 19:30:07 UTC+1, Cédric Krier ha scritto:
> On 2018-01-10 08:59, Cato Nano wrote:
> > This
> > 
> > $ python
> > Python 2.7.14 (default, Sep 17 2017, 18:50:44) 
> > [GCC 7.2.0] on linux2
> > Type "help", "copyright", "credits" or "license" for more information.
> > >>> from proteus import config, Model
> > Traceback (most recent call last):
> >   File "", line 1, in 
> > ImportError: No module named proteus
> > >>> 
> > 
> > 
> > Of course Proteus is installed with apt-get
> 
> I guess you are not using the right Python for which proteus was
> installed.
> Maybe you are under a virtualenv, in this case you should install
> proteus using `$ pip install proteus`.
> 
> -- 

Thank you people

No, I' m not using virtualenv.

But I found a couple of facts.

When called from within a python3 prompt, Proteus gets found

But this time xmlrpclib is missing

Also, xmlrpclib is not declared as a dependency in the Proteus setup.py file

I think I' ll take Fredy's suggestion, I'll build Proteus on my own and try to 
use that

Only, not right now.
Tomorrow
Thanks for your suggestions
Good night 

-- 
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/f5e19135-03d9-4e13-aa0a-b8bef0c826d8%40googlegroups.com.


Re: [tryton] Proteus

2018-01-10 Thread Cédric Krier
On 2018-01-10 08:59, Cato Nano wrote:
> This
> 
> $ python
> Python 2.7.14 (default, Sep 17 2017, 18:50:44) 
> [GCC 7.2.0] on linux2
> Type "help", "copyright", "credits" or "license" for more information.
> >>> from proteus import config, Model
> Traceback (most recent call last):
>   File "", line 1, in 
> ImportError: No module named proteus
> >>> 
> 
> 
> Of course Proteus is installed with apt-get

I guess you are not using the right Python for which proteus was
installed.
Maybe you are under a virtualenv, in this case you should install
proteus using `$ pip install proteus`.

-- 
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" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/20180110182948.GC3972%40kei.


Re: [tryton] proteus: is it possible to dynamically add/remove simple field to existing model

2017-09-25 Thread Richard PALO

Le 23/09/2017 à 22:41, Cédric Krier a écrit :

No, I'm only answering to the removing a field, adding is possible and
the basis of Tryton modularity.


OK, noted.
Works fine to add/remove programatically a module with the field.
No problem then manually dropping the field afterwards with psql.

cheers,
--

Richard PALO

--
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/cb9858f6-82ff-025c-c7d6-f3db0055369f%40free.fr.


Re: [tryton] proteus: is it possible to dynamically add/remove simple field to existing model

2017-09-23 Thread Cédric Krier
On 2017-09-23 19:09, Richard PALO wrote:
> Le 23/09/2017 à 18:43, Cédric Krier a écrit :
> > On 2017-09-23 18:16, Richard PALO wrote:
> >> As the title indicates, I'm interested to know if one can add/remove a 
> >> persistent
> >> field (simple, non relational... like an integer) to an existing model 
> >> with proteus.
> > 
> > Tryton enforce data integrity so a client can not modify the data model.
> > 
> >> Or is the only way by adding a custom module which then can be removed 
> >> when done.
> > 
> > This sounds wrong and I do not even know if it is possible to do it
> > because module has only access to subclasses of the Model.
> > 
> I figured as much for the integrity bit, though I thought the question should 
> be asked to be sure.
> 
> Unfortunately I don't understand the second response, are you saying that 
> subclassing an
> existing class and adding a persistent field is not possible? (e.g. an 
> additional integer
> field on account.move.line) Activate to add, then deactivate to remove...

No, I'm only answering to the removing a field, adding is possible and
the basis of Tryton modularity.

-- 
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" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/20170923204150.GC3622%40kei.


Re: [tryton] proteus: is it possible to dynamically add/remove simple field to existing model

2017-09-23 Thread Richard PALO

Le 23/09/2017 à 18:43, Cédric Krier a écrit :

On 2017-09-23 18:16, Richard PALO wrote:

As the title indicates, I'm interested to know if one can add/remove a 
persistent
field (simple, non relational... like an integer) to an existing model with 
proteus.


Tryton enforce data integrity so a client can not modify the data model.


Or is the only way by adding a custom module which then can be removed when 
done.


This sounds wrong and I do not even know if it is possible to do it
because module has only access to subclasses of the Model.


I figured as much for the integrity bit, though I thought the question should 
be asked to be sure.

Unfortunately I don't understand the second response, are you saying that 
subclassing an
existing class and adding a persistent field is not possible? (e.g. an 
additional integer
field on account.move.line) Activate to add, then deactivate to remove...

Or am I greatly misunderstanding something here?

--

Richard PALO

--
You received this message because you are subscribed to the Google Groups 
"tryton" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/3b91f113-c9b9-2b8b-feb4-633aa1f3cf04%40free.fr.


Re: [tryton] proteus: is it possible to dynamically add/remove simple field to existing model

2017-09-23 Thread Cédric Krier
On 2017-09-23 18:16, Richard PALO wrote:
> As the title indicates, I'm interested to know if one can add/remove a 
> persistent
> field (simple, non relational... like an integer) to an existing model with 
> proteus.

Tryton enforce data integrity so a client can not modify the data model.

> Or is the only way by adding a custom module which then can be removed when 
> done.

This sounds wrong and I do not even know if it is possible to do it
because module has only access to subclasses of the Model.

-- 
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" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton/20170923164303.GB3622%40kei.


Re: [tryton] Proteus for database creation ?

2015-07-15 Thread Axel Braun
Am Mittwoch, 15. Juli 2015, 07:42:57 schrieb Christophe:
 Le 14/07/2015 22:19, Cédric Krier a écrit :
  On 2015-07-14 19:37, Christophe (net) wrote:
  Hi,
  
  I would need to create and configure several Tryton database. Proteus and
  scenario sounds like a good way to do. However, I stumble on the creation
  of the database (postgres). I tried several track found here and there
  (irc, etc) but nothing really conclusive. There is there a way to create
  that base with Proteus or should I do it outside? and if I have to
  create in outside how to initialize it ?
  
  database creation is no more managed by proteus.
  proteus can only initialize an existing empty database.
 
 Ok, how i can do initialization of an empty database? do you have any
 link or example?

http://doc.tryton.org/3.6/trytond/doc/topics/setup_database.html#topics-setup-database




Re: [tryton] Proteus for database creation ?

2015-07-14 Thread Cédric Krier
On 2015-07-14 19:37, Christophe (net) wrote:
 Hi,
 
 I would need to create and configure several Tryton database. Proteus and
 scenario sounds like a good way to do. However, I stumble on the creation of
 the database (postgres). I tried several track found here and there (irc,
 etc) but nothing really conclusive. There is there a way to create that base
 with Proteus or should I do it outside? and if I have to create in outside
 how to initialize it ?

database creation is no more managed by proteus.
proteus can only initialize an existing empty database.

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


Re: [tryton] Proteus for database creation ?

2015-07-14 Thread Christophe (net)

Le 14/07/2015 22:19, Cédric Krier a écrit :

On 2015-07-14 19:37, Christophe (net) wrote:

Hi,

I would need to create and configure several Tryton database. Proteus and
scenario sounds like a good way to do. However, I stumble on the creation of
the database (postgres). I tried several track found here and there (irc,
etc) but nothing really conclusive. There is there a way to create that base
with Proteus or should I do it outside? and if I have to create in outside
how to initialize it ?


database creation is no more managed by proteus.
proteus can only initialize an existing empty database.



Ok, how i can do initialization of an empty database? do you have any 
link or example?


--
Christophe
http://adiczion.com


Re: [tryton] Proteus search option

2013-12-10 Thread jomeyy


Am Dienstag, 10. Dezember 2013 08:20:13 UTC+1 schrieb Albert Cervera Areny:

 2013/12/9 jomeyy jom...@gmail.com javascript:: 
  hello Tryton user group, 
  
  I try to search multiple products with Proteus. I want to find all 
 products 
  where the product code containing the word bunny. Products are 
 [bunny01], 
  [bunnyx], [xbunny01]] etc. Can I do this with Proteus? 


 Yes, something like this should do the work: 

 Product = Model.get('product.product') 
 products = Product.find(['code', 'ilike', '%bunny$']) 

 -- 
 Albert Cervera i Areny 
 Tel. 93 553 18 03 
 @albertnan 
 www.NaN-tic.com 



Hello Albert,

thank you very much for your help. I assume that you mean

products = Product.find(['code', 'ilike', '%bunny%'])

because this is working fine for this constellation.

Kindly regards

Jome




Re: [tryton] Proteus search option

2013-12-10 Thread Albert Cervera i Areny
2013/12/10 jomeyy jom...@gmail.com:


 Am Dienstag, 10. Dezember 2013 08:20:13 UTC+1 schrieb Albert Cervera Areny:

 2013/12/9 jomeyy jom...@gmail.com:
  hello Tryton user group,
 
  I try to search multiple products with Proteus. I want to find all
  products
  where the product code containing the word bunny. Products are
  [bunny01],
  [bunnyx], [xbunny01]] etc. Can I do this with Proteus?


 Yes, something like this should do the work:

 Product = Model.get('product.product')
 products = Product.find(['code', 'ilike', '%bunny$'])


 Hello Albert,

 thank you very much for your help. I assume that you mean

 products = Product.find(['code', 'ilike', '%bunny%'])

 because this is working fine for this constellation.

Yes! That was a typo!


-- 
Albert Cervera i Areny
Tel. 93 553 18 03
@albertnan
www.NaN-tic.com


Re: [tryton] proteus - change current company

2012-04-09 Thread Cédric Krier
On 09/04/12 04:28 -0700, kostas wrote:
 The above script works for the current company of user 'admin'.
 How can I change the current company in the proteus script ?

Since 2.2, the current company can be changed with the context.
In proteus, the context is defined on the config object but it is
management could be improved (a little bit like Transaction).

-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: cedric.kr...@b2ck.com
Website: http://www.b2ck.com/


pgpv56v1EL9Bh.pgp
Description: PGP signature


Re: [tryton] proteus company wizard

2012-01-02 Thread Cédric Krier
On 02/01/12 10:04 +0100, lists.jc.mic...@symetrie.com wrote:
 Hi,
 
 
 With the proteus script to build a db (which was first written for 2.0) I get 
 an error with 2.2.2 on the line :
 
 company_config = Wizard('company.company.config')
 company_config.execute('company')
 company = company_config.form
 company.name = u'Symétrie'
 fr, = Lang.find([('code', '=', 'fr_FR')])
 company.lang = fr
 euro, = Currency.find([('code', '=', 'EUR')])
 company.currency = euro
 company_config.execute('add')
 
 Traceback (most recent call last):
   File _tryton/tryton2.2/proteus/proteus/__init__.py, line 808, in execute
 res = self._proxy.execute(self.id, self.datas, self.state, ctx)
   File _tryton/tryton2.2/proteus/proteus/config.py, line 82, in __call__
 res = getattr(self._object, self._name)(*args)
   File _tryton/tryton2.2/trytond/trytond/wizard/wizard.py, line 131, in 
 execute
 res['action'] = getattr(self, result_def['action'])(data)
   File _tryton/tryton2.2/trytond/trytond/modules/company/company.py, line 
 306, in _add
 company_id = company_obj.create(data['form'])
   File _tryton/tryton2.2/trytond/trytond/model/modelsql.py, line 372, in 
 create
 field_name))
   File _tryton/tryton2.2/trytond/trytond/error.py, line 76, in 
 raise_user_error
 raise UserError(error)
 trytond.exceptions.UserError: ('UserError', (u'Le champ Tiers de 
 Soci\xe9t\xe9 est requis.', ''))
 
 I tried to build a party object and set it to company.party, but this doesn't 
 solve.
 Ideas? 

This is strange because it is the same code as in
http://hg.tryton.org/2.2/modules/account_stock_continental/file/dcbf704c8769/tests/scenario_account_stock_continental.rst#l37
which runs http://tests.tryton.org/~test2_2/postgresql.html

-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: cedric.kr...@b2ck.com
Website: http://www.b2ck.com/


pgpVyATD3NhmK.pgp
Description: PGP signature


Re: [tryton] proteus company wizard

2012-01-02 Thread lists.jc.mic...@symetrie.com
Hi,

Le 2 janv. 2012 à 12:58, Cédric Krier a écrit :
 This is strange because it is the same code as in
 http://hg.tryton.org/2.2/modules/account_stock_continental/file/dcbf704c8769/tests/scenario_account_stock_continental.rst#l37
 which runs http://tests.tryton.org/~test2_2/postgresql.html

Sure, seems to be the same... but even with only modules 
account_fr and account_invoice, I get the same error.
Maybe this message will help to diagnose:
  company_config.execute('add')
 No handlers could be found for logger sql

Thks for helping.


Jean-Christophe Michel
--
Symétrie
livres et partitions, édition multimédia
30 rue Jean-Baptiste Say
69001 LYON (FRANCE)

tél +33 (0)478 29 52 14
fax +33 (0)478 30 01 11
web www.symetrie.com



-- 
tryton@googlegroups.com mailing list


Re: [tryton] proteus import

2011-12-08 Thread Nicolas Évrard
* Mariano DAngelo  [2011-12-08 04:56 +0100]: 


Hello,


I'm trying to import a list of products, and I having trouble saving
product cost_price  I see it's stored in ir_property table
but I cannot save it as product.cost_price, how it most be done?


You must assign to product.cost_price a decimal value (not a float).


def append_product(name, code, st_cat,cost_price):
   Product = Model.get('product.product')
   product = Product()
   #using unit as default uom
   uom = Model.get('product.uom')
   (um,) = uom.find([('name', '=', 'Unit')])
   product.default_uom = um

   product.active = True
   product.account_category = True
   product.taxes_category = True
   product.purchasable = True
   product.salable = True

   product.code = '%s' %code
   product.name = '%s' %name

   #searching category
   cat = Model.get('product.category')
   (ca,) = cat.find([('name', '=', st_cat)])
   product.category = ca

   product.save()


There is no assignation to product.cost_price is it normal ?

--
Nicolas Évrard

B2CK SPRL
rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
E-mail/Jabber: nicolas.evr...@b2ck.com
Website: http://www.b2ck.com/

--
tryton@googlegroups.com mailing list