Re: [tryton-dev] Impossible to install a custom module which inherit from other custom module

2018-09-05 Thread Sergi Almacellas Abellana

On 9/4/18 10:42 PM, Richmond Fiko wrote:

Hello,

I create a custom module which inherit from some others custom modules.
I follow all steps and I mark the parent modules inside tryton.cfg file
inside "depends:" part.


If you are using the default cookiecutter template it reads the 
tryton.cfg to download the dependencies from pypi using the trytond prefix.


You should modify your setup.py to include your company prefix on the 
MODULES2PREFIX to make the module download the name with your custom 
prefix.


If you do not have your parent module uploaded to pypi you should 
manually install it before installing the dependant module or modify 
setup.py to include the location for where the module should be 
downloaded and installed.


Hope it helps!

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

--
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/31d5ce84-94e0-b6e4-9f0c-dfea33cf22df%40koolpi.com.


Re: [tryton-dev] Vibora similar to Flask

2018-06-29 Thread Sergi Almacellas Abellana
El 29/06/18 a les 11:10, Cédric Krier ha escrit:
> Indeed at B2CK after some experiences with Flask-Tryton, we think that
> this is no more a best way to interface website with trytond. We think
> about using dedicated RPC calls in the future.

When you talk about RPC calls you mean also a specific endpoint using
the new custom routing feature?

How do you think it's better to consume those APIs? Using javascript
directly or by using an intermediary webserver?



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

-- 
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/568fa7e4-3492-35cb-40ff-355d31ed8639%40koolpi.com.


Re: [tryton-dev] Open a view as result of button click

2018-06-29 Thread Sergi Almacellas Abellana
El 29/06/18 a les 09:52, Carlos Gálvez ha escrit:
> 
> The way I have done it is returning on my Modelview.button an Action id
> that points to an act_window that open the desired view:
> 
> return Action.get_action_id(ModelData.get_id('mymodule', 'myaction'))
> 

This is the same as button_acciont('mymodule.myaction') which is simplier.


> and adding a domain to this act_window:
> 
> 

Of course, if the new created records are related to the current records
a domain can be used to remove the wizard.

Just for the record if myfield is a many2one field, there is no need to
include the '.id' part and this will avoid and extra join to the target
table.


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

-- 
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/b408dab5-6b33-2c24-3c43-c488037d46ac%40koolpi.com.


Re: [tryton-dev] Open a view as result of button click

2018-06-28 Thread Sergi Almacellas Abellana
El 28/06/18 a les 14:15, Carlos Gálvez ha escrit:
> Hi all,

Hi Carlos,
> 
> I would like to know if is possible to open another view when a button
> placed in a form view is clicked.
> 
> For example:
> I'm in a form view of a model named 'foo' and through a button click i
> want to create an instance of another model named 'bar' and show the
> form view of this instance.
> 
> Would it be possible??

Yes, it is possible. You should use the button_action decorator to
returns an wizard with an StateAction from the model of the new created
instance.

You should set the res_id of the action on the wizard to the ids of the
new created instances.





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

-- 
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/2b2dab86-a098-83b9-f5f4-a08a4bd510db%40koolpi.com.


Re: [tryton-dev] Generate General Balance Report and Income Statement

2018-06-27 Thread Sergi Almacellas Abellana
El 27/06/18 a les 01:34, Josias Pérez ha escrit:
> I have already created a report for account.account.type but I have doubts on 
> how to order the data to print, I was thinking something like tree view but 
> in a printed report, I will be perfect. 
> 

Normally a report work with the selected records. So the user selects
the records she wants to print and then the template is rendered for
each one of.

In your case, you can include the type childs if interested.

BTW, Could you explain which report are you going to develop? Maybe it's
interesting for other and can be included on account module.



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

-- 
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/41f61123-ab09-f158-84f5-661c0ebae687%40koolpi.com.


Re: [tryton-dev] Import data from CSV

2018-06-14 Thread Sergi Almacellas Abellana
El 13/06/18 a les 21:41, Josias Pérez ha escrit:
> Hi,
> 
> I was trying to import data with CSV with a multi-company stage and all the 
> companies with the same accounting plan. 
> 
> I'm trying to import a file that require to import the a group of accounts 
> but I found with an error that say that encounter many ocurrences. I dont 
> know how to import that. 

It seems that this is because the program finds the accounts for several
companies and does not know which to pick.
> 
> At the same time, I need to import with a tree structure child / parent. 
> Actually I do it manually one by one (first parent and after the child) 
> because if I put all together I can not import that (the parent doesn't be 
> found and can create the child). 

You can use the Children One2Many field to import all the childs of a
tree. Something like:

Name, Children/Name
Test, Child 1
, Child 2
, Child 3
Test2, Child 4
, Child 5

Will create the following tree:

Test:
  - Child 1
  - Child 2
  - Child 3

Test2:
  - Child 4
  - Child 5

Hope it helps.


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

-- 
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/5ff3f0d6-6de3-a067-a414-6256c3619c3e%40koolpi.com.


Re: [tryton-dev] Generate General Balance Report and Income Statement

2018-06-07 Thread Sergi Almacellas Abellana
El 07/06/18 a les 01:28, Josias Pérez ha escrit:
> Hi,
> 
> I would like to generate report for General Balance and Income Statement.
> 
> The report is generated from account.account.type and I can have all the 
> field, but I would to stylize the report with different font size for 
> parent/childs.
> 

You should create a report template an add it to the
account.account.type to be able to export the data in the report format.
Have a look at the report documentation:

http://doc.tryton.org/4.8/trytond/doc/topics/reports/index.html

I think this will be a nice addition to the account module so it will be
great if you can propose a patch to include it. Have a look at:

http://www.tryton.org/how-to-contribute.html




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

-- 
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/edcf97e1-e657-f6b6-e90c-5f0c8c3930d5%40koolpi.com.


Re: [tryton-dev] Replace doc.tryton.org by readthedocs

2018-05-23 Thread Sergi Almacellas Abellana
El 19/05/18 a les 02:37, Cédric Krier ha escrit:
> Hi,
> 
> Today we talked on IRC about the documentation [1] and that there are
> many places where documentation can be found.

Yes, that's one of our drawbacks which adds complexity for newbies.

> One place is the readthedocs [2][3] and another place is doc.tryton.org
> The readthedocs was an attempt to automate the publication but it was
> never finished.
> I made some tests and here is my proposal to merge both:
> 
> I create a repository which contains a single index.rst [4], the idea is
> to have this repository as the main project on rtfd. As you can see it
> lists all the documentation using sub-projects [5] which allow to share
> index. Also we could manage the index.rst file per branches so we could
> have the documentation per series.
> We could also set a custom domain [6] as 'doc.tryton.org'
> 
> I think it will be a good improvement to have automate documentation
> build on such platform.>
> What do you think?

I like the idea as it will allow us to have the trunk version also
documented as sometimes we include documentation on trunk that's also
useful for older releases.

Lets go for it.
> 
> 
> [1] http://www.tryton.org/~irclog/2018-05-18.log.html#t11:05
> [2] https://trytond.readthedocs.io/en/latest/
> [3] https://tryton.readthedocs.io/en/latest/
> [4] http://hg.tryton.org/readthedocs/
> [5] https://docs.readthedocs.io/en/latest/subprojects.html
> [6] https://docs.readthedocs.io/en/latest/alternate_domains.html
> 


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

-- 
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/d51a8cdf-336c-a717-3eeb-c4f81042622b%40koolpi.com.


Re: [tryton-dev] NSIS new string PreviousInstall

2018-05-17 Thread Sergi Almacellas Abellana
El 11/05/18 a les 17:28, Cédric Krier ha escrit:
> On 2018-05-08 09:41, Sergi Almacellas Abellana wrote:
>> Spanish: "Tryton ja esta instalado.$\n$\nPulse `OK` para eliminar la
>> versión anterior o `Cancelar` para cancelar la actualitzación."
> On 2018-05-08 10:41, Xavier Codinas wrote:
>> Spanish: "Tryton ya esta instalado.$\n$\nPulse `OK` para eliminar la
>> versión anterior o `Cancelar` para cancelar la actualización."
> On 2018-05-11 07:14, Sergio Morillo wrote:
>> Spanish: "Tryton ya está instalado.$\n$\nPulse `OK` para eliminar la
>> versión anterior o `Cancelar` para cancelar la actualización."
> On 2018-05-11 16:26, Raimon Esteve wrote:
>> Spanish: "Tryton ya está instalado.$\n$\nPulse `OK` para eliminar la
>> versión anterior o `Cancelar` para cancelar la actualización."
> On 2018-05-11 16:25, Raimon Esteve wrote:
>> Spanish: "Tryton ya está instalado.$\n$\nPulse `OK` para eliminar la
>> versión anterior o `Cancelar` para cancelar la actualización."
> Guys, this starts to become ridiculous. Is it possible to have a
> definitive correct translation.

Sergio and Raimon (both times) use the correct sentence, which I will
repeat here to clarify:

Spanish: "Tryton ya está instalado.$\n$\nPulse `OK` para eliminar la
versión anterior o `Cancelar` para cancelar la actualización."

Sorry for the mess.

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

-- 
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/59030516-1371-b852-c576-3959d9e9f2c1%40koolpi.com.


Re: [tryton-dev] NSIS new string PreviousInstall

2018-05-08 Thread Sergi Almacellas Abellana
El 08/05/18 a les 00:15, Cédric Krier ha escrit:
> Hi,
> 
> @translators, I'm working on support automatic uninstallation of
> previous version on Windows [1]. For that, the string PreviousInstall
> has changed and must be retranslated:
> 
> LangString PreviousInstall ${CURLANG} "Tryton is already 
> installed.$\n$\nClick `OK` to remove the previous version or `Cancel` to 
> cancel this upgrade."

Catalan: "Tryton ja està instal·lat.$\n$\nPremeu `OK` per eliminar la
versió anterior o `Cancel·la` per cancel·lar l'actualització."

Spanish: "Tryton ja esta instalado.$\n$\nPulse `OK` para eliminar la
versión anterior o `Cancelar` para cancelar la actualitzación."

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

-- 
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/75de9126-94bd-02fd-07b1-7ccf730a6a86%40koolpi.com.


Re: [tryton-dev] Missing translations for release 4.8

2018-05-07 Thread Sergi Almacellas Abellana
El 07/05/18 a les 14:38, Udo Spallek ha escrit:
> Is it correct that there are more than 5000 entries to edit?
This probably because you get results from country and currency modules.
Skipping this modules gives (at least for catalan) less words to
translate. See:

translation=# select count(1) from ir_translation where lang = 'ca' and
src = value;
 count
---
  5944

translation=# select count(1) from ir_translation where lang = 'ca' and
src = value and module not in ('currency', 'country');
 count
---
   978

Also it's possible that there are common word on your language that are
not correctly translated. For example in catalan we translate model and
id with the same wording. Skipping them gives less entries to translate:


translation=# select count(1) from ir_translation where lang = 'ca' and
src = value and src not in ('Model', 'ID') and module not in
('currency', 'country');
 count
---
   489


The number depends on the languages but expect to have from 500 to 1000
missing translations as (at least) all buttons strings, helps and
confirms translations are missing.

Hope it helps.



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

-- 
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/3e5499f2-d57d-1b24-effe-9936730087ef%40koolpi.com.


[tryton-dev] Missing translations for release 4.8

2018-05-04 Thread Sergi Almacellas Abellana
Hi Translations,

We found that there are some missing translations on the 4.8 release [1]
which should be fixed by adding new translations on pootle.

We've scheduled a new minor release on 21th of May which may
exceptionally contain the new translations. Translations have two weeks
to upload them. We will publish a news on the release date explaining
the issue and encouraging people to do the database update for this
release so new translations are loaded.

In order to find the missing translations the best is to create a new
database with all the modules installed. This can be achieved by the
following command:

trytond-admin -d translation -l  -u ir res `curl
https://downloads.tryton.org/4.8/modules.txt | tr '\n' ' '`

Once you have a the database created all missing translations can be
found with the following SQL QUERY:

SELECT * FROM ir_translation WHERE lang =  AND src = value
AND fuzzy = false;

Those translations must be resubmitted to pootle before the release date.

Thank you for collaboration and sorry for the inconvenience.

[1] https://bugs.tryton.org/issue7414
-- 
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

-- 
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/f08f67da-d35d-c234-c6d7-a2ba62e226b2%40koolpi.com.


Re: [tryton-dev] Mobile Apps

2018-04-23 Thread Sergi Almacellas Abellana
El 21/04/18 a les 03:40, Richmond Fiko ha escrit:
> Hello,
> 
> I thinks about a mobile apps in order to transfert information 
> from mobile user to a tryton (or GNU Health server).
> Are there similar opensource projects or examples? 
> How can I connect to tryton server throught web services or API?
> 
As an example application you have chronos [1][2] which connects tryton
using a rest API and using user_applications.

With the same structure you can develop your mobile app that connects to
the tryton server via a custom designed api and sends the information.

Hope it helps


[1] https://addons.mozilla.org/en-US/firefox/addon/tryton-chronos/
[2] http://hg.tryton.org/chronos

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

-- 
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/47608583-913e-859b-d42c-e3d758c19dc9%40koolpi.com.


Re: [tryton-dev] import_data and model account with account_account_type (RESEND)

2018-04-20 Thread Sergi Almacellas Abellana
El 19/04/18 a les 18:14, Richard PALO ha escrit:
> Le 19/04/2018 à 17:38, Cédric Krier a écrit :
>> On 2018-04-18 17:40, Richard PALO wrote:
>>> In the French plan, there are unfortunately 7 instances of
>>> account_account_type_template
>>> with the name 'Autres'... but in the xml, there are indeed unique
>>> ID's...
>>>
>>> Is the mapping of these (xml id => sql id) stored somewhere it can be
>>> accessed
>>> to somehow facilitate import?
>>
>> In "ir.model.data".
> 
> Great, for example in my case in hand I find a record with
>   fs_id = 'creances_autres' having db_id = 196
> which is correct for account_account_type_template
> 
> Guess I'm not sure what do I need to do to get 'creances_autres' (unique
> xml id)
> to work instead of using the name 'Autres' for the 'type' (last field in
> account.csv)
> Seems account_account_type_template record id's differ from
> account_account_type ids.

You can use the following code to get the db ids:

pool = Pool()
ModelData = pool.get('ir.model.data')

db_id = ModelData.get_id('account_fr', 'creances_autres')

And then you can get the type of your company with:

Type = pool.get('account.type')

type, = Type.search([('company', '=', company.id), ('template', '=',
db_id)])


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

-- 
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/51bd2d6a-680e-5556-5b94-eea42d0eb58d%40koolpi.com.


Re: [tryton-dev] Error on creation of Chart of account from Template

2018-04-20 Thread Sergi Almacellas Abellana
El 19/04/18 a les 23:56, Richmond Fiko ha escrit:
> Hello,
> 
> I create a COA template.

Just for curiosity, for which country is the CoA?

> I install it but when I want to create a new chart of account from this 
> template, I got this error.
> 
> Traceback (most recent call last):
>   File "/trytond/wsgi.py", line 47, in dispatch_request
> return endpoint(request, **request.view_args)
>   File "/trytond/protocols/dispatcher.py", line 41, in rpc
> request, database_name, *request.rpc_params)
>   File "/trytond/wsgi.py", line 39, in auth_required
> return wrapped(*args, **kwargs)
>   File "/trytond/protocols/wrappers.py", line 106, in wrapper
> return func(request, pool, *args, **kwargs)
>   File "/trytond/protocols/dispatcher.py", line 163, in _dispatch
> result = rpc.result(meth(*c_args, **c_kwargs))
>   File "/trytond/wizard/wizard.py", line 287, in execute
> return wizard._execute(state_name)
>   File "/trytond/wizard/wizard.py", line 318, in _execute
> result = self._execute(transition())
>   File "/trytond/modules/account/account.py", line 1923, in 
> transition_create_account
> template2type=template2type)
>   File "/trytond/modules/account/account.py", line 117, in create_type
> assert self.parent is None
> AssertionError
> 
> 
> Can someone help me to understand it?

The type you used on the root account of your CoA has a parent set. As
it's the type of the root account is should not have any parent set.

Hope it helps.

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

-- 
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/c3e06789-7c09-d52b-85c1-576db6c8bf6f%40koolpi.com.


Re: [tryton-dev] Package release announce

2018-04-13 Thread Sergi Almacellas Abellana
El 01/04/18 a les 14:39, Cédric Krier ha escrit:
> Hi,
> 
> The package release announce on tryton-annou...@googlegroups.com relies
> on rss2email [1] and farmhouse [2], a service that B2CK is running to
> generate RSS feeds.
> farmhouse relies on the XML-RPC API of the now legacy PyPI website. But
> it is going to be deprecated [3]. There is no planned date yet but I
> think it is better to act before.
> There is a service that provides also RSS feed of packages on PyPI (and
> also npm): https://libraries.io/
> It is based on AGPL code: https://github.com/librariesio
> I think we could use this feed instead of farmhouse.
> Here is an example of the RSS feed: 
> https://libraries.io/pypi/trytond/versions.atom
> The only different is about the text and title. It is limited to just
> the version number. So the email will contain only the version number,
> the sender name will be " versions - Libraries.io" and the link
> will point to libraries.io page.
> But I think it is only minor changes compare to the benefit of not
> having to run farmhouse and have continuous plan after the close of
> XML-RPC API.

Looks as a good plan for me.



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

-- 
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/bdeab37d-8edd-fe2f-441b-f728299bec9b%40koolpi.com.


Re: [tryton-dev] ImportError: cannot import name register_default_jsonb

2018-04-13 Thread Sergi Almacellas Abellana
El 13/04/18 a les 10:59, Carlos Ibrahim Arias ha escrit:
> Hello,
> 
> I'm testing tryton version 4.6 on a centos 7 host. I did the installation 
> with no errors using the following script 
> https://bitbucket.org/carlos_ia/trytoninstall/src/454963514b8270619c948c376a2318dcfb86c3cc/tryton-install?at=default=file-view-default
>  based on nantic tools.
> 
> When trying to the init setup I got the following error:
> 
> [tryton@trytontest ~]$ /home/tryton/trytonERP/trytond/bin/trytond-admin 
> --config /etc/trytond.conf -d cialDB --logconf /etc/trytond_log.conf --all
> [Fri Apr 13 08:51:01 2018] INFO:server:using /etc/trytond_log.conf as logging 
> configuration file
> Traceback (most recent call last):
>   File "/home/tryton/trytonERP/trytond/bin/trytond-admin", line 21, in 
> 
> admin.run(options)
>   File "/home/tryton/trytonERP/trytond/trytond/admin.py", line 20, in run
> Database = backend.get('Database')
>   File "/home/tryton/trytonERP/trytond/trytond/backend/__init__.py", line 34, 
> in get
> raise exception
> ImportError: cannot import name register_default_jsonb

The error is due to this changeset:

http://hg.tryton.org/trytond/rev/5eb2714a75da

which raised the required version of psycopg2 to 2.5.4

It seems that you have an older version. You should upgrade pyscopg2 in
order to fix it.

Hope it helps.

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

-- 
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/6fe89384-6d15-c9db-a78c-1dad2def6669%40koolpi.com.


Re: [tryton-dev] Error on tax in Chart of account localisation

2018-04-13 Thread Sergi Almacellas Abellana
uot;/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/convert.py", 
> line 699, in create_records
> records = Model.create(vlist)
>   File 
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/model/modelsql.py",
>  line 533, in create
> insert_values.append(field.sql_format(value))
>   File 
> "/home/gnuhealth/gnuhealth/tryton/server/trytond-4.2.10/trytond/model/fields/numeric.py",
>  line 32, in sql_format
> assert isinstance(value, Decimal)
> AssertionError
> 
The problem is that you are setting a non decimal value for a Numeric
field which expects a Decimal value.
> 
> The record
> 
> 
> TVA 18% récupérable sur achat
> TVA 18% (Achats)
> 
> 
> percentage
> 
>  ref="account_syscohada_2018_676"/>
> 
> 
> 1
Should be:

1

Idem
> 
> 
> -1
> -1

And the same applies for credit note signs.

> 
> 
> It seems that the problem is on the field rate. But I don't understand tu 
> error and how the numerics field work.
> 
> Can someone help me?
> 


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

-- 
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/16f3f05c-c055-4f08-288f-5a8a2bb0786a%40koolpi.com.


Re: [tryton-dev] account_statement import modules

2018-04-12 Thread Sergi Almacellas Abellana
El 11/04/18 a les 22:51, edbo.des...@gmail.com ha escrit:
> On Wednesday, 11 April 2018 12:37:53 UTC+2, Sergi Almacellas Abellana  wrote:
>> Maybe you can propose another discussion explaining why you use the
>> extra fuctionality to see if we can find a generic solution that works
>> for most people.
> Should I use discuss for that? I think it's better reading then email.
> 
> 
Yes, feel free to open a new feature on discuss.

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

-- 
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/51e13ca7-d852-3d70-5458-3bc038322395%40koolpi.com.


Re: [tryton-dev] account_statement import modules

2018-04-11 Thread Sergi Almacellas Abellana
El 10/04/18 a les 22:08, edbo.des...@gmail.com ha escrit:
> I'm just wondering. We took the account_statement_coda module to build the 
> account_statement_mt940 module. The module just import the statement and 
> creates the origins, but there are no lines created. So we still have to 
> manually add the statement lines?

Yes, the idea is that the fil imports the bank lines as direct relation
with origins and then the user reviews them to select which
account/party and invoices (if any) are related to the statement.

> 
> We have now an almost working module for importing mt940 statements (except 
> creating / filling a dict with the information). Because we want minimal 
> work, we have also extended the import wizard with a default payable and 
> receivable account and the statement lines are also created and linked to the 
> origin.


> 
> So we can do two things: 
> - Keep this module as it works perfectly for us
> - Split the module into a basic version as the other ones and create our own 
> to add the extra functionality.

This will be the good way to benefit the project.

Maybe you can propose another discussion explaining why you use the
extra fuctionality to see if we can find a generic solution that works
for most people.

 The basic version can then be added to the set of default modules if
wanted.

That will be great.

 But as not being a full-time developer, but it's rather a hobby, I have
no experience with testing, or creating installable new python-packages
etc. If anybody can help me out here with some extra explanation of
http://www.tryton.org/how-to-contribute.html would be very welcome.

I will be happy to help if you have doubts. Just ping me (pokoli) on IRC
and lets talk about it.

If you have not contributed any patch to tryton probably it's better to
pick an easy issue first to get familiar with the process. Here is the
list of easy issues:

https://bugs.tryton.org/issue?status=-1,1,2,3,4,5,6,7&@sort=-activity&@search_text=&@columns=id,activity,component,title,assignedto,status&@dispname=Show%20Easy=27&@group=priority&@filter=status,keyword&@pagesize=50&@startwith=0


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

-- 
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/96e09e23-71de-39c3-7832-3632b0f4b9e7%40koolpi.com.


[tryton-dev] Re: Get a second mac mini

2018-03-15 Thread Sergi Almacellas Abellana
El dissabte, 3 març de 2018 11:53:52 UTC+1, Cédric Krier va escriure:
> Hi,
> 
> issue7182 [1] shows that our support for macOS bundle is not optimal.
> 
> Ideally, we would need to have 3 machines as it seems it is the number
> of version supported by Apple.
> But I think we can have a pretty good support with only 2 machines.
> The first one will be keep one release behind and used to build the
> bundle. The second one will be kept up to date and used to test the
> bundle against the new version.
> 
> So this is a request to buy a second machine by the Foundation.

The foundation has published it's budget [1], which includes the purchase a new 
Mac Mini. 

[1] http://www.tryton.org/posts/foundation-budget-2018.html

-- 
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/9c559c3f-ab5b-4812-bdfe-fc46dcd3f1f2%40googlegroups.com.


Re: [tryton-dev] Add a conditional page break inside report

2018-03-02 Thread Sergi Almacellas Abellana
El 02/03/18 a les 10:47, Maxime Richez ha escrit:
> Hello,
> 
> Does anyone knows a define a conditional page break inside a report ?
> We need to print a page as a "big label" and if i select multiple records, 
> each record should fill exactly one page. And if i print only one record, i 
> don't want an empty blank page after the printed page.
> Same problem with the purchases:
> If i try to print multiple purchases, there is no page break and all the 
> selected purchases are printed following each other 
> Thanks for help !

We have some custom modules that need the same behaviour and we
implemented it by surrounding the page break with the following if
condition:

if test="records and record !=  records[-1]"
/if

This will add a page break for all pages except the last one.

Hope it helps.


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

-- 
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/eeb39621-f9e3-20c5-f76e-6f7f21b4b2fa%40koolpi.com.


Re: [tryton-dev] Add sum widget in SAO

2018-03-01 Thread Sergi Almacellas Abellana
El 01/03/18 a les 04:36, Josias Pérez ha escrit:
> Hi,
> 
> I was reading the docs about add the sum of a field on the bottom of list in 
> tree view [1], but this only work on desktop client not in web. Is there a 
> way to activate it, or how can I customize this to add the sum to tree view?

It's a feature that is currently in development. See:

https://bugs.tryton.org/issue6947



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

-- 
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/8686aa9e-051f-cb3f-c593-d0f9a30db515%40koolpi.com.


Re: [tryton-dev] How to build and use plugins in the client

2018-02-23 Thread Sergi Almacellas Abellana
El 22/02/18 a les 20:10, Eduardo Ruiz Rodriguez ha escrit:
> El viernes, 15 de diciembre de 2017, 15:39:08 (UTC+1), edbo@gmail.com  
> escribió:
>> So what I did was:
>> 1. Create a new label-report with plain text as layout. The content of that 
>> report is JSON-like, so when the report is created I get a JSON-string.
> Hello, I'm stucked in that point. How did you get that report 
> (text/json-like..)?. The only report type I can generate is odt/ods. What is 
> the template format you applied for it?
Hi Eduardo,

You can use the 'txt' template extension to generate a report from txt
format. Then you should upload the template file and declare using the
relatorio sintax as usual. It's the same as we use for email
notification templates [1], but using the txt template extension.

Hope it helps.


[1]
http://hg.tryton.org/modules/web_user/file/4153faf25a3e/email_validation.html

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

-- 
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/3716de40-350f-1d49-d692-381d6999cec8%40koolpi.com.


Re: [tryton-dev] Impact mitigation for DDoS attack

2018-02-14 Thread Sergi Almacellas Abellana
El 14/02/18 a les 12:17, Mathias Behrle ha escrit:
> I just want to re-throw into the discussion to consider the use of an 
> in-memory
> database like redis for session management.
> 
> https://stackoverflow.com/questions/10278683/how-safe-it-is-to-store-session-with-redis
> https://www.digitalocean.com/community/tutorials/how-to-set-up-a-redis-server-as-a-session-handler-for-php-on-ubuntu-16-04
> https://matomo.org/faq/how-to/faq_20521/
> 
> Thoughts?

I've build a tryton-redis module which use to store the cache on the in
memory database [1]. If somebody is interested on storing the session
details on redis I will be very happy to accept a patch for it.


[1] https://bitbucket.org/pokoli/redis-tryton

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

-- 
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/290e75b8-48fb-d4db-d870-058fc90ad74c%40koolpi.com.


Re: [tryton-dev] Impact mitigation for DDoS attack

2018-02-14 Thread Sergi Almacellas Abellana
El 14/02/18 a les 10:27, Axel Braun ha escrit:
> Am Sonntag, 4. Februar 2018 00:30:05 UTC+1 schrieb Cédric Krier:
>> On 2018-02-03 07:48, Axel Braun wrote:
>>> Am Montag, 29. Januar 2018 23:25:07 UTC+1 schrieb Cédric Krier:
>>>> On 2018-01-29 12:47, Axel Braun wrote:
>>>>> I would like to discuss https://bugs.tryton.org/issue5375 with all 
>>>>> developers involved.
>>>>
>>>> All developers have already commented on the issue and we all agree that
>>>> the proposal is wrong, solves nothing and weakens the brute force attack
>>>> protection.
>>>
>>> We had a constructive and friendly discussion about the topic here: 
>>> https://bugzilla.opensuse.org/show_bug.cgi?id=1078111
>>
>> What I read is that more people agree that the applied patch does not
>> solve any issue and disable the brute force attack protection.
> 
> Maybe you should read more carefully: The current implementation in Tryton, 
> that allows you to bring the whole system down by flooding the database with 
> login requests is rubbish (OK, the security team phrased it more politely)

Will be great if we all pharse our words more politely ;)

In case of flodding, the system can be turned down when the server does
not have enougth capacity to reply all the request. If you get such
attacks, i think it's better to block the correponding ip. Indeed a new
patch have been proposed to improve it:

https://bugs.tryton.org/issue7110

I think this will work better for flooding attacks.

> 
>>> The advise from the security team should be considered for a future patch.
>>
>> But more importantly, the applied patch on the OpenSUSE package must be
>> removed ASAP to not expose OpenSUSE users of the Tryton package to brute
>> force attack against their password.
> 
> Dunno if you have read the link you have posted above 
> (https://www.schneier.com/blog/archives/2009/01/bad_password_se.html) 
> yourself, but the first comment already describes it pretty well.

For me the important word on the posted link is *rapid-fire*. On tryton
we have a timeout to prevent the rapid fire. Otherwise it will be
possible to attach the with a brute force attack.

> 
> Up to now we have no better patch in place. The proposed patch 
> https://codereview.appspot.com/335550043/ makes thing even worse.

I think it's a sample implementation to show how the session management
can be customized, so you can implement whatever you wan't on third
party packages without patching trytond server. This allow end users to
pick the most suitable solutions for them, which for me is a big benefit.

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

-- 
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/49f0c960-cfab-0cda-7734-a62bae3889f8%40koolpi.com.


Re: [tryton-dev] Deposit accounts on Spanish Chart

2018-02-12 Thread Sergi Almacellas Abellana
El 12/02/18 a les 10:30, Cédric Krier ha escrit:
> On 2018-02-12 10:03, Sergi Almacellas Abellana wrote:
>>> If we want to use this feature, yes the fs_values must reflect the sum
>>> of what was written by the module.
>> I'm not sure if it's worth to implement it. Let me explain: Currently we
>> are forced to update a record definition of the same module because the
>> new kind is not defined on the same module but on another one. The
>> problem is that account_es doest not depend on account_deposit and we
>> don't want to add the dependency. Normally this is fixed by adding the
>> code on a third module that depends on both modules.
> I think there are use cases where it will be useful just like the
> "depends" attribute on record because it increases the modularity.
> Indeed I think we could extend the "depends" to the "field" tag and have
> something like this:
> 
> 
> other
> deposit
> 
> 
> The parser should use the latest value matching the condition.
> 
Ok I see your point and I agree that this will improve the modularity of
the system. JFR, I've created an issue to implement it:

https://bugs.tryton.org/issue7127


And also updated the spanish chart of accounts to use it:

https://bugs.tryton.org/issue7126



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

-- 
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/68d2761c-9b99-0f78-d65b-2dc493dc86bc%40koolpi.com.


Re: [tryton-dev] Deposit accounts on Spanish Chart

2018-02-12 Thread Sergi Almacellas Abellana
El 08/02/18 a les 20:23, Cédric Krier ha escrit:
> On 2018-02-08 16:50, Sergi Almacellas Abellana wrote:
>> El 07/02/18 a les 18:22, Cédric Krier ha escrit:
>>> On 2018-02-07 18:01, Sergi Almacellas Abellana wrote:
>>>> El 07/02/18 a les 17:51, Cédric Krier ha escrit:
>>>>> On 2018-02-07 17:27, Sergi Almacellas Abellana wrote:
>>>>>> El 07/02/18 a les 16:43, Cédric Krier ha escrit:
>>>>>>> On 2018-02-07 16:26, Sergi Almacellas Abellana wrote:
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> The account_deposit module defines a new kind of account (Deposit
>>>>>>>> account) but there is no deposit account on the Spanish CoA. After a
>>>>>>>> little bit of digging i found that the Spanish CoA includes deposit
>>>>>>>> accounts for customers (4380) and suppliers (4070), so this accounts
>>>>>>>> should be marked as deposit. This requires to add the account_deposit 
>>>>>>>> as
>>>>>>>> dependency of the account_es module, but not sure if this is the best
>>>>>>>> way as this module also adds new functionaly on party and invoice which
>>>>>>>> is not relevant to people not using the deposit functionaly.
>>>>>>> You may put those account inside a extra depend module.
>>>>>> The main issue here is that this account should be included on the
>>>>>> balance sheet so probably the best is to use the deposit kind when the
>>>>>> account_deposit module is installed and the other type when not 
>>>>>> installed.
>>>>> I do not think it is possible to do that.
>>>> I've achieved it by adding the the following code at the end of the xml
>>>> definition:
>>>>
>>>> 
>>>> >>> update="1">
>>>> deposit
>>>> 
>>>> 
>>>> >>> update="1">
>>>> deposit
>>>> 
>>>> 
>>>> 
>>> Are you sure that the ir.model.data is correct when the module
>>> account_deposit is activated?
>> fs_values only contains the values of the last update (kind and
>> party_required) but other fields are not computed. Which if i understand
>> correctly this is not correct.
>>
>> Is this something that we should fix?
> If we want to use this feature, yes the fs_values must reflect the sum
> of what was written by the module.
I'm not sure if it's worth to implement it. Let me explain: Currently we
are forced to update a record definition of the same module because the
new kind is not defined on the same module but on another one. The
problem is that account_es doest not depend on account_deposit and we
don't want to add the dependency. Normally this is fixed by adding the
code on a third module that depends on both modules.

I don't think there are so much uses cases for defining the same record
(with different values) on two different modules. Indeed I can not see
any other usage that fixing this issue.

For me it will be simpler to define the deposit kind on the account
module (so CoA modules can define accounts with the deposit kind). I
don't see any drawback of allowing this kind on the account module.
-- 
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

-- 
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/46fa92e1-0961-7cfe-3b26-72c89365a961%40koolpi.com.


Re: [tryton-dev] Search on One2Many field

2018-02-08 Thread Sergi Almacellas Abellana
El 07/02/18 a les 23:01, Josias Pérez ha escrit:
> Hi,
> 
> I have a custom module with the a One2Many field:
> 
> 
> class Agreement(ModelView, ModelSQL):
> "Agreement"
> __name__ = 'mod.agreement'
> 
> date = fields.Date('Date')
> lines = fields.One2Many('disc.agreement.service',
> 'agreement','Services',
> )
> 
> class AgreementLine(ModelView, ModelSQL): 
> "Agreement Line" 
> __name___ = 'mod.agreement.line'
> 
> agreement = fields.Many2One('Agreement')
> service = fields.Many2One('mod.service', 'Service') 
> 
> class Service(ModelView, ModelSQL):
> "Service"
> __name__ = 'mod.service'
> 
> name = fields.Char('Name')
> 
> Inside this class I have modified the search classmethod and I want to search 
> Agreements by Service ('mod.service') in Agreement class('mod.agreement'), is 
> this possible?

Yes, you can "jump" between relations using a dot to represent a
relation. For example, the following example will allow you to return
all the agreement which conaint a line of a service named service:

[('lines.service.name', '=', 'Service')]

Hope it helps.

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

-- 
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/493c7b55-5ba5-94a6-c955-8e417bff60d2%40koolpi.com.


Re: [tryton-dev] Deposit accounts on Spanish Chart

2018-02-08 Thread Sergi Almacellas Abellana
El 07/02/18 a les 18:22, Cédric Krier ha escrit:
> On 2018-02-07 18:01, Sergi Almacellas Abellana wrote:
>> El 07/02/18 a les 17:51, Cédric Krier ha escrit:
>>> On 2018-02-07 17:27, Sergi Almacellas Abellana wrote:
>>>> El 07/02/18 a les 16:43, Cédric Krier ha escrit:
>>>>> On 2018-02-07 16:26, Sergi Almacellas Abellana wrote:
>>>>>> Hi,
>>>>>>
>>>>>> The account_deposit module defines a new kind of account (Deposit
>>>>>> account) but there is no deposit account on the Spanish CoA. After a
>>>>>> little bit of digging i found that the Spanish CoA includes deposit
>>>>>> accounts for customers (4380) and suppliers (4070), so this accounts
>>>>>> should be marked as deposit. This requires to add the account_deposit as
>>>>>> dependency of the account_es module, but not sure if this is the best
>>>>>> way as this module also adds new functionaly on party and invoice which
>>>>>> is not relevant to people not using the deposit functionaly.
>>>>> You may put those account inside a extra depend module.
>>>> The main issue here is that this account should be included on the
>>>> balance sheet so probably the best is to use the deposit kind when the
>>>> account_deposit module is installed and the other type when not installed.
>>> I do not think it is possible to do that.
>> I've achieved it by adding the the following code at the end of the xml
>> definition:
>>
>> 
>> > update="1">
>> deposit
>> 
>> 
>> > update="1">
>>     deposit
>> 
>> 
>> 
> Are you sure that the ir.model.data is correct when the module
> account_deposit is activated?

fs_values only contains the values of the last update (kind and
party_required) but other fields are not computed. Which if i understand
correctly this is not correct.

Is this something that we should fix?


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

-- 
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/509cd148-e8e3-e194-560e-5f80e000af39%40koolpi.com.


Re: [tryton-dev] Deposit accounts on Spanish Chart

2018-02-07 Thread Sergi Almacellas Abellana
El 07/02/18 a les 17:51, Cédric Krier ha escrit:
> On 2018-02-07 17:27, Sergi Almacellas Abellana wrote:
>> El 07/02/18 a les 16:43, Cédric Krier ha escrit:
>>> On 2018-02-07 16:26, Sergi Almacellas Abellana wrote:
>>>> Hi,
>>>>
>>>> The account_deposit module defines a new kind of account (Deposit
>>>> account) but there is no deposit account on the Spanish CoA. After a
>>>> little bit of digging i found that the Spanish CoA includes deposit
>>>> accounts for customers (4380) and suppliers (4070), so this accounts
>>>> should be marked as deposit. This requires to add the account_deposit as
>>>> dependency of the account_es module, but not sure if this is the best
>>>> way as this module also adds new functionaly on party and invoice which
>>>> is not relevant to people not using the deposit functionaly.
>>>
>>> You may put those account inside a extra depend module.
>>
>> The main issue here is that this account should be included on the
>> balance sheet so probably the best is to use the deposit kind when the
>> account_deposit module is installed and the other type when not installed.
> 
> I do not think it is possible to do that.

I've achieved it by adding the the following code at the end of the xml
definition:



deposit



deposit




> 
>>> But usually, you have 1 account deposit per party so you create them and
>>> they do not come from the standard chart.
>>
>> But the code groups by line party [1], so it's possible to have multiple
>> parties on the same account (as the party required flag should be set
>> for this accounts). Furthermore, I don't see how each party gets it's
>> deposit account assigned. Am I missing something?
> 
> Indeed deposit account must have party checked.
> 

Then it's possible to define a single account with multiple parties. So
for me it makes sense to mark the accounts on deposit on the account chart.

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

-- 
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/acf9fbc9-fed0-5a68-9dde-9b8e08e1222a%40koolpi.com.


Re: [tryton-dev] Deposit accounts on Spanish Chart

2018-02-07 Thread Sergi Almacellas Abellana
El 07/02/18 a les 16:43, Cédric Krier ha escrit:
> On 2018-02-07 16:26, Sergi Almacellas Abellana wrote:
>> Hi,
>>
>> The account_deposit module defines a new kind of account (Deposit
>> account) but there is no deposit account on the Spanish CoA. After a
>> little bit of digging i found that the Spanish CoA includes deposit
>> accounts for customers (4380) and suppliers (4070), so this accounts
>> should be marked as deposit. This requires to add the account_deposit as
>> dependency of the account_es module, but not sure if this is the best
>> way as this module also adds new functionaly on party and invoice which
>> is not relevant to people not using the deposit functionaly.
> 
> You may put those account inside a extra depend module.

The main issue here is that this account should be included on the
balance sheet so probably the best is to use the deposit kind when the
account_deposit module is installed and the other type when not installed.

> But usually, you have 1 account deposit per party so you create them and
> they do not come from the standard chart.

But the code groups by line party [1], so it's possible to have multiple
parties on the same account (as the party required flag should be set
for this accounts). Furthermore, I don't see how each party gets it's
deposit account assigned. Am I missing something?

[1]
http://hg.tryton.org/modules/account_deposit/file/11e8fdac3d6b/party.py#l52

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

-- 
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/ecdcffc7-9459-c0ca-2fab-39b7b5807fcb%40koolpi.com.


[tryton-dev] Deposit accounts on Spanish Chart

2018-02-07 Thread Sergi Almacellas Abellana
Hi,

The account_deposit module defines a new kind of account (Deposit
account) but there is no deposit account on the Spanish CoA. After a
little bit of digging i found that the Spanish CoA includes deposit
accounts for customers (4380) and suppliers (4070), so this accounts
should be marked as deposit. This requires to add the account_deposit as
dependency of the account_es module, but not sure if this is the best
way as this module also adds new functionaly on party and invoice which
is not relevant to people not using the deposit functionaly. So my doubt
is the following:

- Why is the deposit type defined on the account_deposit module and not
on the account base module?

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

-- 
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/69746957-357c-6754-e267-9a782db08ae3%40koolpi.com.


Re: [tryton-dev] GTK client - PyGObjectParamFlags has not attribute READWRITE

2018-02-01 Thread Sergi Almacellas Abellana
El 01/02/18 a les 16:24, Raimon Esteve ha escrit:
> Hie,
> 
> Since "Replace deprecated usage of params and signals in GTK+3" [1],
> after login popup I receive an error that has not attribute READWRITE
> 
>      13             "text": (gobject.TYPE_STRING, None, "Text",
>      14                 "Displayed text", gobject.ParamFlags.READWRITE),
> 
> Which version gobject is required?
> 

Which gtk version do you have? Take in account that tryton requires at
least gtk3.20 or later [1], which IIRC is not avaiable on ubuntu 16.04
(should be installed via ppa)

Indeed you should be using python-object 3.20.0. Which is the output the
following command:

apt list python-gobject

You should see something like:

Listing… Fet
python-gobject/xenial,xenial,now 3.20.0-0ubuntu1 all [installed]


Hope it helps.


[1] http://hg.tryton.org/tryton/file/292a067fe066/doc/installation.rst#l8


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

-- 
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/1c999d58-96e3-d264-0239-0ba1d14df6b3%40koolpi.com.


Re: [tryton-dev] set_context to @table_query from Report

2018-01-31 Thread Sergi Almacellas Abellana
El 31/01/18 a les 15:33, Josias Pérez ha escrit:
> I was thinking in something like the code below: 
> 
> In Report
> 
> with Transaction().set_context(_check_access=False):
> date = data['date']
> department = data['deparment']

Then you should have to surround the search with the set_context call:

with Transaction().set_context(
date=data['date'], department=data['department']):
   records = Model.search(domain)
> 
> In table_query
> if Transaction().context.get('date'):
> where &= report.date >= Transaction().context['date']
> if Transaction().context.get('department'):
> where &= report_line.department == Transaction().context['deparment']
> 
> But I dont know if it is possible or a good practice.

Indeed the table query can be directly searched so you be able to
perform the following search on your get_records method:

records = Model.search([
('date', '>=', data['date']),
('department', '=', data['department']),
    ])

For me this is the cleaner solution.

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

-- 
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/13a9c499-ad11-02b1-deb0-de0557019797%40koolpi.com.


Re: [tryton-dev] Adding a sequence on an existing field

2018-01-31 Thread Sergi Almacellas Abellana
El 31/01/18 a les 14:51, Maxime Richez ha escrit:
> I decide to create a custom module to add a sequence on an existing field. In 
> my case, it concerns stock_lot module. There's a field "number" (type char, 
> required=true) that i need to be "sequenced".

I believe there is a generic need to create lot numbers with a sequence
defined. Indeed nantic has a module which allows to configure the
sequence based on the product or on the category [1].

I will be very happy if we find a generic solution that can be part of
tryton.

> Here's the code: https://pastebin.com/74EXsjT7

We use states to save pyson states which. If you want to make it always
readonly you can do:

@classmethod
def __setup__(cls):
super(Lot, cls).__setup__()
cls.number.readonly = True


[1] https://bitbucket.org/nantic/trytond-stock_lot_sequence/src

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

-- 
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/a77876ce-9474-9762-eb7c-7d60b7cec913%40koolpi.com.


Re: [tryton-dev] set_context to @table_query from Report

2018-01-31 Thread Sergi Almacellas Abellana
El 31/01/18 a les 13:04, Josias Pérez ha escrit:
> So, I want to group these result to show only 
> 
> Group 1   45 (which is the expected behavior), dates are not required in the 
> report.
> 
> I was thinking in add the method set_context to the report and send it to the 
> table_query. In a table_query, without report, using an aditional class 
> 'deparment.context' it works fine and give the expected results. 
> 
> Any help will be appreciated. 
I think the better option is to create two diferents table_queries with
different group bys. And then on your report just use the one you want.

In order to simplify the code, you can use a Mixin as done in the
oportunity module:

http://hg.tryton.org/modules/sale_opportunity/file/e65684f7ecbd/opportunity.py#l520

Hope it helps.

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

-- 
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/64abab2b-b669-37fe-3bee-54f8ce5b15a5%40koolpi.com.


Re: [tryton-dev] group by tree with table query

2018-01-07 Thread Sergi Almacellas Abellana
El 06/01/18 a les 12:59, Roei Erez ha escrit:
> Hi Sergi,
> 
> Appreciate your response and help.
> I have a few more questions on this:
> 1. Computing the ids: since this is a custom model for analytics and the 
> records don't really exist, so do I have to create some "fake" ids?
Yes you have to generate the ids. Since you are grouping data, you can
generate the id by combining the ids of the grouped records. Here you
have some examples:

http://hg.tryton.org/modules/sale_opportunity/file/e18efbf79a26/opportunity.py#l678

> 2. I was looking here: http://demo4.4.tryton.org/ and what I need is the 
> Financial/Reporting/Balance Sheet report. To get like a grouped time per test 
> split by users.
> 
> I looked at the source for this but it looks like they have actual records in 
> the database and I am looking to do it with table query without the need to 
> insert a record per test per user just for analytics.
> Deeper looking I saw that the way to tell the client that it is an expanded 
> table is to use the field_childs on the treeview and then returns the child 
> ids in that field. The problem is that I don't have real records with ids, so 
> I wonder if there is and sample that I can look at.

Tryton is based on ids, so you you have to generate the records with ids.



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

-- 
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/c09adfbf-025e-7675-58ff-30b2985ccc46%40koolpi.com.


Re: [tryton-dev] group by tree with table query

2018-01-06 Thread Sergi Almacellas Abellana


On 6 de gener de 2018 2.06.53 CET, Roei Erez  wrote:
>Hi,
>
>We have a system with tests, each Test has a many2one field of User who
>is its executor and a time that the test execution took.
>We would like to show a tree view that shows average time per test and
>when click on a test it is like a pivot table that opens the users and
>show the total per user.
>
>
>Name|  Average Time
>
>+Test1   |2 hours
>  User11  hours
>  User2  | 1 hours
>
>
>We saw such tree views in the client but we would like to implement
>that without inserting real rows into the database for this tree view
>but rather query the information from the existing Test model table
>(using table query maybe?)

Yes you should use a new model which defines the table_query method. This 
method must return a python-sql query with the computed data. In adition to the 
displayed data you must compute the id, create_uid, create_date, write_uid and 
write_date.

In order to open the records detail you can use the tree_open keyword which 
will trigger a new action. This action will recieve the id of the clicked 
record on the active_id keyword. So it mus have a domain like:

[('some_field', '=', Eval('active_id'))] 

In order to show only the related records on the target model.
>
>Appreciate if someone can help here, or refer me to an example of such
>requirements.
>Thanks.



-- 
Enviado desde mi dispositivo Android con K-9 Mail. Por favor, disculpa mi 
brevedad.

-- 
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/6372D961-F7EC-4192-998A-AC8ADDF489B2%40koolpi.com.


Re: [tryton-dev] Extending python-sql

2018-01-04 Thread Sergi Almacellas Abellana
El 04/01/18 a les 18:13, 'Udo Spallek' via tryton-dev ha escrit:
> Hi,
> 
> Thu, 4 Jan 2018 15:31:45 +0100
> Sergi Almacellas Abellana <se...@koolpi.com>:
>> El 04/01/18 a les 11:26, Cédric Krier ha escrit:
>>> In general, I think it is the wrong way to implement a discount. The
>>> discount should modify the unit price. 
> 
> Is this in general your proposal?
> 
> On sale.line/invoice.line, if there is a product, it has a list price.
> We can calculate the percentage between product list price and line unit
> price as line discount.
> When changing unit price value the discount to the product list_price
> is re-calculated.
> When changing discount value, the unit price is re-calculated from
> product list_price.
> As an exception the unit price also can be an individual amount if
> there is no product given. Without a product, there is no discount,
> the discount field becomes invisible.

Moreless. Probably the discount can be a functional field which should
update the unit_price.

But this will be better discusses as a blueprint on
https://discuss.tryton.org/



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

-- 
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/bed9d94f-6276-ea30-d20b-f3cd680db019%40koolpi.com.


Re: [tryton-dev] Extending python-sql

2018-01-04 Thread Sergi Almacellas Abellana
El 04/01/18 a les 11:26, Cédric Krier ha escrit:
> In general, I think it is the wrong way to implement a discount. The
> discount should modify the unit price. Otherwise you are changing the
> definition of the field 'unit_price' and this may break other modules
> which may rely on it.
I agree with Cèdric here.

Indeed if you are interested on having discount information on
sales/invoices (not sure if really required for purchase), you should
probably start a blueprint as I think it's generic enough to have it on
base.

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

-- 
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/3dc2a9e2-2124-1f8b-313a-b9f9da6fda34%40koolpi.com.


Re: [tryton-dev] Calling find method in scenario

2017-12-14 Thread Sergi Almacellas Abellana

El 14/12/17 a les 08:41, Christophe (.net) ha escrit:

Hello,

I try to calling 'find' method in a scenario with this piece of code:

Period = Model.get('account.period')
period = Period.find(company.id)
The problem is that the find method on attribute is used to perform a 
search. And that's why you get an error.


Indeed, the find method is not available throw RPC and thus it's not 
possible to call it on proteus.


Hope it helps.

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

--
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/9661e203-ef83-9dc4-b10a-cd28fb49a7df%40koolpi.com.


Re: [tryton-dev] Advices or good practices when developping multiple custom modules...

2017-12-12 Thread Sergi Almacellas Abellana

El 12/12/17 a les 13:52, Maxime Richez ha escrit:

All the content was in one directory with the customization of the different 
modules in sub-directories...
Indeed this is possible to do via entry points. So you have one 
repository, with one folder for each module. Then you define a setup.py 
for the repository which installs all the modules, but you can activate 
the ones you want depending on the database.


If somebody is interested, an example can be found on the kalensis project:

https://bitbucket.org/kalenis/kalenislims/src/46ae88ada935934103c9f87460236cf34173298d/setup.py?at=default=file-view-default#setup.py-43

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

--
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/4587b250-e29c-5fda-14f4-8a1a8f0df5a6%40koolpi.com.


Re: [tryton-dev] Adding images in reports

2017-12-07 Thread Sergi Almacellas Abellana

El 07/12/17 a les 13:35, edbo.des...@gmail.com ha escrit:

Hello All,

We want to add dynamically created images to a report, but we can't get it 
working :-( . It's a generated 2D-barcode based on a product code. We added a 
frame an added on tab Options as name image: (record.barcode, 'image/png'), but 
we only get a strange line and not a 2D-barcode.
We also added a binary-field to the product to see if that was going to work, 
but we get the same result.

Does anybody got this working and can you provide an example?


Which library are you using to generate the barcode?

We are using pyBarcode without problems. Here is the relevant code:



import barcode 


from barcode.writer import ImageWriter


class Product:

barcode = fields.Function(fields.Binary("Barcode", 

states={ 

'invisible': ~Eval('barcode'), 

}), 


'get_barcode')



def get_barcode(self, name): 

fd = BytesIO() 

barcode.generate( 

'ean13', self.code[:12].zfill(12), 

writer=ImageWriter(), output=fd) 

fd.seek(0) 


return fields.Binary.cast(fd.read())


This should show without problems on the report.

[1] https://pypi.python.org/pypi/pyBarcode/0.8b1


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

--
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/5564e07f-eb82-9297-8c9e-f8a502e3b4d2%40koolpi.com.


Re: [tryton-dev] Checking Server connection on a text-only installation

2017-11-30 Thread Sergi Almacellas Abellana

El 30/11/17 a les 07:51, Nicolas Évrard ha escrit:

* Axel Braun  [2017-11-30 06:39 +0100]:

Morning,


Hello,

I can access a server with a working Tryton installation remote per 
SSH - no

GUI installed.
Is there a way to check if connections to the server are accepted? 
means, Can I
simulate the server connection from the commandline somehow? Proteus 
maybe?

(connection check via telnet is not working...)


If the server is running and listening and if telnet does not work
then you can not reach the server and it's probably a network
configuration issue.

You can also use curl to list all the databases with the following comand:

curl -H "Content-Type: application/json" -d '{"method": 
"common.db.list", "params": []}' -X POST http://localhost:8000/


This will validate that the server is up and it can connect to the 
database.


Hope it helps.

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

--
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/3fd476a9-ba93-5eb3-358f-4e714eefd91f%40koolpi.com.


Re: [tryton-dev] Help on Pyson Statement

2017-11-24 Thread Sergi Almacellas Abellana

El 24/11/17 a les 12:09, Sergi Almacellas Abellana ha escrit:


I will create an issue in order to fix it.

Done: https://bugs.tryton.org/issue6964

It will be great if you can test it :)

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

--
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/6702f829-a73f-3f3b-a7b3-0082fe94b1f0%40koolpi.com.


Re: [tryton-dev] Help on Pyson Statement

2017-11-24 Thread Sergi Almacellas Abellana

El 24/11/17 a les 12:02, Maxime Richez ha escrit:

You have some examples in the test suite:

http://hg.tryton.org/trytond/file/34073513c887/trytond/tests/test_modelview.py#l194

Have you tried?:

Eval('self', {}).get('total_amount', 0) > 500

Hope it helps.

Thanks but we are testing from the tryton client, and expression is not a valid 
Pyson expression. Is there a way to convert your expression  in the gui client ?
We convert your expression with PYTHONEncoder and then we introduce the result 
in the GUI, and it's working whith this value:
{"s2": 500, "s1": {"d": 0, "k": "total_amount", "__class__": "Get", "v": {"d": {}, "__class__": "Eval", "v": 
"self"}}, "e": false, "__class__": "Greater"}

Is there a tool in the gui to convert expression to Pyson ?


Indeed there is a widget to manipulate the pyson statements on the 
tryton client [1]. You should be able to enter the pyson expresion on 
client and it will automatically encode the values when sending to the 
server.


But I see the widget is not activated for this field.

I will create an issue in order to fix it.

Thanks,

[1] https://bugs.tryton.org/issue4631

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

--
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/0db91268-bd6e-2585-3737-0c0968510123%40koolpi.com.


Re: [tryton-dev] Help on Pyson Statement

2017-11-24 Thread Sergi Almacellas Abellana

El 24/11/17 a les 11:15, Maxime Richez ha escrit:

Hi,

We are looking to define a specific rule on a button (Models-> Models Access -> 
Buttons). Rule would be : 2 users needs to validate button if amount is greater than 
a specific value.
We try this expression : [["total_amount", ">", 500]] > This is not working. 
What should be the correct expression ?

You have some examples in the test suite:

http://hg.tryton.org/trytond/file/34073513c887/trytond/tests/test_modelview.py#l194

Have you tried?:

Eval('self', {}).get('total_amount', 0) > 500

Hope it helps.


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

--
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/ed8ab58c-9215-e20b-8d66-f1160575b649%40koolpi.com.


Re: [tryton-dev] RFC: First reporting implementation

2017-11-20 Thread Sergi Almacellas Abellana

El 20/11/17 a les 16:06, Cédric Krier ha escrit:

On 2017-11-20 14:45, Sergi Almacellas Abellana wrote:

El 19/11/17 a les 00:39, Cédric Krier ha escrit:

Hi

There are still some improvement that could be done on the client:

  - switch window action from an active tab

Don't understand why you mean.


As we will have a lot of report based on different ModelSQL. Instead of
having a menu entry for each of them, I think it will be better to have
a single entry with many actions. This is already supported by the
client but it will just show in a popup a selection for the action to
run. I want to have this selection the tab and be able to change it at
any time.


Wow, this will be great. Probably the best is to ask for the menu option 
on the first load of the action (like done now) and then add some button 
in order to change it. This button can be probably near the action name 
in the client toolbar.




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

--
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/afb61b3b-374c-c5d2-353e-defc92e71e1e%40koolpi.com.


Re: [tryton-dev] RFC: First reporting implementation

2017-11-20 Thread Sergi Almacellas Abellana

El 19/11/17 a les 00:39, Cédric Krier ha escrit:

Hi

There are still some improvement that could be done on the client:

 - switch window action from an active tab

Don't understand why you mean.

 - allow graph on date to fill by month or year
Indeed it will be also great to only show the relevant part of a date on 
the tree view. So if we are grouping per month only 11/2017 is show 
(currently it shows 01/11/2017).



[1] https://discuss.tryton.org/t/reporting-of-aggregated-data/437
[2] https://discuss.tryton.org/t/sale-reporting-of-aggregated-data/438
[3] https://bugs.tryton.org/issue6944

I guess this is: https://bugs.tryton.org/issue6948





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

--
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/b7f1df08-c725-4819-dae7-2e7b94367b11%40koolpi.com.


Re: [tryton-dev] Strange error installing sale opportunity

2017-11-16 Thread Sergi Almacellas Abellana

El 15/11/17 a les 18:10, Oscar Andres Alvarez Montero ha escrit:

Hi, any knows why this error? Tryton 4.2
Somebody reported a very similar error on the purchase_request module, 
which was caused by a third party module.


Indeed the module did not raise any problem on the drone server. See:

https://drone-old.tryton.org/trypod.tryton.org/tryton/modules.sale_opportunity/4.2/79707ab4cb970b9d0e7dcd28c34bed2220b9b413

Are you sure this is not related to a custom module?



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

--
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/7428209d-3c9f-953c-48dc-d14677a13022%40koolpi.com.


Re: [tryton-dev] Re: Add test to check number of SQL query generated

2017-09-28 Thread Sergi Almacellas Abellana

El 28/09/17 a les 10:29, Jérémy Mousset ha escrit:

Hi,

I like the idea of having tests on performances. 


Testing performance is always a good idea. The problem is introducing it 
on unit test as it can fail for some cases but you will want to accept 
the change. Also we should update the test case for each improvement.


I'm not sure if checking the max number of queries for a given operation 
is the best way to do it though. (as in some cases several small queries 
can be faster than a single large one).  It may be better than nothing 
though.


The problem is what to measure, as probably the performance will depend 
on the hardware, os and other unknown variables. For me the way to go 
will be probably something like python speed [1] but this seems a lot of 
effort.



[1] https://speed.python.org/changes/


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

--
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/315e432c-86aa-0b92-52b5-f13b082c0056%40koolpi.com.


Re: [tryton-dev] Sync pool between process

2017-08-28 Thread Sergi Almacellas Abellana

El 28/08/17 a les 15:04, Cédric Krier ha escrit:

It is not for me because the problem is in the UI because admin user is
not necessary and server administrator. But if the feature is limited to
server administrator, there is no problem.
When using an orchestration system (like kubernetes), there is no tryton 
server administration because the system administrator only administres 
the orchestration system, and is this system which manages the 
applications states.


In kubernetes this is managed by using Readyness proves [1], which will 
query (on an interval time) to each server if it's ready to serve and 
restart it if not ready. Having some pragmatic way to know if the 
process pool have all the required modules, will allow to solve the 
problem for us.


[1] 
https://kubernetes.io/docs/tasks/configure-pod-container/configure-liveness-readiness-probes/


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

--
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/c3380cf8-c009-9ee6-f422-1734b010e49b%40koolpi.com.


Re: [tryton-dev] Sync pool between process

2017-08-28 Thread Sergi Almacellas Abellana

El 28/08/17 a les 12:46, Cédric Krier ha escrit:

On 2017-08-28 12:14, Sergi Almacellas Abellana wrote:

Hi,

Currently there is a weird behavior if new modules are installed when
running multiple instances of trytond (as separate process). The problem
is that only one process has the updated pool definition and the other
process will fail with a KeyError when try to get the new created models.

I think this can be solved like we sync the cache resets between instances:

1. Store on the database the pool version.
2. Each time the pool is updated, a new version is saved on the database.
3. Before staring a request that requires the pool, fetch the version
from database and  check if it matches with the current pool version
(stored in memory). If it does not match, reload the pool before
processing the request.

This has the drawback that adds one additional query *per request*.

Thoughts?


For me, activate modules from the UI has always been a gadget (or for
simple setup). 


Indeed this has nothing to do with the UI, as it can be reproduced with 
trytond-admin also.


On larger setup with multiple server, the activation

should be part of a larger maintenance process which should restart all
of them.


The problem I see here is that there is no standard process. Let me 
explain:


Everyone can deploy the processes in different ways, so each different 
way of deployment should develop a larger maintenance process that fits 
its needs.


So we should probably define a standard way or some common procedure.

For us, it will be enough to be able to query the server and return some 
status code to know which instances are not updated.




My second point, is that adding a extra query for each request just of
the very rare case of activating a new module is really too much costly.


I will like to avoid this query on each request too, probably it will be 
enough to do it on some time interval.


Indeed I would prefer to have a configuration option that disable the
activation of module from the UI.



That can be achieved by restricting permissions on the UI buttons and 
actions. But for me it's out of the scope of this discussion.


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

--
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/21a4f41e-e831-7310-bf0a-e24ff9b56fc9%40koolpi.com.


[tryton-dev] Sync pool between process

2017-08-28 Thread Sergi Almacellas Abellana

Hi,

Currently there is a weird behavior if new modules are installed when 
running multiple instances of trytond (as separate process). The problem 
is that only one process has the updated pool definition and the other 
process will fail with a KeyError when try to get the new created models.


I think this can be solved like we sync the cache resets between instances:

1. Store on the database the pool version.
2. Each time the pool is updated, a new version is saved on the database.
3. Before staring a request that requires the pool, fetch the version 
from database and  check if it matches with the current pool version 
(stored in memory). If it does not match, reload the pool before 
processing the request.


This has the drawback that adds one additional query *per request*.

Thoughts?

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

--
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/4746ea51-d549-1ef0-61c9-ec7ae9ad513d%40koolpi.com.


Re: [tryton-dev] Comparison support for Pyson Date tipes

2017-08-18 Thread Sergi Almacellas Abellana

El 18/08/17 a les 08:08, Juan Ramon Alfaro Martinez ha escrit:

Hello.


Hi,

I have need to campare a Date in pyson and I have modified pyson.py in trytond 
to support it, if someone wants to push upstream this is the patch.


There is an issue to add support to them:

https://bugs.tryton.org/issue4879

So feel free to join the issue to discuss about it.

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

--
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/b6c685cf-2cd8-9184-9e80-b997adcc83aa%40koolpi.com.


Re: [tryton-dev] Covert datetime as date in a sqlite pythonsql query

2017-06-27 Thread Sergi Almacellas Abellana

El 26/06/17 a les 16:31, Nicolás López Solano ha escrit:
Yes i tried. For postgresql it return a correct date but for sqlite it 
return only the year of the datetime base column.


If i work directly executing sql (select cast(column as date) from 
mytable) over a sqlite file i get a similar "not good" result. Cast 
sqlite native functión can't covert to date.
Right, I can reproduce it on my local environemnt. In order to get a 
proper date on sqlite you can use:


SELECT Date(column)

instead of

SELECT Cast(column as date)

So I ended up with the following code:

from sql.functions import Function

class SqlLiteDate(Function):
__slots__ = () 


_function = 'DATE'

if backend.name() == 'sqlite':
date = SqliteDate(column)
else:
date = Cast(column, 'DATE')

Hope it helps!

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

--
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/906ca9f7-71dc-deef-46ee-0210e427d137%40koolpi.com.


Re: [tryton-dev] Covert datetime as date in a sqlite pythonsql query

2017-06-26 Thread Sergi Almacellas Abellana

El 26/06/17 a les 16:07, Nicolás López Solano ha escrit:

Hi,

I need to writte a pythonsql query with a date column computed 
converting a datetime column. I'm using Cast function to do that but 
only works for postgresql and i need it works for sqlite too. I tried to 
use anothers pythonsql functions like ToDate or DatePart but only work 
for postgresql too.

Can you show which current code do you have?

Have you tried:

Cast(column, 'DATE')

Which errors do you have?


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

--
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/5f0a2c6d-e249-5d57-6019-cc246090498b%40koolpi.com.


Re: [tryton-dev] uri = postgresql:/// depreciated?

2017-06-26 Thread Sergi Almacellas Abellana

El 25/06/17 a les 10:50, Axel Braun ha escrit:

Hi Sergi,

thanks for your input!
I changed connection to TCP and used uri = 
postgresql://uswer:passwd@localhost:5432

No idea why the former method is not working anymore

I give a quick test and posgresql:/// is working correctly for me.



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

--
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/204ccbb8-e87d-f1f1-d377-49bba4b2d62b%40koolpi.com.


Re: [tryton-dev] uri = postgresql:/// depreciated?

2017-06-21 Thread Sergi Almacellas Abellana

El 20/06/17 a les 07:12, Axel Braun ha escrit:

Morning,
the above connection string was always working fine - now I have some 
trouble in initializing a database using this string - trytond-admin 
always looks for test42.sqlite instead of the test42-db on postgres. 
Trytond is 4.2.4

Thanks
Axel


If it's looking for sqlite instead of postgres the problem is that the 
default config is used. Make sure that:


- You reference the correct configuration file
- The user running trytond is allowed to read the config file. trytond 
will sillently discard the files that is not allowed to read.
- There is no other trytond config file that overrides this setting, in 
case that you are using multiple files.


Hope it helps.


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

--
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/11df5c7f-0738-66a0-5224-fba642498c8b%40koolpi.com.


Re: [tryton-dev] Using property (tryton 4.2) on domain field

2017-06-20 Thread Sergi Almacellas Abellana


On 20 de juny de 2017 17.01.24 CEST, Maxime Richez  
wrote:
>
>
>>
>> I agree with Cedric here. Specially if you want to use it on a
>domain. Let 
>> me explain: 
>>
>> If you store it on the configuration, changing the value on the 
>> configuration may invalidate all the existing records domain.
>Creating a 
>> static category with xml records will prevent it. 
>>
>>
>But if i change the xml category on the product, problem will also be
>the 
>same  (but with less impact, or i can prevent to change product
>category )?

If you have a domain it can not be changed as the domain will ensure it.

-- 
Enviado desde mi dispositivo Android con K-9 Mail. Por favor, disculpa mi 
brevedad.

-- 
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/B0F425C5-72A7-4EFF-A80D-7927166D6340%40koolpi.com.


Re: [tryton-dev] Using property (tryton 4.2) on domain field

2017-06-20 Thread Sergi Almacellas Abellana


On 20 de juny de 2017 16.23.57 CEST, "Cédric Krier"  
wrote:
>On 2017-06-20 06:20, Maxime Richez wrote:
>> Hi,
>> 
>> Here's my small problem in Tryton 4.2, i want to filter products on a
>
>> specific product category. I define those category as a property in a
>
>> configuration.
>
>Why using a Property field?
>
>> My code is here: https://pastebin.com/wDF8qGtX
>> 
>> So in my main class (PrinterModel), i define a function field on
>product 
>> category to get the default category stored in configuration... 
>> (printer_category).
>> 
>> This function field is used in my domain for the product to get only 
>> products from a specific category (and children too)  (printer_model
>field)
>> 
>> My code wasn't working until i define a default_printer_category...
>code is 
>> redundant but it's working.
>> 
>> My question: is it necessary to use a function field for the domain
>or can 
>> i evaluate a function in domain ?
>
>Only field of a model can be evaluated by PYSON.
>There is the PYSON.Id but it will require that you create the category
>in XML.
>
>> If not, how to avoid code redundancy for 
>> default_ method and get_ method for the function field ? 
>
>You can call the default_ method from the getter method.
>But you need to have both because the getter will be called only once
>the record is saved/created.
>
>> Is there a better way to implement this "filter" ? i'm looking for
>examples 
>> in code but unsuccessfully.
>
>I think the creation of categories from XML could be a good option.

I agree with Cedric here. Specially if you want to use it on a domain. Let me 
explain:

If you store it on the configuration, changing the value on the configuration 
may invalidate all the existing records domain. Creating a static category with 
xml records will prevent it.

-- 
Enviado desde mi dispositivo Android con K-9 Mail. Por favor, disculpa mi 
brevedad.

-- 
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/395E6C43-660B-4D6C-84F1-6F8F4A73D2C8%40koolpi.com.


Re: [tryton-dev] Try and test a new module.

2017-06-06 Thread Sergi Almacellas Abellana

El 06/06/17 a les 10:08, Christophe ha escrit:

Le mardi 6 juin 2017, 09:39:06 Sergi Almacellas Abellana a écrit :

El 06/06/17 a les 09:33, Christophe ha escrit:

Hi,

I would like to test the module 'account_budget' but I can not find where
i can clone it ?
Is there a 'how to' to retrieve the modules in test?

I imagine you refer to the reviews ofhttps://bugs.tryton.org/issue6089

In order to get a review of a new module, you have to create an empty
mercurial repository and download the review to it. The commands will be:

mkdir account_budget
cd account_budget
hg init .
hg review --fetch -i X

where XX is the review id.

Hope it helps.

Thanks to your answer, but i cannot retrieve the code. The authentication
proccess seems to be alright (a message in browser said 'The authentication
flow has completed') but i have this error :

Unable to fetch the patch: HTTP Error 404: Not Found

and after some time this message appears :

1496736074772 addons.productaddonsERROR   Request failed certificate
checks: [Exception... "SSL is required and URI scheme is not https."
nsresult: "0x8000 (NS_ERROR_UNEXPECTED)"  location: "JS frame ::
resource://gre/modules/CertUtils.jsm  :: checkCert :: line 145"  data: no]

any idea ?
Which host are you using as codereview? (see the review section of your 
~/.hgrc file)




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

--
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/2bae4516-dfd3-db63-f80d-271461339963%40koolpi.com.


Re: [tryton-dev] Try and test a new module.

2017-06-06 Thread Sergi Almacellas Abellana

El 06/06/17 a les 09:33, Christophe ha escrit:

Hi,

I would like to test the module 'account_budget' but I can not find where i can
clone it ?
Is there a 'how to' to retrieve the modules in test?

I imagine you refer to the reviews of https://bugs.tryton.org/issue6089

In order to get a review of a new module, you have to create an empty 
mercurial repository and download the review to it. The commands will be:


mkdir account_budget
cd account_budget
hg init .
hg review --fetch -i X

where XX is the review id.

Hope it helps.

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

--
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/ef5fdcda-e0d7-f967-94ca-a5ab4c03f439%40koolpi.com.


Re: [tryton-dev] Dinamic views

2017-05-30 Thread Sergi Almacellas Abellana

El 30/05/17 a les 15:13, Raimon Esteve ha escrit:

Hie Sergi

2017-05-30 12:42 GMT+02:00 Sergi Almacellas Abellana <se...@koolpi.com>:

El 24/05/17 a les 08:13, Raimon Esteve ha escrit:


Other module that use DynamicModel is survey. The PoolMeta was moved
into the class.

https://bitbucket.org/zikzakmedia/trytond-survey/


I'm wondering why you use dynamic model here, instead of using a Dict field
to store the survey values.


I'm not sure with Dict fields you could:

- tree/form views and menus to acces to news models
-  Navigation into fields: m2o, m2m,...


The only think you miss is m2o foreign keys check. But why you need it 
for surveys?


Indeed, you will not have any new models using a dict field. But all the 
survey results stored on the same table, which provides more flexibility 
in case new fields are added to the survey when new values already exist.



- Searchable (without function fields)


What's the problem with function fields? Dict fields can be searched on 
the database (and have indexes if using JSONB on PostgreSQL).



- Integrate with third tools (BI) and without transform/extract data


AFAIU third tools can also read json values, so I do not see the point.

- 

In other modules,you could see we use dict fields to storage some data.


Don't understand.



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

--
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/1adde7b2-49f2-0996-0854-f73edad091b5%40koolpi.com.


Re: [tryton-dev] Dinamic views

2017-05-30 Thread Sergi Almacellas Abellana

El 24/05/17 a les 08:13, Raimon Esteve ha escrit:

Other module that use DynamicModel is survey. The PoolMeta was moved
into the class.

https://bitbucket.org/zikzakmedia/trytond-survey/
I'm wondering why you use dynamic model here, instead of using a Dict 
field to store the survey values.




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

--
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/fa743945-f26a-c96e-98be-b1a9bade08ce%40koolpi.com.


Re: [tryton-dev] Tryton 4.2 is slow compared to previous versions

2017-05-29 Thread Sergi Almacellas Abellana

El 29/05/17 a les 13:58, Jan Grasnick | Grasbauer UG ha escrit:

Am 29.05.2017 um 11:58 schrieb Nicolas Évrard:

* Sergi Almacellas Abellana  [2017-05-29 10:07 +0200]:

El 26/05/17 a les 17:51, Maximilian Holtzberg ha escrit:


You can try to run the client over mitmproxy like this:
mitmproxy -R http://localhost:8000 -p 8088
and connect the client to it. It gives you some timing informations
like:

First request byte  2017-05-26 12:07:21.961
Request complete2017-05-26 12:07:21.985
First response byte 2017-05-26 12:07:22.027
Response complete   2017-05-26 12:07:22.043


You are still not proving any evidence that trytond is slower.
And also don't providing details about the setup-up.

I had the same issue with 4.2 and replaced werkzeug with cherrypi. Since
it happened in a very strange environment (windows, trytond in cygwin) I
didn't give it much thought. But the improvement was significant (from
mostly unusable to wow :) . I don't know your environment but you can
give it a try and report back your results . So we have an entry point
for further investigations.

trytond default comandline uses werkzeug run_simple [1] which as 
explained on their docs [2] it performs poorly under high load. Indeed, 
there is some thread on this list [3] explaining how to configure it as 
WSGI server, which will provide better performance.


Hope it helps.


[1] http://hg.tryton.org/trytond/file/93b914901108/bin/trytond#l46
[2] http://werkzeug.pocoo.org/docs/0.12/serving/#werkzeug.serving.run_simple
[3] https://groups.google.com/d/msg/tryton-dev/GI2h2cSUG6A/e2F2H3nXBQAJ

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

--
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/b0250ed5-87ac-b938-cbc5-10bcbb5933ce%40koolpi.com.


Re: [tryton-dev] Tryton 4.2 is slow compared to previous versions

2017-05-29 Thread Sergi Almacellas Abellana

El 26/05/17 a les 17:51, Maximilian Holtzberg ha escrit:

On 26.05.2017 16:59, Sergi Almacellas Abellana wrote:

El 26/05/17 a les 15:10, Raimon Esteve ha escrit:

Hie Cédric

2017-05-26 14:57 GMT+02:00 Cédric Krier <cedric.kr...@b2ck.com>:

On 2017-05-26 14:09, Raimon Esteve wrote:

Hello,

2017-05-25 21:42 GMT+02:00 appu rongala <appu.rong...@gmail.com>:

Hi Devs,

I have installed tryton4.2  and i feel it is slower than previous
versions.
I have tryton3.4 installed and that is faster than 4.2.
Am i doing anything wrong?

Yes, since 4.0 is more slower than 3.8, 3.6... when have big data or
complex forms. We tested with bin/trytond and WSGI app.

Without any standard measurements, we can not say anything.
If you have such data, please share it. And also the tools to make the
measures.
We also need to know what is measured? Tryton is a complex software with
many usages. It does not make sense to just say "it is slow".

start a client action -> trytond -> finally the response client.



On which client actions? How you are running both servers? Which
database server? How long takes to process a request on each version?
How many requests have you executed? Is the first request or the other
ones?

There are too much factors that can influence, so if you do not provide
meaningful examples, it's useless.


You can try to run the client over mitmproxy like this:
mitmproxy -R http://localhost:8000 -p 8088
and connect the client to it. It gives you some timing informations
like:

First request byte  2017-05-26 12:07:21.961
Request complete2017-05-26 12:07:21.985
First response byte 2017-05-26 12:07:22.027
Response complete   2017-05-26 12:07:22.043


You are still not proving any evidence that trytond is slower.
And also don't providing details about the setup-up.

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

--
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/62f41c7e-0697-a429-f576-a091a13c2627%40koolpi.com.


Re: [tryton-dev] Tryton 4.2 is slow compared to previous versions

2017-05-26 Thread Sergi Almacellas Abellana

El 26/05/17 a les 15:10, Raimon Esteve ha escrit:

Hie Cédric

2017-05-26 14:57 GMT+02:00 Cédric Krier <cedric.kr...@b2ck.com>:

On 2017-05-26 14:09, Raimon Esteve wrote:

Hello,

2017-05-25 21:42 GMT+02:00 appu rongala <appu.rong...@gmail.com>:

Hi Devs,

I have installed tryton4.2  and i feel it is slower than previous versions.
I have tryton3.4 installed and that is faster than 4.2.
Am i doing anything wrong?

Yes, since 4.0 is more slower than 3.8, 3.6... when have big data or
complex forms. We tested with bin/trytond and WSGI app.

Without any standard measurements, we can not say anything.
If you have such data, please share it. And also the tools to make the
measures.
We also need to know what is measured? Tryton is a complex software with
many usages. It does not make sense to just say "it is slow".

start a client action -> trytond -> finally the response client.



On which client actions? How you are running both servers? Which 
database server? How long takes to process a request on each version? 
How many requests have you executed? Is the first request or the other 
ones?


There are too much factors that can influence, so if you do not provide 
meaningful examples, it's useless.





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

--
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/55e108f0-ce4f-35c6-0dae-e796c34215d7%40koolpi.com.


Re: [tryton-dev] Tryton 4.2 is slow compared to previous versions

2017-05-26 Thread Sergi Almacellas Abellana

El 25/05/17 a les 21:42, appu rongala ha escrit:

Hi Devs,

I have installed tryton4.2  and i feel it is slower than previous versions.
I have tryton3.4 installed and that is faster than 4.2.
Am i doing anything wrong?


I don't know, but what is "slower" or "faster". Could explain which 
actions are you doing? Do you know how much slower?


Could you explain a little bit, how is your setup? i.e: Databse, Server 
OS...




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

--
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/86582dc8-f90c-4e0a-d8df-9e2e48e4cd87%40koolpi.com.


Re: [tryton-dev] Dinamic views

2017-05-24 Thread Sergi Almacellas Abellana

El 23/05/17 a les 23:37, Oscar Alvarez ha escrit:

but I can not install babi because is not compatible with python3, I
fixed setup.py, but I get still on install:

Have a look at:

https://bitbucket.org/nantic/trytond-babi/pull-requests/43/add-python3-support/diff



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

--
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/fbb73139-8391-7bf8-02ae-e0caa8756bc7%40koolpi.com.


Re: [tryton-dev] view_ids in Many2One

2017-05-16 Thread Sergi Almacellas Abellana

El 16/05/17 a les 02:31, Pablo Padulles ha escrit:

  * |view_ids|: A comma separated list that specifies the view ids used
to display the relation.

don't work in a M2O fields.



the tree work good, but de form no.

Is there any way to do it?


This is the only way to do it.

Have you restarted the server and the client, after changing the view in 
order to refresh the changes?


If it does not work it's a bug and should be reported.

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

--
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/bfe8cf96-9fc7-4b84-fe30-ce82ec2f1cf3%40koolpi.com.


Re: [tryton-dev] Testing request for issue4620

2017-05-11 Thread Sergi Almacellas Abellana

El 11/05/17 a les 08:49, Cédric Krier ha escrit:

Hi,

I would like to have more feedback about https://bugs.tryton.org/issue4620
It is important because it will fix https://bugs.tryton.org/issue6494
which will be backported to 4.4 and released ASAP.



JFTR if you want to test on 4.4, you have too apply 
https://bugs.tryton.org/issue6491 patch's also.



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

--
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/3c751610-564f-232f-b03d-0f546d6822cd%40koolpi.com.


Re: [tryton-dev] Problems using one2many and many2many fields

2017-05-03 Thread Sergi Almacellas Abellana

El 03/05/17 a les 16:55, Carlos Ibrahim Arias ha escrit:

I created the model Z_MecialHistory to store information of the patient
(/date, patient and healthprofessional/) and it is related to the model
PatientData. The point is that, as Albert said, I need to access to the
information in the model PatientEvaluation.

After adding the function field Albert recommended to the model
PatientEvaluation


|
z_medical_history
=fields.Function(fields.Many2Many('gnuhealth.z_medical_history',
 None,None,'Historial Medico del Paciente'),'get_z_medical_history')

|

... I added the following function to PatientEvaluation model guessing
that I had to use the current patient 

|
defget_z_medical_history(self,name):
pool =Pool()
Patient=pool.get('gnuhealth.patient')
returnPatient.z_medical_history
|

But it doesnt work... I dont really understant how to the get function
should be coded to worrk...
You should return the list of ids of the related record. So it will be 
something like:


def get_z_medical_history(self, name):
pool = Pool()
History = pool.get('...')
return [x.id for x in History.search([('patient', '=', self.id)])


Hope it helps.

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

--
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/2c1e7d40-5ad2-7d26-d4bf-de6d8c850fad%40koolpi.com.


Re: [tryton-dev] Best way to test for a date in a date field

2017-05-03 Thread Sergi Almacellas Abellana

El 02/05/17 a les 07:59, Vincent Bastos ha escrit:

Hi,

I wanted to know what the best way to write a domain for a search call
to test for records that have a date in a particular field.

My idea is something like this:

nodate = Date(0)

invoices = Invoice.search([
('lease', '=', self.id),
('state', '!=', 'paid'),
('mydate', '!=', nodate),
], order=[('invoice_date', 'ASC')])
Not sure to understand, but if you want to search for invoices where the 
mydate field is empty you can search for None as values. The clause will be:


('mydate', '=', None)

Hope it helps.

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

--
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/a3d39cd9-3534-6baa-020d-551ba2f345ad%40koolpi.com.


Re: [tryton-dev] 'Processing ...' don't disappear in web client (Tryton 4.3)

2017-04-28 Thread Sergi Almacellas Abellana

El 28/04/17 a les 09:50, Christophe ha escrit:

Le vendredi 28 avril 2017, 09:45:46 Sergi Almacellas Abellana a écrit :

El 28/04/17 a les 09:18, Christophe ha escrit:

Le jeudi 27 avril 2017, 08:53:30 Cédric Krier a écrit :

On 2017-04-27 07:52, Christophe wrote:

Le mardi 25 avril 2017, 10:47:38 Cédric Krier a écrit :

...
Neither, you should not use minified version for debugging.

Of course :-), how do I run the web client in normal mode?

By building sao for dev:
$ grunt dev

Thank, it is done.
Now my error in console :

TypeError: prm.resolve is not a function
http://localhost:8000/dist/tryton-sao.js
Line 6538

Its seems a bug. Which sao version are you using?

4.3.0



Sorry, I wanted to know the mercurial changeset since 4.3.0 is 
development version.


I tested on your first email and I was unable to reproduce it, but I'm 
able to reproduce it on the latest trunk version. So I will try to 
provide a fix for it.


Meanwhile: can you fill an issue on the bug tracker?


Thanks.


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

--
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/4a2b7fd2-9ec7-b745-3b05-3894f95dcb68%40koolpi.com.


Re: [tryton-dev] 'Processing ...' don't disappear in web client (Tryton 4.3)

2017-04-28 Thread Sergi Almacellas Abellana

El 28/04/17 a les 09:18, Christophe ha escrit:

Le jeudi 27 avril 2017, 08:53:30 Cédric Krier a écrit :

On 2017-04-27 07:52, Christophe wrote:

Le mardi 25 avril 2017, 10:47:38 Cédric Krier a écrit :

...
Neither, you should not use minified version for debugging.

Of course :-), how do I run the web client in normal mode?

By building sao for dev:

$ grunt dev

Thank, it is done.
Now my error in console :

TypeError: prm.resolve is not a function
http://localhost:8000/dist/tryton-sao.js
Line 6538

Its seems a bug. Which sao version are you using?

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

--
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/daed1c45-f24a-88d9-c913-254db3d78ed1%40koolpi.com.


Re: [tryton-dev] Re: Removal of *DAV for 4.4

2017-04-04 Thread Sergi Almacellas Abellana

El 04/04/17 a les 07:19, Richard PALO ha escrit:

Le 02/04/2017 à 23:21, Cédric Krier a écrit :

Hi,

I think there is a good consensus about removing the *DAV stuffs.
We did not have time to implement the two features mentioned in
https://discuss.tryton.org/t/removal-of-dav/304 (attachment sharing and
VCard). But I do not think thos should prevent us from not releasing *DAV
module for 4.4 and deprecate them immediately.
So if there are no valid objection, I will deprecate them for the coming
freeze.
Bonus point, this will make the server part fully Python 3.


PS: I already started to work on the attachment sharing but I do not
want to rush it as there are some security design choice.



Is there a 'remove' function that could be added to trytond-admin to
avoid and
get over errors such as 'IOError: File not found' for modules no longer
present?
If you don't have the module installed on the database you can clear the 
ir.module record by executing the following query:


DELETE FROM ir_module where name = '';

If you have the module isntalled, just uninstall it and then execute the 
same query.


Hope it helps.

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

--
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/4c6827e3-4381-e03e-d678-17cfff4a8025%40koolpi.com.


Re: [tryton-dev] Removal of Property

2017-03-29 Thread Sergi Almacellas Abellana

El 29/03/17 a les 00:12, Cédric Krier ha escrit:

Hi,

The patches that removes the Property fields is ready for testing. It
is passing all the tests.

https://bugs.tryton.org/issue2349


First of all: Thanks for the big work :)


I would like to commit it ASAP to get enough time to find all bugs
before the release.


Indeed bugs can be found before commiting. It's a mather of appling all 
of the reviews. I have some script in order to update them when applied 
that I attach in this mail if is usefull for somebody else.


I've found the following:

- Creating a party with no stock locations clears the customer_location 
and supplier_location values of all the parties. Indeed, setting the the 
location value of a party to any values sets this value for all of the 
parties. I've reproduced it on a migrated database but I haven't tested 
on a new database.


I've tested on this specify model, but I'm wondering if the other models 
are also affected.



It will be good also to have some migration test.


After the migration I get a lot of this warnings like this:

WARNING trytond.convert Could not delete id 20 of model ir.property 
because model no longer exists.


Is this the expected behaviour?

This warning are also shown when updating the database for second time.
The only way to remove this warnings was executing this query on the 
database:


delete from ir_model_data where model = 'ir.property';

Should we add this to the migration page?




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

--
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/027ff2b0-d07a-98fa-cb87-d99128d5d61c%40koolpi.com.


update_modules_review.sh
Description: application/shellscript


Re: [tryton-dev] github not in sync

2017-03-27 Thread Sergi Almacellas Abellana

El 27/03/17 a les 06:52, Richard PALO ha escrit:


Don't know much about your script, either, but I would imagine you could
add whatever hooks you might need into your master git repository that
will ultimately pushed to github (and/or bitbucket and/or elsewhere).

This is our script to sync to github:

https://github.com/tryton/mirror

This script is run as cronjob everyday.

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

--
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/f06c0c5c-c5f3-53a3-bbb2-6582fb148568%40koolpi.com.


Re: [tryton-dev] Adding different backend

2017-03-21 Thread Sergi Almacellas Abellana

El 21/03/17 a les 14:33, Cédric Krier ha escrit:

On 2017-03-21 13:34, Nicolas Évrard wrote:

* Sergi Almacellas Abellana  [2017-03-21 12:02 +0100]:

El 20/03/17 a les 18:34, Nicolas Évrard ha escrit:

Hello,

I am currently working on two patches that will make it easier to
create python modules adding a new backend to tryton:

  - https://tryton-rietveld.appspot.com/33951002/ This patch moves
  the handling of the SQL type of the tryton fields to the backend.

In order to have a kind of lingua franca between tryton and the
backend we specify on the field the "abstract" SQL types it
wants to use (a M2O will use an INTEGER, a TimeDelta an
INTERVAL, and so on).


So in order to create a custom field type (I have JSONB in my mind),
we have to create a new backend? And in order to support this kind of
fields on more than one backend we have to create multiple backend?


Kind of.
The lingua franca is a just a mean so that the fields speak the same
language as the backend. It's then up to the backend to translate this
for the database.


I imagine some users having to maintain the following backends:

sqlite+spatialite
postgresql+postgis
sqlite+json
postgresql+jsonb
sqlite+spatialite+json
postgresql+postgist+json


I think that an eventual support for JSONB would be implemented using
JSONB for postgres, TEXT for sqlite and MySQL.


Having said that I'm wondering if it won't be better to allow to
register the handlers of the abstract types in external modules, so
with the same backend we will be able to handle different types of
fields, which can be then reused.


Indeed registering marshallers in the backends could be a way to
tackle the complexity of mixing together GIS and JSONB and whatnot.



Indeed what we tried to achieve is to have the backend agnostic about
fields. So we created this abstract SQL type which of course is closed
to the common SQL types.
So the design of issue6351 is to have converter on the backend using the
abstract type. Maybe we could think of a way to make those converter
extensible a little bit like what we did for json. But before that it
will be good to know how much abstract types we have and/or we could add
in the future. For example, the JSONB is not really a good abstract
type name, it should probably be an HashMap or JSON because JSONB is too
much low level.


What I miss is some mechanism to extend/modify the backend abstract 
types without having to rewrite a new backend. So we can add new 
abstract types directly from module and register the adapters for the 
current backends. Of course and error must be throw if used with a 
backend that's not aware of this abstract type.


Something like the function mapping of python-sql depending on the flavor.


But the main difficulty in introducing a new kind of abstract type which
is not common/standard is to have it supported by all backends.
And this makes me think that Tryton should not do too much in this area
as far as it allows customization of the database schema transparently.


The problem i see here is that you have to manually change the database 
schema, which adds a lot of complexity when dealing with a big number of 
databases or a big number of custom fields. That's why I prefer to 
create a module that does it for me.



For example, the TEXT column for Dict field on postgresql should
transparently work with JSONB type.



I have tested it and it requires https://bugs.tryton.org/issue6382


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

--
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/9edf5ace-b1f6-45dd-e570-c55f8ae74774%40koolpi.com.


Re: [tryton-dev] Adding different backend

2017-03-21 Thread Sergi Almacellas Abellana

El 20/03/17 a les 18:34, Nicolas Évrard ha escrit:

Hello,

I am currently working on two patches that will make it easier to
create python modules adding a new backend to tryton:

   - https://tryton-rietveld.appspot.com/33951002/
 This patch moves the handling of the SQL type of the tryton
 fields to the backend.

 In order to have a kind of lingua franca between tryton and the
 backend we specify on the field the "abstract" SQL types it
 wants to use (a M2O will use an INTEGER, a TimeDelta an
 INTERVAL, and so on).


So in order to create a custom field type (I have JSONB in my mind), we 
have to create a new backend? And in order to support this kind of 
fields on more than one backend we have to create multiple backend? I 
imagine some users having to maintain the following backends:


sqlite+spatialite
postgresql+postgis
sqlite+json
postgresql+jsonb
sqlite+spatialite+json
postgresql+postgist+json

Having said that I'm wondering if it won't be better to allow to 
register the handlers of the abstract types in external modules, so with 
the same backend we will be able to handle different types of fields, 
which can be then reused.




   - https://tryton-rietveld.appspot.com/26231002/
 This patch uses the abstract SQL types to create the column in
 the backend instead of the raw SQL type that was used before.

You can see those patch in action in the following patch adding a
postgis backend which inherits almost everything from the postgres
backend: https://codereview.appspot.com/322730043/


Instead of creating a new backend I will prefer to extend the existing one.



We wonder if there is some kind of interest to make this backend
supported by community or if we should keep it in the B2CK realm.
According to me we should definitely support this backend (I
personally know ∞-time more people that would use this backend then
the mysql one). And this last remarks makes me wonder if we shouldn't
make of the mysql backend this kind of python package (supported by
the community but not release critical at all).


+1 for separating mysql backend.

I'm in favor of adding community supported packages but not release 
critical. Indeed, i think more packages can be added in this realm, like:


- flask-tryton
- celery-tryton
- redis-tryton
- trydoc






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

--
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/ceb71d4f-a1bc-8acc-90df-58cdb913b1b3%40koolpi.com.


Re: [tryton-dev] Apply domain in Many2One

2017-03-10 Thread Sergi Almacellas Abellana

El 10/03/17 a les 11:30, Peter Müller ha escrit:


Ok, got this know. May I ask, the drop down selection shows only the
code. Is it possible to show other fields (name, etc) ?
Just remove the widget="selection" to use the default Many2ONe widget 
which provides this functionality.


IIRC the selection widget only shows the party rec_name

P.S: Don't top post in this mailing list. See 
http://groups.tryton.org/netiquette


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

--
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/dd0e0740-71e4-1d1f-e357-e46fc1bfb3f2%40koolpi.com.


Re: [tryton-dev] Error installing sao from source

2017-03-06 Thread Sergi Almacellas Abellana

El 06/03/17 a les 13:22, Axel Braun ha escrit:


It is a standard openSUSE Leap 42.1 installation.


Indeed i can not reproduce it on Ubuntu. It works as expected.


Any hint what configuration is needed is appreciated!

It seems that you should add the certificate CA to your system.



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

--
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/8f48019f-592a-edec-486a-cf85bc529a7e%40koolpi.com.


Re: [tryton-dev] How to add to the configuration wizard when a new module is installed

2017-03-03 Thread Sergi Almacellas Abellana

El 03/03/17 a les 09:38, Vincent Bastos ha escrit:



On Fri, Mar 3, 2017 at 6:23 PM, Sergi Almacellas Abellana
<se...@koolpi.com <mailto:se...@koolpi.com>> wrote:

El 03/03/17 a les 08:42, Vincent Bastos ha escrit:



On Saturday, February 18, 2017 at 10:20:07 PM UTC+10, Cédric
Krier wrote:

On 2017-02-17 22:42, Vincent Bastos wrote:
> Hi,
>
> I am unable to figure out how modules are able to "append"
to the
> configuration wizard when a new module is installed.
>
> I have created a configuration.py file and
configuration.xml file
with a
> form, but this does not come up when I install my module.
>
> I thought that Tryton automatically added configuration
files to the
> wizard, but I was unable to find this in the code.

Explicit is better than implicit.
You have to create an entry in ir.module.config_wizard.item


I suppose I also have to create Configuration class that extends
a Wizard?


No you have to create a record in ir.module.config_wizard.item that
references the wizard you want to call when your module is
installed. You can have a look at the company module as reference:

http://hg.tryton.org/modules/company/file/052e36889d49/company.xml#l167
<http://hg.tryton.org/modules/company/file/052e36889d49/company.xml#l167>

Hope it helps.


Yes, I saw this. But this has a reference to the record above it:


Configure Company
company.company.config


Which references the wizard class company.company.config - so I do have
to create this configuration class for my module no?



Yes, you have to register the new wizard on the database if you create one.

Note: You can use launch an existing wizard by using an existing xml_id 
on the ir.module.config_wizard.item but I can not imagine any use case.




--
*Vincent Bastos*
*Lava Lab Software*

--
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/CACLX58AGinYsJQNQSXT9tVFx4X2xUy6hi1z7qNy34kRgrR3wTA%40mail.gmail.com
<https://groups.google.com/d/msgid/tryton-dev/CACLX58AGinYsJQNQSXT9tVFx4X2xUy6hi1z7qNy34kRgrR3wTA%40mail.gmail.com?utm_medium=email_source=footer>.



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

--
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/0c448b9c-1941-e7e9-04b5-faa7fc63d87d%40koolpi.com.


Re: [tryton-dev] How to add to the configuration wizard when a new module is installed

2017-03-03 Thread Sergi Almacellas Abellana

El 03/03/17 a les 08:42, Vincent Bastos ha escrit:



On Saturday, February 18, 2017 at 10:20:07 PM UTC+10, Cédric Krier wrote:

On 2017-02-17 22:42, Vincent Bastos wrote:
> Hi,
>
> I am unable to figure out how modules are able to "append" to the
> configuration wizard when a new module is installed.
>
> I have created a configuration.py file and configuration.xml file
with a
> form, but this does not come up when I install my module.
>
> I thought that Tryton automatically added configuration files to the
> wizard, but I was unable to find this in the code.

Explicit is better than implicit.
You have to create an entry in ir.module.config_wizard.item


I suppose I also have to create Configuration class that extends a Wizard?


No you have to create a record in ir.module.config_wizard.item that 
references the wizard you want to call when your module is installed. 
You can have a look at the company module as reference:


http://hg.tryton.org/modules/company/file/052e36889d49/company.xml#l167

Hope it helps.


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

--
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/57dacdce-7921-e68a-6450-c1be71476f97%40koolpi.com.


[tryton-dev] More comments on "Use Match pattern for invoice sequences"

2017-02-08 Thread Sergi Almacellas Abellana

Hi All,

We would like to have more eyes on https://bugs.tryton.org/issue6212
Could you please join the review?

Thanks in advance,
--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

--
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/8846d3d1-531c-6062-402e-3e435c37a9f4%40koolpi.com.


Re: [tryton-dev] How to update my trunk repository

2017-01-16 Thread Sergi Almacellas Abellana

El 16/01/17 a les 17:15, Thierry Bruyere ha escrit:

I have a repository mercurial created 4 month ago (nclone)
Now, I have make a npull for upgrade my repository.

But I not have the new modules created between my first nclone and now.

I have to create all new modules manually with hg clone ?

AFAIK: Yes.

If yes, how to known the list ?


You can see all the available modules on:

http://hg.tryton.org/modules/

Hope It Helps.



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

--
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/bd665b62-cd28-0ffc-eb20-1203a37a1fec%40koolpi.com.


Re: [tryton-dev] Tryton cookiecutter error

2017-01-13 Thread Sergi Almacellas Abellana

El 13/01/17 a les 02:13, Vincent Bastos ha escrit:

Hey,

I thought I would try to use the Tryton cookiecutter, but I am getting
the following error:

(tryton38testmodule)*➜  **tryton38testmodule*cookiecutter
https://hg.tryton.org/cookiecutter

Traceback (most recent call last):

  File "/usr/local/bin/cookiecutter", line 11, in 

sys.exit(main())

  File "/Library/Python/2.7/site-packages/click/core.py", line 610, in
__call__

return self.main(*args, **kwargs)

  File "/Library/Python/2.7/site-packages/click/core.py", line 590, in main

rv = self.invoke(ctx)

  File "/Library/Python/2.7/site-packages/click/core.py", line 782, in
invoke

return ctx.invoke(self.callback, **ctx.params)

  File "/Library/Python/2.7/site-packages/click/core.py", line 416, in
invoke

return callback(*args, **kwargs)

  File "/Library/Python/2.7/site-packages/cookiecutter/cli.py", line 70,
in main

cookiecutter(template, checkout, no_input)

  File "/Library/Python/2.7/site-packages/cookiecutter/main.py", line
79, in cookiecutter

no_input=no_input

  File "/Library/Python/2.7/site-packages/cookiecutter/vcs.py", line 97,
in clone

repo_type, repo_url = identify_repo(repo_url)

  File "/Library/Python/2.7/site-packages/cookiecutter/vcs.py", line 69,
in identify_repo

raise UnknownRepoType

cookiecutter.exceptions.UnknownRepoType



You should indicate the repo type in the cookiecutter URL. This is 
explained on their docs:


https://cookiecutter.readthedocs.io/en/latest/usage.html#works-directly-with-git-and-hg-mercurial-repos-too



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

--
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/9b66e0a7-e1ba-8787-9a04-ed3fb1e9ac3e%40koolpi.com.


Re: [tryton-dev] Contribute tryton development

2017-01-11 Thread Sergi Almacellas Abellana

El 11/01/17 a les 14:15, Sathish S ha escrit:

Hi,


Hi,


I am new to tryton. I have experience in python.
I want to contribute in tryton development.


That's a very good new :)


Can anyone help me hoe to contribute this project


I have given a complete answer (i think) to this question some time ago, 
so you can have a look at it:


https://groups.google.com/d/msg/tryton/8D6Cu_Nf1G0/TPJ7G-MmDwAJ

Hope it helps.



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

--
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/11bf62e6-18bb-13f8-68be-06709feccb6f%40koolpi.com.


Re: [tryton-dev] CI is producing false positives

2016-12-16 Thread Sergi Almacellas Abellana


El 16/12/16 a les 14:17, Sergi Almacellas Abellana ha escrit:


I will send an update email once the issue is resolved.

Everything is working well now.

So we are back to normal mode.

--
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/5854455A.30700%40koolpi.com.


[tryton-dev] CI is producing false positives

2016-12-16 Thread Sergi Almacellas Abellana

Hi All,

Since a recent change in the setuptools package our CI infrastructure is 
producing false positives. As we can no more trust on the CI system we 
should stop pushing changes.


We can keep working on reviews, but they should not be pushed.

I will send an update email once the issue is resolved.

Thanks.

P.S: For those who want to now more details about the issue you can have 
a look on the irc log:


http://www.tryton.org/~irclog/latest.log.html#t2016-12-16%2012:26
--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

--
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/e51b90d6-53b7-e3e1-e0ab-f173a4e737e6%40koolpi.com.


Re: [tryton-dev] non authenticated end point

2016-11-24 Thread Sergi Almacellas Abellana

El 24/11/16 a les 13:22, Vincent Bastos ha escrit:

ok thanks. I had not thought of this.

I'm not sure how to actually implement this in terms of putting it
together in a module - if that even makes sense. Can I simple create a
flask application in my module?
Of course, but you should take care to run this application as a 
separate process, as the tryton server will not run it for you.


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

--
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/68f8ed60-9762-1d1a-2551-efbb1b7039a1%40koolpi.com.


Re: [tryton-dev] non authenticated end point

2016-11-24 Thread Sergi Almacellas Abellana

Hi Vincent,

El 24/11/16 a les 13:11, Vincent Bastos ha escrit:

Is it possible to create an end point on the server that does not
require authentication?

I would like to implement a queue to send SMS's using the Twilio API.
When you send a request to send a message, it is possible to set a
callback url [1] with a parameter in the domain rather than as a parameter.



You can use flask_tryton [1] to create a custom endpoint that conects to 
the database and processes the requests. This request won't require any 
authentication.


Hope it helps,

[1] https://pypi.python.org/pypi/flask_tryton/0.6
--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

--
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/2a96e538-328f-3b16-a3e4-df4dbbc4a36b%40koolpi.com.


Re: [tryton-dev] read order by create_date

2016-11-24 Thread Sergi Almacellas Abellana

Hi,

El 24/11/16 a les 07:16, Vincent Bastos ha escrit:

Is there any reason why ordering by create_date wouldn't work?


I don't this so.

Can't I use the following domain - 'create_date', 'DESC'?

Why not?

For me it's working:

>>> from proteus import Model, config
>>> config.set_trytond()
>>> View = Model.get('ir.ui.view')
>>> view, = View.find([], order=[('create_date', 'DESC')], limit=1)
>>> view.id
708
>>> view, = View.find([], limit=1)
>>> view.id
4



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

--
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/6a2f9bae-b318-e242-d938-60ff78f9a8ba%40koolpi.com.


Re: [tryton-dev] Changelog tryton 3.8.11

2016-11-21 Thread Sergi Almacellas Abellana

El 21/11/16 a les 10:40, Axel Braun ha escrit:

but:
Version 3.8.11 - 2016-11-06
* Bug fixes (see mercurial logs for details)
As told in the CHANGELOG, you can do it from the mercurial logs. For 
example to see the changes in the 3.8.11 version you can use:


hg log -b 3.8 -r 3.8.10:3.8.11

Which as generic will be:

hg log -b  -r :

Hope it helps.

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

--
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/ef683fb4-d82c-44e5-fb68-738610fa96f2%40koolpi.com.


Re: [tryton-dev] Translations updated for 4.2

2016-11-21 Thread Sergi Almacellas Abellana

El 21/11/16 a les 10:08, Cédric Krier ha escrit:

On 2016-11-21 09:33, Sergi Almacellas Abellana wrote:

> El 21/11/16 a les 09:24, Cédric Krier ha escrit:

> > On 2016-11-01 16:01, Cédric Krier wrote:

> > > > Hi,
> > > >
> > > > The translations on the Pootle server are updated for the coming 4.2
> > > > release. You can start translating. There are about 1900 new terms to
> > > > check per language.
> > > >
> > > > https://pootle.tryton.org/projects/tryton/
> > > >
> > > > The date line is set to 25th November at 18:00 CET.

> > Quick reminder that there less than 1 week to finish the translations.
> > Only two languages are already complete: French and Spanish.

> Catalan is also finished, but the incomplete list shows a list of empty
> strings:
>
> https://pootle.tryton.org/ca/tryton/translate/#filter=incomplete
>
> So please, let me know if I can do something to fix it.

It is because there is still a fuzy translation.
Also it will be good in the future that Tryton does not create empty
translations.

Ohh my fail. I missed this translations. Everything is translated now.

Thanks.

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

--
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/fb6510d1-2134-6267-353b-0789c6eb3afa%40koolpi.com.


Re: [tryton-dev] Translations updated for 4.2

2016-11-21 Thread Sergi Almacellas Abellana

El 21/11/16 a les 09:24, Cédric Krier ha escrit:

On 2016-11-01 16:01, Cédric Krier wrote:

> Hi,
>
> The translations on the Pootle server are updated for the coming 4.2
> release. You can start translating. There are about 1900 new terms to
> check per language.
>
> https://pootle.tryton.org/projects/tryton/
>
> The date line is set to 25th November at 18:00 CET.

Quick reminder that there less than 1 week to finish the translations.
Only two languages are already complete: French and Spanish.
Catalan is also finished, but the incomplete list shows a list of empty 
strings:


https://pootle.tryton.org/ca/tryton/translate/#filter=incomplete

So please, let me know if I can do something to fix it.

Thanks,

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

--
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/108fd5da-dd27-f2e1-b3aa-76f913360eb8%40koolpi.com.


Re: [tryton-dev] Stateless Trytond

2016-11-17 Thread Sergi Almacellas Abellana

El 17/11/16 a les 09:55, Albert Cervera i Areny ha escrit:

2016-11-15 17:05 GMT+01:00 Cédric Krier <cedric.kr...@b2ck.com>:

> On 2016-11-15 07:02, Mikhail Savushkin wrote:

>> As long as we're talking about millions of DBs, this straightforward
>> approach wont work.

>
>
> - Improve the __setup__ methods:
>
> - find better than deepcopy:
>   http://hg.tryton.org/trytond/file/default/trytond/model/model.py#l46

I'm not sure of what I'll say, but AFAIU deepcopy is used to support
several databases (with different modules). Would it be possible to
pass a "--single-database" parameter to trytond, so it would just
support a single database but it would also avoid deepcopying? Or is
there much more work than that?



Indeed there is an issue to remove multiple database support [1], so if 
deepcopy is only used to support several databases it should be removed 
with this issue and it will be great to have a note on it to not forget 
about it.


[1] https://bugs.tryton.org/issue5694


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

--
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/29820a3d-c562-a7d6-043d-316a28dd2764%40koolpi.com.


Re: [tryton-dev] Tryton Modules Registry

2016-11-12 Thread Sergi Almacellas Abellana

El 10/11/16 a les 17:04, Aleksandar Stefanov ha escrit:

Hello everyone,

Hello,


We work with Tryton and since we couldn't find anything like "Tryton
Modules Registry" with a list of all modules ever developed by anyone,
we created a small web app for our own use which we called so.


Indeed, there was an flask application [1], which where designed to have 
the same functionality. So maybe we can join efforts there and publish 
this registry on the tryton website, which I think it will give more 
visibility to it.




It turns out to be pretty useful tool for us, so we decided to share it
with the community.

You can check it out here.
http://registry.semilimes.com/


It looks great. Do you have any check to determine if the module is a 
tryton module? Or I can upload any repository?


Also, is the source code of this application available?



If you know of a module that you can't find in the registry, you can let
us know at http://registry.semilimes.com/modules/add/.


So how can I remove modules that are no longer maintained?


Also, if you are a module developer and think we put the wrong
information about your module, you can let us know at
http://registry.semilimes.com/contacts/. We would happily fix the error.

Thanks,
Alex



[1] http://hg.tryton.org/sandbox/typi.tryton.org/
[2] http://registry.semilimes.com/faq/
--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk

--
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/aef7bf5d-7834-5882-d6df-548e4fe7%40koolpi.com.


  1   2   3   >