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

2018-01-31 Thread Josias Pérez
This works well for me. Thanks! El 31/01/2018, 9:01:41 (UTC-6), Sergi Almacellas Abellana escribió: > 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): > >

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

2018-01-31 Thread Maxime Richez
> I think the problem is: > > cls.number.states['readonly'] = True > > Try to remove required states that is not True (and/or invisible in case that > you like not show it) > Not working because unchanged in the database, but also risky like Cédric said... so i just changed my test ;-)

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

Re: [tryton-dev] How to update to null a table column with python-sql

2018-01-31 Thread Raimon Esteve
2018-01-31 15:19 GMT+01:00 Cédric Krier : > On 2018-01-31 13:50, Raimon Esteve wrote: > > I try with python-sql to update a column to "null". > > > > Somebody know how to update to null a column? > > > > Example: > > > > query = user.update( > >

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

Re: [tryton-dev] How to update to null a table column with python-sql

2018-01-31 Thread Cédric Krier
On 2018-01-31 13:50, Raimon Esteve wrote: > I try with python-sql to update a column to "null". > > Somebody know how to update to null a column? > > Example: > > query = user.update( > columns=[user.main_company], > values=[None], <- I like

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

2018-01-31 Thread Cédric Krier
On 2018-01-31 05:51, Maxime Richez wrote: > So, what's the best way to finish my custom module? > > - Changing my original test "if values.get('number') is None:" by "if > values.get('number') == "":" (and keeping the database unchanged) ? Use a test like this: if not values.get('number'):

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

2018-01-31 Thread Raimon Esteve
Hie, 2018-01-31 14:51 GMT+01:00 Maxime Richez : > > Hi, > > Some questions and explanations of something i thought easy to realize... > 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

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

2018-01-31 Thread Maxime Richez
Hi, Some questions and explanations of something i thought easy to realize... 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". So in my

[tryton-dev] How to update to null a table column with python-sql

2018-01-31 Thread Raimon Esteve
hie, I try with python-sql to update a column to "null". Somebody know how to update to null a column? Example: query = user.update( columns=[user.main_company], values=[None], <- I like here to update with null

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

[tryton-dev] set_context to @table_query from Report

2018-01-31 Thread Josias Pérez
Hi, I have a custom module with the follow definition: DepartmentLine Department (many2one to Deparment) Product Quantity Department Customer Date Lines (one2many to DepartmentLine) I have a custom report that call info from a table_query class DepartmentReport(Report): 'Report'