Commit Graph
33 Commits
Author SHA1 Message Date
nie 1db8e17ef7 [FIX] website_form: user dynamic fields without readonly attribute
Steps:
- Install studio, website_form
- Go to Settings > Users & Companies > Users
- Click the Studio icon
- On the top bar, click Website
- Click New Form
- In edition mode, click the first label
- Select Customize > Add an Existing Field

Bug:
Traceback here:
https://github.com/odoo/odoo/blob/3ff00944fe6a439bd5d7bddb846206d3d6cac3a0/addons/website_form/models/models.py#L73
KeyError: 'readonly'

Explanation:
Dynamic selection fields don't declare a 'readonly' attribute:
https://github.com/odoo/odoo/blob/3ff00944fe6a439bd5d7bddb846206d3d6cac3a0/odoo/addons/base/models/res_users.py#L1275-L1282

opw:2449356

closes odoo/odoo#65894

X-original-commit: 5a74dc2ca8aadb7d91d9cf7c047065fee3263ece
Signed-off-by: backspac <backspac@users.noreply.github.com>
2021-02-10 15:00:48 +00:00
fja-odoo 7248982280 [FIX] website_form: fix many2one_reference field
The many2one_reference is not a field that makes sense with the
form builder.

part of: https://github.com/odoo/odoo/pull/45280

task-2196797

closes odoo/odoo#45339

X-original-commit: 3e61ca5008e19c36aacedf57836dbd4369607e45
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-02-13 16:53:15 +00:00
Nicolas Martinelli 206b197cc9 [FIX] website_form: remove evaluated domains
- Install helpdesk_stock
- Publish the team Customer Care on the website
- Edit the ticket submission form
- Add the field 'Lot/Serial Number'

A crash occurs because of a malformed domain.

It happens because the domain is a string, and therefore should be
evaluated.

We remove the string domains since it won't be possible to evaluated
them in the website form anyway.

opw-2176144

closes odoo/odoo#43427

X-original-commit: abc85e176e337f61926d92cdf33680037af1dd96
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-01-16 15:12:21 +00:00
Jeremy Kersten 546f3cac3f [IMP] website: redo res config settings
task-2088625

closes odoo/odoo#40715

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-12-17 17:07:30 +00:00
Raphael Collet c552fb7a61 [IMP] api: remove deprecated decorators 2019-07-08 13:51:35 +00:00
Raphael Collet 3520eee8eb [FIX] website_form: avoid default_get() to crash by using superuser 2019-07-04 11:32:22 +00:00
Jigar Patel 6404233bb0 [IMP] wesbite_form: add mechanism to allow default atttibutes to form
That way, it is possible to add the template, fields and success page to
different type of form.
Next commits will use what has been done in this commit.

task-32212
2019-04-19 10:39:16 +00:00
Adrian Torres 3f4f77fd9d [REF] *: adapt code to new related default behaviour
This commit adapts the business code to changes introduced by
the parent commit in order to keep the same behaviour as before.

All readonly=False fields will have to be checked afterwards to confirm
that the business case requires write access to the source field.
2018-09-27 12:10:23 +02:00
Nimesh Jethva 53e8aba1ab [IMP]website_*: Improvement in model description
Purpose of this commit is to give description more "business oriented"
because those descriptions appears in Odoo Studio which is supposed to be used by end users, not only by developers.

Related Task ID : 37311
2018-09-21 11:45:15 +02:00
Romain Derierde-odoojke-odoo
65d8177b55 [REF] website*: revamp res_config_settings for website
Reorder res.config.settings for website
Make website_id in no create in most view
Revamp res.configsetting and view Form simplified

Transform old 'useless' stored field for presentation by computed field.
We can consider that if there are not key, feature is disable.

Co-authored-by: rde-odoo
Co-authored-by: jke-odoo
2018-08-24 20:01:02 +02:00
David 1f30260f85 [FIX] website_form: metadata recording 2018-06-11 13:04:13 +02:00
Olivier Dony 695716efb0 [FIX] P3: remove pycompat.{keys,items,values} helpers
Now that we're closer to switching to P3 for good, these helpers have
outlived their usefulness, and mostly add noise.

All remaining dict.iter*() or dict.view*() must be converted to the
normal keys(), values() or items() calls.

Whenever the result is likely to be used for more than the scope of a
loop, or when the dict needs to be modified during iteration, the calls
must be wrapped in a ``list()``, to protect the new P3 semantics.
Those cases are very exceptional.

Also removed some dead code or improved the API to remove unnecessary
conversions.
2017-08-20 23:25:54 +02:00
Christophe Simonis bf51fe55a1 [MERGE] forward port branch saas-16 up to 0f2b2c4e2b 2017-07-07 14:30:30 +02:00
Christophe Simonis 780ae8a808 [MERGE] forward port branch saas-15 up to 10cb34bcac 2017-07-04 18:14:13 +02:00
Christophe Simonis 10cb34bcac [MERGE] forward port branch saas-14 up to 97258040d8 2017-07-04 14:40:20 +02:00
Christophe Simonis 97258040d8 [MERGE] forward port branch 10.0 up to 657e328903 2017-07-04 13:17:16 +02:00
Nicolas Martinelli d1e92c312f [FIX] website_form: send email with subject
- Use the form builder to send an email
- Customize the snippet to include the subject and the body
- Send a mail

=> The subject is not included in the email

This is because the subject is filtered out and considered as a
blacklisted field.

It happens because `mail.mail` inherits from `mail.message`. The field
property `website_form_blacklisted` is set to:
- `True` for `mail.mail`
- `False` for `mail.message`

Since we go through all inherited models, the property on `mail.mail` is
overriden by the property on `mail.message`.

It is actually not necessary to go through all inherited models, since
in the case of `inherits`, we copy the fields of the inherited model to
the target model. The check is simplified by only checking the fields of
the current model.

Based on work of @nla-odoo

opw-748926
2017-06-30 10:20:56 +02:00
xmo-odoo fffaf735f5 [FIX] P3: list -> iterable builtins (#16811)
In Python 3:

* various builtins and dict methods were changed to return
  view/iterable objects rather than lists
* and the separate Python 2 view/iterable builtins and methods were
  removed altogether

This is problematic when using these items as list (which the happens
repeatedly in Odoo), but more viciously when iterating *multiple times*
over them (which also happens, which I've messed up multiple times while
writing this, and which is a pain to debug even when you've just created
the issue).

Convert all code using these to semantics-matching cross-version
helper functions to get the LCD behaviour between P2 and P3, and
forbid the builtins via lint.

issue #8530
2017-05-10 09:39:55 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Jeremy Kersten 9edaf9fdf0 [IMP] website_form, website_hr_recruitment: improve thankyou page
Improve thank page after the application to a job.
Stop duplicate Magic field, using global fields
Add helper method on website to retreive the last created record
2017-03-10 18:20:11 +01:00
Raphael Collet d0591c18e5 [REF] base: refactor the API of model, field, constraint and relation reflection
Simplify the API as much as possible, and delegate all the implementation
details to the models `ir.model`, `ir.model.fields`, `ir.model.constraint` and
`ir.model.relation`.
2017-02-22 15:16:35 +01:00
Raphael Collet 5d746d0ac6 [IMP] base, *: tighten ir.model access rights
Remove unrestricted "read" access.  To make code internally using `ir.model`
work, add a private method `_get` on `ir.model` to retrieve the record
corresponding to a model name, without access rights issue.

Change signature of method `get_authorized_fields` to make it use a model name
instead of a model id.  This removes the necessity of a search on `ir.model`.
2017-01-03 16:52:49 +01:00
Martin Trigaux 11812b0b9e [FIX] all: remove external ids fakely from base
Several modules defines records with the external ID `base.foo_bar` while it is
created inside this module (typically menus and groups).
While there is no technical reasons to do so but this may introduce issues:

- these records will not be deleted during uninstall
- if a language is loaded before the installation of the module, it won't be
  translated

The uninstallation will only remove the records with an external id linked to
this module (these would only be removed when removing base).

Installing a language before the module will drop the translations not linked
to an existing external id (as it can not be resolved).

This commit correct all the external ids tagged as from base or other incorrect
modules.
2016-09-02 16:14:26 +02:00
Christophe Simonis 235ed4b2c1 [MERGE] forward port branch saas-12 up to 9ad5f26 2016-08-20 18:08:19 +02:00
Raphael Collet 305ff7a31e [MIG] complete migration of special methods like init 2016-08-11 12:09:57 +02:00
Thibault Delavallée c8a313d51e [IMP] various: use odoo for imports instead of openerp and update class names 2016-08-10 15:48:07 +02:00
Thibault Delavallée 7150121191 [FIX] various: fix fields index parameter in new API still called select 2016-08-09 11:26:46 +02:00
Martin Trigaux 90254beedb [MERGE] forward port of branch 9.0 up to 00ee6e7b 2015-12-01 10:30:44 +01:00
Xavier Morel e3a2448ebe [ADD] form builder whitelisting: ACL check
Only users who can edit the website's structure should be allowed to
whitelist fields.
2015-11-30 16:39:13 +01:00
Xavier Morel 2afb5b43ef [IMP] form builder fields blacklisting
* blacklist all fields by default
* don't use blacklist in get_authorized_fields which is called to see if
  a field can be added to a form, instead only use it afterwards to see
  if the field can be written to by the formbuilder. That way
  formbuilder can whitelist fields which are actually added to forms
  on-demand resulting in a more secure interaction
2015-11-30 16:39:13 +01:00
Martin Trigaux a2f6e77b08 [FIX] English
Typos, unclear, rephrase, harmonise terms.
Thanks Transifex reporters!
2015-11-17 16:54:18 +01:00
David Monjoie d210744ef0 [IMP] website_form: various improvements
- Fixed the module name and category in manifest
- Fixed website_form_blacklisted being ignored
- Unauthorized readonly and magic fields
- Reset the form on successfull submit
- Added missing date field
- Added date and datetime validation
2015-09-15 14:00:36 +02:00
David Monjoie a77f5cf42f [ADD] website_form: generic form controller
Contains a new ajax post function that comes from mdo's
original code and that I was not able to get rid of.
2015-08-26 16:01:19 +02:00