Commit Graph
608 Commits
Author SHA1 Message Date
Cédric Krier 29129855ec Add support for Python 3
issue3211
review7311002
2016-02-07 16:46:16 +01:00
Cédric Krier 81f1e8b6db Fix typo when reading getter fields with datetime_field
issue5269
review20671002
2016-02-02 19:03:11 +01:00
Nicolas Évrard d4e3b605ef Add 'where' operator to xxx2many
issue4507
review12951002
2016-01-21 10:48:32 +01:00
Sergi Almacellas Abellana 2a723f2e52 Only rebuild mptt tree if needed
The tree will be only rebuild if a record with the default value of left or right fields exists.

issue5118
review16921002
2016-01-11 15:33:08 +01:00
Cédric Krier 1bd76628c6 Set view_ids attribute only if it is not empty
issue5207
review15861002
2015-12-31 14:17:03 +01:00
Cédric Krier 71c0e0a3af Allow nested inherited views
Search and use the recursive type of the views

issue5206
review17691002
2015-12-31 14:15:51 +01:00
Cédric Krier 1f04a58562 Remove comments from view.arch
A side effect of this change is that now the method parse only once the arch of
each view instead of dumping and parsing the intermediary result of
inheritance.

issue5189
review18831002
2015-12-31 14:13:03 +01:00
Sergi Almacellas Abellana 80b3679dd3 Backed out changeset ac3c495d797f 2015-12-28 15:29:21 +01:00
Sergi Almacellas Abellana fc58438188 Only rebuild mptt tree one time per model in a database update
issue5118
review20501002
2015-12-28 14:13:03 +01:00
Cédric Krier 2e37bf7852 Don't return changed many2one if the id is None
If the id is None, it is a temporary record which should not be considered as a
value change.

issue5190
review20601002
2015-12-27 20:03:59 +01:00
Cédric Krier 1a7c6c3a06 Add missing id on label
Fields without read access are replaced by empty label but they still require
at least a name attribute or an id.

issue5187
review19701002
2015-12-27 20:01:03 +01:00
Cédric Krier 5999bb231d Check all fields when writing a sequence of records, values
issue5167
review22631002
2015-12-16 13:47:33 +01:00
Cédric Krier bcd557da3b Many2Many are not sortable
fields_get should set sortable to False for Many2Many.

issue5123
review15821002
2015-11-15 12:45:41 -03:00
Cédric Krier 9a58954703 Add view_ids on tree view
issue5052
review24511002
2015-11-10 12:55:06 +01:00
Cédric Krier a61474274a Add parent_of operator
issue5037
review15711002
2015-11-05 23:22:26 +01:00
Cédric Krier b5479332d9 Use instance context in translated descriptor of Selection field
It is more expected from the translated descriptor to return translation in the
language from the instance instead of the current context.

issue5028
review15701002
2015-11-03 12:20:49 +01:00
Cédric Krier 5c062ebeea Always rebuild MPTT tree in case of nested creation
because _update_tree can not find children with left/right.

issue5095
review24571002
2015-11-02 11:41:04 +01:00
Cédric Krier 10af0ea078 Reset MPTT fields when copying records
The left/right fields must be reset to their default values to allow to compute
the correct new values. As it is common to forget this requirement when
implementing, it is safer to enforce this behaviour directly in the
ModelStorage.copy method.

issue5049
review16741002
2015-10-18 16:50:41 +02:00
Cédric Krier 0e467f1b5d Fix order when searching view in ModelView
When id is given, there is no need to perform a search otherwise only root
views or inherited views from other model should be considered.
Instead of explicitly define orders, it is better for modularity to use the
default one defined on the view model.

issue2041
review21461002
2015-10-15 10:44:30 +02:00
Cédric Krier f01f0d5871 Fix child_of domain on empty MPTT
When the MPTT search returns no row, the SQL query generated has an invalid
syntax because it uses an empty Or() clause. We replace this empty Or() by a
Literal(False) to select nothing.

issue5011
review18651002
2015-10-03 11:50:56 +02:00
Cédric Krier fe52324943 Improve SQL expression for child_of on Many2One with MPTT
issue4984
review22441002
2015-09-24 15:48:45 +02:00
Cédric Krier e43bda21bc Wrong parameter passed to __raise_integrity_error 2015-09-21 10:30:25 +02:00
Cédric Krier cd47b8cf85 Use specific test 'elem is None' to remove lxml warning
FutureWarning: The behavior of this method will change in future
versions. Use specific 'len(elem)' or 'elem is not None' test instead.
2015-09-15 14:52:03 +02:00
Cédric Krier 9bc7174254 Backed out changeset 0fd061e7c87f 2015-09-15 14:51:13 +02:00
Cédric Krier 228a8ca7d9 Use specific test 'elem is not None' to remove lxml warning
FutureWarning: The behavior of this method will change in future
versions. Use specific 'len(elem)' or 'elem is not None' test instead.
2015-09-14 12:00:43 +02:00
Cédric Krier c18ec6ba74 Add support for float and integer on Property fields
issue4942
review18531002
2015-09-14 10:37:38 +02:00
Cédric Krier 8299e1c133 Validate XML generated by ModelView.fields_view_get
- Add missing attributes to {form,tree}.rn{c,g}
- Add validatation to test_view
- Prevent fields_view_get to set attribute to the wrong view type

issue4944
review19421002
2015-09-04 12:04:07 +02:00
Cédric Krier 0574e90f5b Remove foreign-key on create_uid and write_uid
Instead prevent delete of any user to keep logging information.

issue4925
review24301002
2015-09-04 11:52:53 +02:00
Cédric Krier 09345debbd Add missing Check and Unique in __all__ 2015-07-30 16:21:31 +02:00
Sergi Almacellas Abellana 9ac3fec4dd Explicity raise error when creating/writing/deleting models with table_query
issue4822
review16351002
2015-07-29 10:56:30 +02:00
Cédric Krier c6c6c7e268 Fix join target_search for history
search_domain must not override the main table with the history instance if
tables is provided by the caller. In such case, it must assume the caller will
pass the right table.
The join search on Many2One must use the history table if the Target is
historized and a _datetime is set in the context.

issue4798
review12251002
2015-07-28 14:54:03 +02:00
Cédric Krier 6cd05ed6fe Add has_multirow_insert
There are still many databases that doesn't support this SQL-92 syntax.

issue4881
review19331002
2015-07-28 08:04:29 +02:00
Cédric Krier 7652df0be4 Allow to override ModelSQL._table
issue4774
review15431002
2015-07-16 01:13:45 +02:00
Cédric Krier ba40cb71d1 Get all eligible records when writting many values
The call to trigger_write_get_eligibles must be done with all the records and
not only the first set.

issue4863
review23311002
2015-07-14 00:06:13 +02:00
Cédric Krier dad49fa98b Always test field presence in initial value when computed changed values
The value could be None which is also the default value returned by dict.get.
So it will fail to detect change in such case.

issue4839
review23281002
2015-07-14 00:04:08 +02:00
Cédric Krier 390aebef15 Simplify the SQL query for domain on property
- Remove useless CASE test
- Simplify double negation

issue4835
review21271002
2015-07-09 15:38:44 +02:00
Cédric Krier 808580e2ea Improve domain queries of xxx2Many
Avoid using double select of ids and origin.

issue4821
review15521002
2015-07-09 15:37:03 +02:00
Cédric Krier 7459aab3d1 Use CURRENT_TIMESTAMP instead of NOW
CURRENT_TIMESTAMP is the correct SQL standard way.

issue4837
review15531002
2015-07-01 19:41:49 +02:00
Cédric Krier 1f18f65c33 Ensure first argument of DatabaseIntegrityError is a string
issue4836
review8191003
2015-07-01 19:39:25 +02:00
Cédric Krier e4546c3459 Add missing alias on selected columns
This is required by python-sql, if the rownum limit flavor is used, to retrieve
only the selected columns.

issue4838
review12231002
2015-07-01 19:34:48 +02:00
Nicolas Évrard 34acc0885b Allow to replace view's root node with an XPATH
issue4802
review19291002
2015-06-23 17:12:18 +02:00
Cédric Krier 44dc331ced Use Constraint instance in ModelSQL._sql_constraints
issue4814
review15491002
2015-06-22 16:57:06 +02:00
Sergi Almacellas Abellana 180d906316 Only return default record if no domain supplied on ModelSingleton search
issue4766
review15401002
2015-06-15 10:19:01 +02:00
Cédric Krier a739a80228 Fix Rule.domain_get usage in many2one
Since changeset a96d8a738cee, Rule.domain_get returns a domain instead of SQL
expression.
2015-06-15 02:19:49 +02:00
Cédric Krier 5478e5463f Don't use subquery to enforce record rule
Rule.domain_get returns now only a domain and Rule.query_get returns the query
which domain_get used to.

issue4800
review8151002
2015-06-15 01:14:47 +02:00
Cédric Krier 0c4725b891 Add target_search option on Many2One
The option allow to select between the subquery or the join format for target
search clause.

issue4798
review16341002
2015-06-15 01:10:59 +02:00
Cédric Krier 375cde4422 Remove unecessary join in Many2Many getter
The target Many2One can be directly used now.

issue4799
review15471002
2015-06-15 01:09:18 +02:00
Sergi Almacellas Abellana fe45917d0b Fix copy of translated fields when records aren't read in order
issue4720
review9231002
2015-05-01 12:07:36 +02:00
Cédric Krier a913a10d0f Add only fields define in context for read
instead of all the depend fields.

issue4401
review8111002
2015-04-11 13:35:28 -04:00
Cédric Krier 2c31955934 Make Property field on Many2One not searchable
issue4673
review14171002
2015-03-27 14:59:57 +01:00