Issue 9421

Title
Enforce access on record in wizard
Priority
feature
Status
resolved
Superseder
Replace cached-property by stdlib version (issue 9277)
Nosy list
ced, josesalvador, reviewbot, roundup-bot
Assigned to
ced
Keywords
review

Created on 2020-06-16.15:11:28 by ced, last changed 3 months ago by roundup-bot.

Messages

New changeset d597bcd58c45 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/tryton-env/rev/d597bcd58c45
New changeset 2bec62d40123 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/trytond/rev/2bec62d40123
New changeset 65a463d9417e by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/stock_split/rev/65a463d9417e
New changeset b1242f16613f by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/stock_package_shipping_ups/rev/b1242f16613f
New changeset 68815af1249e by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/stock_package_shipping_dpd/rev/68815af1249e
New changeset e285967fc8c2 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/stock_package_shipping/rev/e285967fc8c2
New changeset f499958e6057 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/stock_lot/rev/f499958e6057
New changeset d6cedb836371 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/stock_forecast/rev/d6cedb836371
New changeset ba6418f622a6 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/stock/rev/ba6418f622a6
New changeset f3c6a6d40636 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/sale_supply_drop_shipment/rev/f3c6a6d40636
New changeset f932e00bda20 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/sale_supply/rev/f932e00bda20
New changeset 3a2d60cdff6b by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/sale_advance_payment/rev/3a2d60cdff6b
New changeset 3ef93ee6897a by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/sale/rev/3ef93ee6897a
New changeset 9d1738290427 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/purchase_requisition/rev/9d1738290427
New changeset 1789591561e2 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/purchase_request_quotation/rev/1789591561e2
New changeset 47d2654131f1 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/purchase_request/rev/47d2654131f1
New changeset 35b56ab82de7 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/purchase_invoice_line_standalone/rev/35b56ab82de7
New changeset 17244973db49 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/purchase/rev/17244973db49
New changeset 2d7ba47702bf by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/project_plan/rev/2d7ba47702bf
New changeset c32da14065ba by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/project_invoice/rev/c32da14065ba
New changeset eaba233a1690 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/production_split/rev/eaba233a1690
New changeset d6382235d0aa by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/production/rev/d6382235d0aa
New changeset 730591518faa by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/party/rev/730591518faa
New changeset 1737dc20b268 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/analytic_account/rev/1737dc20b268
New changeset c042ebd7776c by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/account_statement/rev/c042ebd7776c
New changeset 55dad43b3656 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/account_payment_stripe/rev/55dad43b3656
New changeset 6e10d22625db by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/account_payment_sepa/rev/6e10d22625db
New changeset 029588b57a9a by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/account_payment_clearing/rev/029588b57a9a
New changeset f67bd12c3513 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/account_payment/rev/f67bd12c3513
New changeset 22f9bb273979 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/account_invoice_correction/rev/22f9bb273979
New changeset d223109b1b0e by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/account_invoice/rev/d223109b1b0e
New changeset 03d9282c7ba8 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/account_dunning_letter/rev/03d9282c7ba8
New changeset 42a831c05661 by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/account_dunning_email/rev/42a831c05661
New changeset ed21a09a1b1b by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/account_dunning/rev/ed21a09a1b1b
New changeset dba04a4e790f by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/account_deposit/rev/dba04a4e790f
New changeset 5b0edc5a3abf by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/account_asset/rev/5b0edc5a3abf
New changeset c2e1f809947b by Cédric Krier in branch 'default':
Add model, record and records attribute on Wizard
https://hg.tryton.org/modules/account/rev/c2e1f809947b
Author: [hidden] (josesalvador)
Date: 2020-06-17.15:24:32
I don't feel enough secure about my knowledge and abilities in Tryton to contribute with a code review in a patch like this yet but I think they are already enough strong to recognize a very good refactor.

'I love the smell of deleted code in the morning' :-D

Improvement like this talks about the direction and quality of the project itself.

Just this message to congratulate you for your dedication and work.

Thank you.
Author: [hidden] (ced) Tryton committer Tryton translator
Date: 2020-06-16.15:11:27
Most wizards run over a record or a set of records. We get them from the active_* context keys. But we do not:

- ensure the ensure that the active_model correspond to the Model used
- check that user as read access on the ids
- ensure that the model correspond to the model in ir.action.wizard

Moreover we duplicate the code in almost each wizard to get the instances using the active* context keys.

I propose to add in check_access of Wizard, the validation of the active_model and active_id(s). But also to add properties for model, record and records.
History
Date User Action Args
2020-07-07 23:59:14roundup-botsetmessages: + msg59084
2020-07-07 23:59:11roundup-botsetmessages: + msg59083
2020-07-07 23:59:08roundup-botsetmessages: + msg59082
2020-07-07 23:59:06roundup-botsetmessages: + msg59081
2020-07-07 23:59:03roundup-botsetmessages: + msg59080
2020-07-07 23:59:01roundup-botsetmessages: + msg59079
2020-07-07 23:58:59roundup-botsetmessages: + msg59078
2020-07-07 23:58:55roundup-botsetmessages: + msg59077
2020-07-07 23:58:47roundup-botsetmessages: + msg59076
2020-07-07 23:58:42roundup-botsetmessages: + msg59075

Showing 10 items. Show all history (warning: this could be VERY long)