Commit Graph

136 Commits

Author SHA1 Message Date
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
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 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 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
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
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
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
Raphael Collet 0cd5dc1195 [IMP] base_action_rule: put the 'loop avoidance' code together
bzr revid: rco@openerp.com-20121221142220-c5wjr9m4suq3jfdm
2012-12-21 15:22:20 +01:00
Raphael Collet 375a5820ae [MERGE] lp:~c2c/openobject-addons/trunk-trg_dates-base_action-rule-20120510
replace the field 'trg_date_type' by a many2one field to ir.model.fields

bzr revid: rco@openerp.com-20121221113957-gd1c80h4vszg1h4g
2012-12-21 12:39:57 +01:00
Raphael Collet a7ef28fd94 [IMP] base_action_rule: make code more robust
bzr revid: rco@openerp.com-20121221105436-3t553dlzdvjb5hfe
2012-12-21 11:54:36 +01:00
Raphael Collet d17d474fc7 [IMP] base_action_rule: remove unused import
bzr revid: rco@openerp.com-20121221103812-u6ejn5rifw2ctjsx
2012-12-21 11:38:12 +01:00
Raphael Collet 306267ef55 [IMP] base_action_rule: improve field labels
bzr revid: rco@openerp.com-20121221103233-lllh3c5f1azuffc7
2012-12-21 11:32:33 +01:00
Raphael Collet fed5651f1c [IMP] base_action_rule: small code improvement
bzr revid: rco@openerp.com-20121221103003-tl689nm2ser3u001
2012-12-21 11:30:03 +01:00
Raphael Collet ee5121a590 [IMP] base_action_rule: remove deprecated field act_state from base.action.rule
bzr revid: rco@openerp.com-20121221102753-qejsv25g952gz8nx
2012-12-21 11:27:53 +01:00
Raphael Collet b2864c4feb [FIX] crm: adapt overridden method of base_action_rule
bzr revid: rco@openerp.com-20121220162615-zerev9bxpcqxtip1
2012-12-20 17:26:15 +01:00
Raphael Collet 5301d15429 [IMP] base_action_rule: improve code using datetimes
bzr revid: rco@openerp.com-20121220143914-qwxmiixc4d455u5h
2012-12-20 15:39:14 +01:00
Raphael Collet 5662720773 [IMP] base_action_rule: refactor code
bzr revid: rco@openerp.com-20121220142445-emzzvhlw400q37c9
2012-12-20 15:24:45 +01:00
Raphael Collet d29a1bf9b1 [IMP] base_action_rule: change the field 'server_action_ids' into a many2many
bzr revid: rco@openerp.com-20121220132318-mjc46h4mnw63svok
2012-12-20 14:23:18 +01:00
Raphael Collet 0228273ffb [FIX] base_action_rule: fix in wrapper method
bzr revid: rco@openerp.com-20121219150723-n25qqmczh3oau1cn
2012-12-19 16:07:23 +01:00
Raphael Collet 07a3cf28a0 [IMP] base_action_rule: improve method _register_hook of base.action.rule
bzr revid: rco@openerp.com-20121219150533-t513zasagd4a73sx
2012-12-19 16:05:33 +01:00
Raphael Collet e6cfbc5807 [IMP] base_action_rule: improve field definitions, add missing domains and restrictions
bzr revid: rco@openerp.com-20121219142345-pya9tjhd9ilepxy7
2012-12-19 15:23:45 +01:00
Raphael Collet b35e1cb321 [IMP] base_action_rule: remove unused stuff
bzr revid: rco@openerp.com-20121219142235-uqs7m7jmeqh38bdt
2012-12-19 15:22:35 +01:00
Raphael Collet 29ee76d744 [MERGE] from trunk
bzr revid: rco@openerp.com-20121219130953-tq0e2mzw145j1ewx
2012-12-19 14:09:53 +01:00
Vo Minh Thu e7f4891d46 [IMP] use the openerp namespace.
bzr revid: vmt@openerp.com-20121206145632-0h1coh5aaem65wsy
2012-12-06 15:56:32 +01:00
Arnaud Pineux 638dcfce34 [IMP] base_action_rule : delete unused fields and add explanation
lp bug: https://launchpad.net/bugs/944197 fixed

bzr revid: api@openerp.com-20121204153617-ju3yyj2tt3d84jl9
2012-12-04 16:36:17 +01:00
Arnaud Pineux 7e8533d278 [FIX] old actions based on filters still work
bzr revid: api@openerp.com-20121128120100-58xrtp54txigz0b5
2012-11-28 13:01:00 +01:00
Arnaud Pineux 3df8c5fe9a [IMP] Base Action Rule (only filter conditions)
bzr revid: api@openerp.com-20121128092928-7kbs1d9g8ung4oul
2012-11-28 10:29:28 +01:00
Arnaud Pineux 9137243cdc [FIX] _register_hook refactored (test)
bzr revid: api@openerp.com-20121126133257-f9j7vfgdfkqjewyn
2012-11-26 14:32:57 +01:00
Arnaud Pineux 41e9eadc61 [FIX] _register_hook refactored
bzr revid: api@openerp.com-20121126131017-55e2x4e75nmabt27
2012-11-26 14:10:17 +01:00
Arnaud Pineux 8474567cdf [FIX] Automated Action rule (register_hook)
bzr revid: api@openerp.com-20121126125142-9gpsupy7617vddya
2012-11-26 13:51:42 +01:00
Arnaud Pineux 041e43967c [IMP] add comment
bzr revid: api@openerp.com-20121126114405-s3b3lo6qncho2n37
2012-11-26 12:44:05 +01:00
Arnaud Pineux 72616d0ba2 [FIX] Automated Action Rules
bzr revid: api@openerp.com-20121126112248-oiq40hn9lgro0lq4
2012-11-26 12:22:48 +01:00
Arnaud Pineux 0ab1526d1a [FIX] 2st test for automated action
bzr revid: api@openerp.com-20121123110056-v059mn0jpgqe6svl
2012-11-23 12:00:56 +01:00
Arnaud Pineux db5a4e7075 [FIX] 1st test for automated action
bzr revid: api@openerp.com-20121123103113-x9rspq1oh1887153
2012-11-23 11:31:13 +01:00
Vo Minh Thu abbe3ac1de [MERGE] removed a few warnings.
bzr revid: vmt@openerp.com-20121106150431-rem9us13kevan8y0
2012-11-06 16:04:31 +01:00
Harry (OpenERP) e857c86128 [MERGE]
bzr revid: hmo@tinyerp.com-20121010072631-68qcg1zzec0s1318
2012-10-10 12:56:31 +05:30
RGA(OpenERP) 8e2e69976a [FIX] crm: Field 'categ_id' does not exist on browse
bzr revid: rgaopenerp-20121003133320-pmkxe7i9iq4q71z8
2012-10-03 19:03:20 +05:30
Harry (OpenERP) 1b319e527d [IMP] base_action_rule: improve demo data
bzr revid: hmo@tinyerp.com-20121009121712-r6to5oia4ikiutpi
2012-10-09 17:47:12 +05:30
Harry (OpenERP) 257b3974b5 [FIX] base_action_rule: argument in _action
bzr revid: hmo@tinyerp.com-20121009111221-dris93pcszjj11es
2012-10-09 16:42:21 +05:30
Harry (OpenERP) 76d93f251e [IMP] base_action_rule: clean _check function and demo data.
bzr revid: hmo@tinyerp.com-20121009104314-ers6tznkwiyeb3v1
2012-10-09 16:13:14 +05:30
Harry (OpenERP) e84b3f2493 [IMP] crm: demo data of action rule
bzr revid: hmo@tinyerp.com-20121009075340-ogm51x9z2irmzijt
2012-10-09 13:23:40 +05:30
Harry (OpenERP) 82ab8bf9a3 [IMP] base_action_rule: improve view and server action should be one2many instead of many2many
bzr revid: hmo@tinyerp.com-20121005080325-3vcja1mog3yfthtr
2012-10-05 13:33:25 +05:30
Harry (OpenERP) ac4a137576 [FIX] base_action_rule: do not subscribe again if already follow document
bzr revid: hmo@tinyerp.com-20121005072001-6qy5yusrpw4n5xno
2012-10-05 12:50:01 +05:30
Harry (OpenERP) ca052f4235 [IMP] base_action_rule: now able to run multiple server actions in rule
bzr revid: hmo@tinyerp.com-20121005071229-6jmrghoz1nkcnnwh
2012-10-05 12:42:29 +05:30