Commit Graph

173 Commits

Author SHA1 Message Date
FalcoBolger 4ba2e91aa4 [FIX] base_action_rule: pass kwargs when calling create/write's origin method 2015-12-07 12:26:40 +01:00
Martin Trigaux ab54722e78 [IMP] base_action_rule: allow to use time in domain
Unlink typical domain evaluation (ir.rule, filters,...), the evaluated domain
for automated actions did not included time in the context so it was not
possible to make time based conditions in domain.

This should be used with care as filters 'Based on Timed Condition' are still
possible and will probably be enough (and safer) in most cases.
2015-07-23 15:33:15 +02:00
Christophe Simonis 88e8107e01 [MERGE] forward port of branch saas-3 up to 505e308 2015-07-14 15:13:03 +02:00
Christophe Simonis 505e308cd6 [MERGE] forward port of branch 7.0 up to e12cece 2015-07-14 15:00:33 +02:00
Denis Ledoux 89e1aae508 [FIX] base_action_rule: using relativedelta instead of timedelta
For the simple reason that `months` isn't an accepted argument
of `timedelta`
2015-07-10 17:18:37 +02:00
Goffin Simon d1c5aa79d5 [FIX] project: active_test
When a project is duplicated, the disabled automated actions don't
have to be applied.

opw:642129
2015-06-12 08:52:18 +02:00
Christophe Simonis e20dcda50d [MERGE] forward port of branch 7.0 up to 99c87b6 2015-05-21 16:33:45 +02:00
Olivier Dony 53980b7c52 [FIX] account, mail, etc.: uniformize evaluated expressions
opw-626694
2015-05-21 16:07:21 +02:00
Olivier Dony 8d745f9f50 [FIX] account, mail, etc.: uniformize evaluated expressions
opw-626694
2015-05-21 15:26:35 +02:00
Raphael Collet f2e4a10e1a [IMP] use model._fields instead of model._all_columns to cover all fields
The old-api model._all_columns contains information about model._columns and
inherited columns.  This dictionary is missing new-api computed non-stored
fields, and the new field objects provide a more readable api...

This commit contains the following changes:

 - adapt several methods of BaseModel to use fields instead of columns and
   _all_columns

 - copy all semantic-free attributes of related fields from their source

 - add attribute 'group_operator' on integer and float fields

 - base, base_action_rule, crm, edi, hr, mail, mass_mailing, pad,
   payment_acquirer, share, website, website_crm, website_mail: simply use
   _fields instead of _all_columns

 - base, decimal_precision, website: adapt qweb rendering methods to use fields
   instead of columns
2014-11-04 13:47:57 +01:00
Denis Ledoux f7723037d6 [MERGE] forward port of branch saas-3 up to 8c4a7cb 2014-11-04 12:30:01 +01:00
Denis Ledoux 8c4a7cb371 [MERGE] forward port of branch 7.0 up to 5035c76 2014-11-04 12:19:58 +01:00
Sandy Carter 1661cf53e9 [FIX] base_action_rule: Make sure model exists before trying to wrap hooks
In certain cases, before running an update unregistered models will try to
register hooks. Trying to wrap create and write on these will cause
AttributeError on model_obj which would be None

Signed-off-by: Sandy Carter <sandy.carter@savoirfairelinux.com>
2014-10-30 10:02:04 +01:00
Christophe Simonis 41afeec7f1 [MERGE] forward port of branch saas-5 up to 9363bc9 2014-09-04 18:03:24 +02:00
Stéphane Wirtel 1ff7ed2758 [IMP] Optimize the schedulers of the calendar, fetchmail and base_action_rules modules
Disable the the crons when they'd have nothing to do, re-enable them when a
task is (probably) introduced
2014-09-02 18:32:27 +02:00
Raphael Collet 130643890d [FIX] base_action_rule: define patched methods inside a function to fix their closure. 2014-07-31 12:43:41 +02:00
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.

- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
2014-07-06 17:05:41 +02:00
Christophe Simonis 1f57528bc6 [MERGE] forward port of branch saas-5 up to 8dfd5ea 2014-06-27 16:14:40 +02:00
Christophe Simonis bdc4dd4a65 [MERGE] forward port of branch 7.0 up to 95cff0b 2014-06-27 16:00:28 +02:00
Jaydeep Barot 026e38b48f [REM] Unnecessary `size` parameters on char fields 2014-06-25 17:13:43 +02:00
Martin Trigaux 60ec300493 [FIX] base_action_rule: more flexible wrapper signature
Some objects (e.g. account.move.line) have a different signature than the classical 'cr, uid, ids, vals, context=None' and may add extra arguments.
This fix allows to create rules on these objects and still pass the valid arguments.
(opw 609204)
2014-06-25 14:42:55 +02:00
Olivier Dony 9f0ecb3572 [MERGE] Forward-port of 7.0 bugfixes up to 4d3a5df 2014-06-12 13:49:32 +02:00
Olivier Dony 5ccfeaaeda [FIX] base_action_rule: automatic commit during background processing of rules
This will make sure already processed rules are persisted
in case a timeout occurs while processing the next ones,
ensuring that *some* progress can be made in most cases.
2014-06-11 18:42:18 +02:00
Olivier Dony cf0be50f04 [FIX] base_action_rule: prevent recursive rule trigger also when processing time-based rules
A safety guard already in place prevents the recursive
trigger of rules while another rule is being executed,
as a simple measure to prevent endless loops.
This guard was missing when processing time-based rules.
2014-06-11 18:42:18 +02:00
Olivier Dony d4356263f2 [FIX] base_action_rule: do not repeatedly trigger already-executed rules based on time condition
A programming error introduced at rco@openerp.com-20121220142445-emzzvhlw400q37c9
fails to properly check when a rule has already been executed in the past.
Time-based rules should only be executed if the trigger date is in the past and:
 - either they never executed before
 - or the last execution date is older than the trigger date
2014-06-11 18:42:18 +02:00
Olivier Dony ff8b843b18 [FIX] base_action_rule: do not force registry reload when writing on a rule unless really needed
Executing a rule always updates the `last_run` value, which would
always force a useless registry reload to occur. Only signal the
change if the rule applies to a model that was not previoulsy
monitored for base action rules.
2014-06-11 18:42:18 +02:00
Olivier Dony bbd813e76e [MERGE] Forward-port of latest saas-2 (incl. 7.0) bugfixes, up to rev. 9127 odo@openerp.com-20140212122042-3m2tysmr31mtecnc
bzr revid: odo@openerp.com-20140212175141-i9yz8zlseglrk8sb
2014-02-12 18:51:41 +01:00
Denis Ledoux 65257c48b5 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9835 revid:launchpad_translations_on_behalf_of_openerp-20140213064742-xiotlx8wzfhexnhc
bzr revid: dle@openerp.com-20140210160759-oybxhdwgv2q4ma5a
bzr revid: odo@openerp.com-20140212122042-3m2tysmr31mtecnc
bzr revid: dle@openerp.com-20140212143044-0c94q4evxl4ltwr0
bzr revid: dle@openerp.com-20140213115951-h7c2o65lgg26aosv
2014-02-13 12:59:51 +01:00
Olivier Dony 5d4f139df2 [FIX] base_action_rule: attempt to reuse creator language when evaluating action filters
Some filters needs to be evaluated with the same
language as their author, e.g. when searching on
translatable field values. When a time-based
action is processed by the scheduled task,
we should thus attempt to reuse the same
language as the author of the corresponding
filter.

bzr revid: odo@openerp.com-20140212113924-77sh4oj6dl2qwqka
2014-02-12 12:39:24 +01:00
Thibault Delavallée f92f824b30 [MERGE] Sync with trunk
bzr revid: tde@openerp.com-20140110124928-jz1ie9qyh6n99fi7
2014-01-10 13:49:28 +01:00
Olivier Dony 89a6771f6a [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9698, revision-id: odo@openerp.com-20131216142049-xh9gxy5cir3p2i09
bzr revid: dle@openerp.com-20131216111534-0w0jdod25ff3iapc
bzr revid: odo@openerp.com-20131216142246-unt6qqb23uq53we1
2013-12-16 15:22:46 +01:00
Olivier Dony d08821442e [FIX] base_action_rule: upon update/create of an automated action in multiprocess mode, force registry reload
Short of signaling the other workers, the (new) automated
rule may be randomly ignored, depending on which worker
handles the request (until the workers all reload
their registries).

bzr revid: odo@openerp.com-20131216142049-xh9gxy5cir3p2i09
2013-12-16 15:20:49 +01:00
Thibault Delavallée 03d7a17880 [MERGE] Sync with trunk
bzr revid: tde@openerp.com-20131210093307-gxn4g59xba3l82zx
2013-12-10 10:33:07 +01:00
Thibault Delavallée 023777a86f [IMP] base_action_rule: added 'on_create_or_write' kind that is triggered
on both creation or update. This kind is added especially for migrations
to help migrating old actions not necessarily tailored for 'on_create'
or 'on_write' kind that are new in saas-2.

bzr revid: tde@openerp.com-20131016091305-k9w3tuayl1kag8oc
2013-10-16 11:13:05 +02:00
Thibault Delavallée 6e1cb5226b [IMP] hr_contract: added override of base_action_rule (+ dependency) to add the possibility to use a user-related working scheduling.
bzr revid: tde@openerp.com-20130902134200-xvy5hb7lqv2wv0um
2013-09-02 15:42:00 +02:00
Thibault Delavallée 4923499534 [IMP] base_action_rule: when using a timed condition on days, allow to use a working calendar to compute days.
bzr revid: tde@openerp.com-20130821105127-182i9f7mzkoo4cf0
2013-08-21 12:51:27 +02:00
Martin Trigaux ccb38117ee [MERGE] Forward porting of saas-1 until rev 8739
bzr revid: mat@openerp.com-20130605090453-e4mg37kms5j1r18n
2013-06-05 11:04:53 +02:00
Vo Minh Thu 3f8551e68c [MERGE] merged trunk.
bzr revid: vmt@openerp.com-20130604131428-nh9ikodh8lit5p7b
2013-06-04 15:14:28 +02:00
Olivier Dony 0f983a0146 [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. 9183
rev-id launchpad_translations_on_behalf_of_openerp-20130531070107-7d2k818beg8965ll

bzr revid: odo@openerp.com-20130603121852-jdl6vlo9dmjk0rlc
2013-06-03 14:18:52 +02:00
Martin Trigaux ab85cf0e86 [IMP] base_action_rule: add help message on trigger date field
bzr revid: mat@openerp.com-20130529104202-ofyadlqo6ax10axe
2013-05-29 12:42:02 +02:00
Raphael Collet 96ad608854 [IMP] general: use registry[X] instead registry.get(X) when X is dynamic
bzr revid: rco@openerp.com-20130329143720-80pkd4csemlk1aqz
2013-03-29 15:37:20 +01:00
Raphael Collet 2a0245b20c [IMP] base_action_rule: use better value names for new selection field
bzr revid: rco@openerp.com-20130304094951-7452svzw0cgzu6jp
2013-03-04 10:49:51 +01:00
Raphael Collet f1f15f52b3 [FIX] base_action_rule: undefined variable (due to code move)
bzr revid: rco@openerp.com-20130301131929-3q4egd9jpasss88w
2013-03-01 14:19:29 +01:00
Raphael Collet 3bad12f1cf [IMP] base_action_rule: adapt views to new field
bzr revid: rco@openerp.com-20130301112705-hqn8wqz1l20ix2tu
2013-03-01 12:27:05 +01:00
Raphael Collet 9c21a6902a [IMP] base_action_rule: update records before executing server actions
bzr revid: rco@openerp.com-20130301110301-xu4iaxi7hysmclm4
2013-03-01 12:03:01 +01:00
Raphael Collet 50a893a66e [IMP] base_action_rule: add selection field on action rules to indicate when to execute them
bzr revid: rco@openerp.com-20130301103649-up2b2yrye2y80e1t
2013-03-01 11:36:49 +01:00
Quentin (OpenERP) 3be6693f3e [MERGE] base_action_rule: adding onchange on model_id in order to get the related field updated. Fix issue 586436. Merge of jco branch with small refactoring and context added
bzr revid: qdp-launchpad@openerp.com-20130225174112-aoe9ts8linp5fx1l
2013-02-25 18:41:12 +01:00
Josse Colpaert 62404c7a72 [FIX] When you change the model, it will change the related domain for the filters
bzr revid: jco@openerp.com-20130221100208-1w6ypan5f3mrv0bm
2013-02-21 11:02:08 +01:00
Raphael Collet 1671b9e03a [IMP] base_action_rule: form view improvement
bzr revid: rco@openerp.com-20121221144934-erkp8md6kq14070a
2012-12-21 15:49:34 +01:00
Raphael Collet 6502ec2af8 [IMP] base_action_rule: typo
bzr revid: rco@openerp.com-20121221142333-ml6saych44rl99ok
2012-12-21 15:23:33 +01:00