Commit Graph
147 Commits
Author SHA1 Message Date
Cédric Krier aaf9e28ce7 Construct the Record.expr_eval context the same way as tryton
issue5122
review23641002
2015-11-15 12:41:13 -03:00
Cédric Krier a2faaebcbd Fix set_on_change of One2Many when value.add is not defined 2015-11-01 22:34:56 +01:00
Cédric Krier 461d795ee4 Manage size limit, add and pre_validate on One2Many
review17621002
2015-10-26 18:33:50 +01:00
Cédric Krier 62c85fbc64 Use get_loaded instead of testing empty _loaded
because it doesn't catch partially loaded.
2015-10-24 20:39:48 +02:00
Cédric Krier ffbcd73ee0 Use Record.cancel instead of clearing _loaded
Since changeset e6b3bc445b7a, the timestamp must be cleared if we reload the
record.

issue5065
review19571002
2015-10-23 23:52:38 +02:00
Cédric Krier f218a28f63 Fix validate when fields is undefined 2015-10-19 20:35:09 +02:00
Cédric Krier cb69ab8024 Always keep the oldest timestamp
The optimistic lock should be checked with the oldest timestamp to be safer.

issue2687
review21491002
2015-10-18 16:53:47 +02:00
Cédric Krier 0407303197 Implement _check_load
instead of forcing the load of every fields.
2015-10-16 15:54:38 +02:00
Cédric Krier ceb4360cc6 Sort array before compare in get_loaded 2015-10-16 15:53:41 +02:00
Cédric Krier 2f2bc1ae96 Manage path for setting current_record
review18681002
2015-10-16 01:43:02 +02:00
Cédric Krier e83c3fac55 Reload and call written only if record has something to save 2015-10-09 20:52:44 +02:00
Cédric Krier 61aeb845d2 Calling written should be done after the save to get the right id if it is a creation 2015-10-09 12:42:37 +02:00
Cédric Krier 2ba1b1acfc Make digits with null behaves like null digits
issue5019
review19531002
2015-10-08 19:42:08 +02:00
Cédric Krier 252d66d7d8 Ensure Float.get_client returns a string
otherwise 0 could be evaluated as False.
2015-10-06 15:33:17 +02:00
Cédric Krier 22ba269923 Remove default (16, 2) digits
trytond doesn't enforce any digits if it is None,
so the client must do the same.

issue4742
review22491003
2015-10-03 11:55:37 +02:00
Cédric Krier c496bff4a6 Fix parsing empty string for Float and Numeric
For Javascript, Number('') results into 0 instead of NaN.
2015-10-02 19:39:32 +02:00
Cédric Krier e9518bac6f Fix typo True -> true 2015-10-02 12:29:36 +02:00
Cédric Krier 643959f9d6 Add Dict widget
review24411003
2015-09-25 18:00:31 +02:00
Cédric Krier a59e017ce3 Correctly set xxx2many modified by on_change
set_on_change should not trigger any signal but it should register
the field as modified.

issue4968
review24431002
2015-09-24 22:52:03 +02:00
Cédric Krier 4f74bc89a5 Fix localize_domain to strip 4th element only for Reference field
The 4th element should only be removed is the localized field is a Reference
field otherwise it must be kept.

issue4975
review16621002
2015-09-22 22:54:41 +02:00
Cédric Krier a487f69c6c Fix wrong arguments in validation_domains with pre_validate 2015-09-06 21:17:19 +02:00
Cédric Krier 034dea5312 Check if field is loaded before adding its timestamp
issue4876
review20341002
2015-07-28 07:42:25 +02:00
Cédric Krier ea52c00bdc Fix jsonify of Decimal and ensure Decimal instance is always used
The string version of the Decimal must be used for json.
When Decimal instances are used in calulation with Number, the result is no
more a Decimal instance so it must be converted again.

review22341002
2015-07-26 16:12:51 +07:00
Cédric Krier 0ce7edc54d Fix parent model comparison when eager loading 2015-07-17 21:44:07 +02:00
Cédric Krier 2f838171ec Add force_reload on save and return reload promesse 2015-07-17 18:01:48 +02:00
Cédric Krier 0392294aa5 Remove colors on widgets
- Bold label of required fields
- Explicit error message for invalid record

issue4861
review21301002
2015-07-16 22:36:11 +02:00
Nicolas Évrard bd5fc134cc Only call autocomplete on in default_get if it depends on at least one field 2015-05-29 13:35:28 +02:00
Cédric Krier 8a110d9d2d Fix validation of record of One2Many field
review16301002
2015-05-22 11:04:06 +02:00
Cédric Krier 0ad99276d0 Remove TODO about validate as it is implemented 2015-05-15 13:45:51 +02:00
Cédric Krier ca9daa057c Remove useless TODO in One2Many.set_client
Parent is managed in changed call.
2015-05-15 13:45:33 +02:00
Cédric Krier 7ff523950e Remove TODO about signal management
sao doesn't uses signals but directly lookup for parents
2015-05-15 13:44:09 +02:00
Cédric Krier 3f6ff2ad03 Add readonly check in Field.changed 2015-05-15 13:15:33 +02:00
Cédric Krier f6149f4483 Remove useless TODO in Field.set_client
Parent is managed in changed call.
2015-05-15 13:11:20 +02:00
Cédric Krier 9f4a88d18e Add pre_validate
review15381002
2015-05-15 13:00:41 +02:00
Cédric Krier 5a8d38a905 Add autocompletion
review17261002
2015-05-07 11:21:29 +02:00
Cédric Krier a79cdf675d Force parent in default_get 2015-04-30 17:44:14 +02:00
Cédric Krier dbea601a79 Delay setting O2M field on record 2015-04-30 16:27:15 +02:00
Cédric Krier 8951d99ade Manage exception on Record and readonly state 2015-04-30 13:57:29 +02:00
Cédric Krier 0d6d6f2034 Implement sibling group load 2015-04-30 12:56:35 +02:00
Cédric Krier a838eb4e5e Wrong usage of Record.model_name instead of Record.model.name 2015-04-30 12:54:49 +02:00
Cédric Krier e8e6fecc2d Filter leaf domain of Reference fields
The domain of Reference fields must be filtered out for non-valid target
because the localization will remove the target part and thus generate an
invalid domain for the specific target.

issue4680
review11141003
2015-03-30 22:37:52 +02:00
Cédric Krier e2e6a9c004 Save parent group when saving record 2015-03-27 18:24:19 +01:00
Cédric Krier e290dace9e Add missing parent validation on Group.changed 2015-03-27 17:49:50 +01:00
Cédric Krier 717ef2594c Add missing assert on Model.delete_ 2015-03-27 16:00:20 +01:00
Cédric Krier 03caf29438 Implement on_write
review14141002
2015-03-27 10:39:52 +01:00
Cédric Krier c9a4b92bd8 Set default empty context when undefined
As the params will be duplicated with jQuery, it will skip the undefined keys
and so the empty context will be lost.
2015-03-26 19:38:45 +01:00
Cédric Krier 5be17f9612 Fix attachment count cache 2015-03-20 16:30:34 +01:00
Cédric Krier c7d19df48d Add timestamp to Model.delete 2015-03-20 13:56:37 +01:00
Cédric Krier 18e0800aa7 Clear record timestamp after save
Since changeset f63036a91c9f, the timestamp is sent also on button calls but if
the record is saved just before this generate an concurrency exception. Indeed
the _timestamp must be cleared just after the save (because the record is not
reloaded before the button call).

issue4644
review9151002
2015-03-18 11:14:58 +01:00
Cédric Krier 2c4b4a3152 Hide columns containing always the same value
The domain inversion is used on the screen domain combined with the tab domain
to find columns that has always the same value.

issue4552
review9141003
2015-03-18 11:10:29 +01:00