Commit Graph
5134 Commits
Author SHA1 Message Date
Cédric Krier cdc5952145 Manage Cache in Transaction
issue6216
review33021002
2017-02-02 12:04:27 +01:00
Cédric Krier aec4208225 Allow to register multiple exit functions on Transaction
Use Transaction.atexit for sleeping on login attempt to put back the
transaction as soon as possible.

issue6217
review27911002
2017-02-02 12:00:49 +01:00
Cédric Krier 2351008095 Fill cache with selected columns in ModelSQL.read
This minimizes missing cache on the instances when computing Function field.

issue6209
review31981002
2017-02-02 11:57:18 +01:00
Cédric Krier afdc884277 Return 429 status when too many login attempts
This prevents to consume too much resource by sleeping over a very long period.

issue6215
review29161002
2017-02-02 11:55:44 +01:00
Nicolas Évrard 39c12cf496 Add set_rpc on Field
The __rpc__ attribute is currently filled by method in ModelView. Allowing
fields to define themselves what endpoints should be remotely callable make
this process more flexible.

issue4044
review30991002
2017-02-01 16:11:00 +01:00
Cédric Krier 37cd24210a Use integer as default value for id when compare to 0
In Python3, it is no more allowed to compare None with integer.

issue6231
review27941002
2017-02-01 10:29:54 +01:00
Sergi Almacellas Abellana 8339247071 Ensure add_remove attribute is a valid domain
issue6230
review34671002
2017-02-01 10:15:12 +01:00
Cédric Krier b5ea083f7b Do not instantiate global DB nor POOL in test_tryton.py
The database is not yet created so it fails if the Database tries to connect.
This happens since changeset 5e8fc3bec7.
2017-01-29 02:16:28 +01:00
Cédric Krier 94be12542c Return result after cache reset in with_transaction wrapper
issue6200
review34641002
2017-01-29 01:17:08 +01:00
Cédric Krier 1b3dbec3b4 Ensure only one connection pool is created per database
It is too complex and expensive to lazy create the connection pool because all
methods which uses the pool needs to acquire a lock. So it is easier to create
it when the instance is also created. In this case, on closing the database, it
should be unregistered from the instances dictionary.

issue6202
review32991002
2017-01-29 01:15:45 +01:00
Cédric Krier c0aa69fa23 Make wsgi app returns Internal Server Error on exception
If no protocol convert the data into a Response and if the data is an exception
it should be returned as an Internal Server Error instead of a succeed
response.
The exception can be used as description for the Internal Server Error.

issue6201
review31951002
2017-01-29 01:11:57 +01:00
Cédric Krier c2b76dd685 Use root user to init pool in with_pool wrapper
All requests do not have necessary a user id, for example request for user
application.

issue6199
review26041002
2017-01-29 01:07:33 +01:00
Cédric Krier 811cbb2ad4 Fix test to translate read field
The test was using the field name instead of the field instance.
It is better to keep the usual convention of using fname for name and field for
the instance.

issue6208
review33011002
2017-01-25 23:30:23 +01:00
Cédric Krier c1b8ee10c6 Add has_select_for on Database
- Use has_select_for for ir.sequence.strict instead of lock

issue6134
review32911002
2017-01-25 23:21:57 +01:00
Florian Preinstorfer a4288f206f Update report documentation for office suite UI changes
The UI for office suites (LibreOffice, OpenOffice) has changed. Update the
description accordingly and fix a formatting issue.

issue6218
review29161003
2017-01-25 22:46:04 +01:00
Cédric Krier bc4e675935 Add warning about mutating cache values
issue6186
review29931002
2017-01-19 22:57:09 +01:00
Cédric Krier 9ea02c7b5e Test resource model using string
issue6091
review33701002
2016-12-28 23:18:17 +01:00
Cédric Krier 24f386cd58 Backed out changeset bd4fb1ec9ebb
issue6128
2016-12-26 19:36:22 +01:00
Cédric Krier 037780d5ae Avoid to convert IntegrityError into string
Use message attribute instead of calling str because the message could be
non-ASCII encoded.

issue6128
review31831002
2016-12-26 18:56:07 +01:00
Xavier Codinas c300756a9d Return the default language for user
Returning a default value prevents the client get displayed in two different
languages.

issue6118
review29831003
2016-12-22 09:39:13 +01:00
Cédric Krier dd3e0a4c2a Improve assertion in convert_domain of Function field
The field name from the domain could be a nested if the Function field is
relational. So it must just if it starts with the name of the field.
2016-12-22 01:15:46 +01:00
Cédric Krier 4d5046f028 Store custom report translation in separate module
Such translations should not be linked to the original report module as they
are only available in this database.
The translations menu entry should show also those who are not linked to a
module.

issue6059
review29761002
2016-12-21 23:44:21 +01:00
Cédric Krier 8bcd39008d Add form_action keyword for set/synchronize translation on report and view
This allows to run the wizard from reports or views and limit them to the
active records.

issue6063
review30811002
2016-12-21 23:41:37 +01:00
Cédric Krier 9c6cc66a41 Make HOSTNAME public
issue6127
review34561002
2016-12-21 23:24:56 +01:00
Cédric Krier ab794f6411 Use negative col attribute
issue2090
review33661002
2016-12-21 23:17:56 +01:00
Cédric Krier b60f97a948 Add negative value for col attribute
issue2090
review33661002
2016-12-21 23:17:19 +01:00
Cédric Krier f6deed5941 Allow to use domain_<field name> method with Function fields
issue6113
review26961003
2016-12-21 23:08:30 +01:00
Sergi Almacellas Abellana 04a027a105 Validate wizard definition on module tests
issue6067
review32831002
2016-12-21 10:07:57 +01:00
Cédric Krier 361ad96471 Add documentation about database update
review31791002
2016-12-19 10:05:48 +01:00
Sergi Almacellas Abellana cd51241e3a Add test about editing and coping translations without admin access
issue6115
review34541002
2016-12-19 09:42:12 +01:00
Sergi Almacellas Abellana d6f1eaf10b Read translations without checking access
Since changeset de90bf5435ce instance records are used (instead of writing the
values) but when they are read with the check_access, as this context  is used
to save the values, they raise incorrect access error.

issue6115
review34541002
2016-12-19 09:40:40 +01:00
Cédric Krier bb27960228 Remove order constraint on register ModelSQL
We create the foreign table if needed before adding the foreign key constraint,
thus it is no more needed to order the registration of the ModelSQL.

issue5682
review32841002
2016-12-17 00:38:21 +01:00
Cédric Krier 49ec3dcce1 Add relate from report to translations
issue6057
review26901002
2016-12-17 00:25:01 +01:00
Cédric Krier 4430d97a68 Test action keyword model using string
With changeset b8d76b07910f, negative ids are no more instantiated but so
testing the model with __name__ does not work any more for such value.
Instead we must always compare using the string version of the model.

issue6091
review31801002
2016-12-16 17:09:25 +01:00
Cédric Krier 2b84a80789 Test no instantiation of reference field with negative id
issue6091
review26941002
2016-12-16 11:00:49 +01:00
Cédric Krier 92d8d29fad Do not instantiate reference field with negative id
The reference fields can have a negative id if no record was selected on the
client. It is not expected to get such temporary instance from a reference
field on a saved record.

issue6091
review26941002
2016-12-16 11:00:04 +01:00
Cédric Krier cbf4e70c09 Do not try to read empty filename configuration
configfile can be a list with None values as the default argument value is a
list with TRYTOND_CONFIG environment variable which could be not set.

issue6101
review25891002
2016-12-13 18:36:52 +01:00
Cédric Krier 015603c847 Hide report path if custom template is set
This gives visual hint to the user about customization.

issue6064
review25831002
2016-12-13 18:31:42 +01:00
Sergi Almacellas Abellana 1029de47c6 Raise valueError when no date is supplied in datetime_strftime
issue6053
review31731002
2016-12-07 12:36:05 +01:00
Cédric Krier 5966b7621d Increase version number 2016-11-28 15:54:33 +01:00
Cédric Krier c8e3fa22a8 Added tag 4.2.0 for changeset eb8949ec5bce 2016-11-28 15:49:42 +01:00
Cédric Krier 000d88678c Prepare release 4.2.0 2016-11-28 15:49:40 +01:00
Cédric Krier 21164f52b0 Use original transaction to check created/deleted records in __raise_integrity_error
The method is often called under a new transaction so the created/deleted
records properties are cleared which makes it raises the wrong message if the
foreign key was created during the same transaction.

issue6038
review29781002
2016-11-28 00:01:51 +01:00
Cédric Krier dcc1770b5b Add test call to on_change methods
- Manage None as value of field in on_change method

issue6069
review27851002
2016-11-27 22:12:43 +01:00
Cédric Krier b699dd9bc0 Do not copy warnings nor applications when copying user
There are record rules on the targets which prevent to copy users.
Also it is not expected to copy those fields when copying users.

issue6049
2016-11-26 19:51:07 +01:00
Cédric Krier 26639ecd3f Format Many2One value before using it as id value in __raise_integrity_error
id is an Integer field which does not cast to int the values in the opposite of
Many2One which could receive an record instance.

issue6068
review31751003
2016-11-26 15:06:05 +01:00
Cédric Krier 4d8f310aae Update translations 2016-11-25 23:48:45 +01:00
Cédric Krier f057bfd68f Use sale report as example for report replacement
The invoice report example does not work because it is managed by a wizard.

issue6054
review25821002
2016-11-25 10:49:48 +01:00
Ritesh Shrivastav 221826ebb8 Fix wrong key for translation_overridden error message
issue6052
review26911002
2016-11-24 09:28:35 +01:00
Cédric Krier e2001e693f Use English name for languages
The name of the language is a translatable field so the English version must be
used by default.

issue6022
review32771003
2016-11-10 12:21:09 +01:00