Purpose of this commit is to synchronize active status of certifications to
their badges. When archiving or activating a certification, its badge is also
archived or activated.
Task ID 2170708
Community PR odoo/odoo#46563
Purpose of this commit is to call toggle_active or archive / unarchive methods
instead of manually writing on active field. Indeed this allows to trigger
business code related to archive / unarchive which is normally located
in toggle_archive (called by action_archive and action_unarchive).
Task ID 2170708
Community PR odoo/odoo#46563
Purpose of this commit is to make use of toggle_active to implement business
behavior linked to active field being changed. In CRM notably
* when archiving: it is considered as lost, and therefore probability is
set to 0;
* when reactivating: void the lost reason and update probabilities for PLS;
In this commit we also update tracking subtype to more clearly track
lost / restored subtypes
* lost: writing a lost reason (resetting it is not lost), archiving
it if no other subtype;
* restored: activating it again;
Task ID 2170708
Community PR odoo/odoo#46563
Toggle method defined on ir.ui.view does the same job of toggle_active that
is the generic one available on all models.
Task ID 2170708
Community PR odoo/odoo#46563
Issue
- Install Forums
- Create a post (name = test)
- Add an answer
- Check your profile > answers
You have an answer named "Re: test"
- Edit the answer
- Check again
"Re: test" disappeared, it's a blank line now
Cause
When editing the answer, we do not pass a name
So if we do name = kwargs.get('name') => None
Solution
Pass the name to the vals if it exists
OPW-2227418
closesodoo/odoo#48970
X-original-commit: c53f1c6a58b4c8c9e9b3c87f27281c9bfd65a0e1
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
Simply avoid computing a field when not necessary.
This saves 0.5% of the total installation time.
closesodoo/odoo#48967
X-original-commit: f3fa93228b6ea8e9e171aaa508ca0218d70406f3
Related: odoo/enterprise#9655
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
The method `_init_column` for the field `alias_id` of `mail.alias.mixin`
requires the reflection of models, because `mail.alias` records have a
many2one field to `ir.model`. The actual initialization of the column
is thus performed in post-init phase (after reflection). Therefore, the
NOT NULL constraint cannot be added right away.
X-original-commit: 2e3400f149ce4ed4c00bc49a519f58993b49bc51
This greatly reduces the number of queries to add foreign keys (notably
for many2one fields).
This saves 6.5% of the total installation time.
X-original-commit: 13a2666b4da09fc0ec7608a974dadde45f76fd7a
Reduce the number of queries to create and drop indexes.
This saves 1.5% of the total installation time.
X-original-commit: 0e1e480da9d971575feba64038c4fa518ebe102b
Create the table with all the columns from scratch, with the NOT NULL
constraint when required. Also do not call `_check_removed_columns()`
on a new table.
This saves 0.5% of the total installation time.
X-original-commit: 0727cacf5194a143b15ab4cb9893f3035a67be1f
Simply avoid browsing records for models, and use classes instead.
This saves 1% of the total installation time.
X-original-commit: 35ebaea098edeb3d34f77305b09cb36e56ea5a92
This optimization is no longer necessary. Thanks to Python 3.6's new
implementation of dicts, the memory footprint difference between slots
and dicts is now around 5%, which is no longer worth the complexity and
performance cost.
This saves 2% of the total installation time.
X-original-commit: c7f17770803744cbbb741fc11265ee914641aed7
Simplify the code to retrieve fields on a class.
Simplify the class attribute that lists the class' proper fields.
Optimize `model._add_inherited_fields()`.
Optimize `resolve_mro` by using classes instead of recordsets.
This saves 3.5% of the total installation time.
X-original-commit: 89ab71905cb6c5d3beda5eac357f8592e31aaef8
Repeated calls to `registry.setup_models()` will eventually introduce
many duplicates in the those attributes, which may slow down the
determination of computation triggers.
X-original-commit: 735e65f7ca45616881336121d10a874412446dcf
Co-authored-by: Xavier Morel <xmo@odoo.com>
When installing a database from scratch, marking all packages (in the
module graph) as 'update' forces the migration manager to retrieve all
migrations scripts... for nothing.
X-original-commit: fd8f3c73c8c30162034c7712fa0993e2408fba89
Avoid logging an error in the logs for an operation that is not an
closesodoo/odoo#48957
Error: if the extension already exists, this is a success.
X-original-commit: 2f884942c94a640ae5107ff2acb27ba4ecc60bc0
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
In a form view, nodes with classname "oe_read_only" (resp.
"oe_edit_only") are only visible in readonly (resp. edit) mode.
Moreover, fields inside a group automatically have an associated
label.
Before this commit, when one of these classnames was set on a
field node inside a group, the effect wasn't applied on its label,
so the label was always visible, even if the field was hidden.
Bug reported in PR odoo/odoo#48699closesodoo/odoo#48968
X-original-commit: 705f434f0f18a0e4d2fdb0f86d3e350d190b2a30
Signed-off-by: Julien Mougenot (jum) <jum@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
activity_type_id is a related field on the first activity to do and should
probably not be reset / forced to a value. It is probably some code coming
from previous implementations of activities that were linked to crm only.
Coming notably from 87e457158e and 42226de46e .
Community PR odoo/odoo#48946closesodoo/odoo#48960
X-original-commit: de2e682824a636062fbb2c47b1bf5d7c7cef18db
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
PURPOSE
Provide fixes for event application in order to fix 13.3 changes.
SPECIFICATIONS
See sub commits for more details. Globally fixes are related to start and
end dates, as well as sold out computation.
* include timezoned event date_end in registration open computation;
* ensure event_registrations_open can always be computed;
* better sold out computation and display;
* improve backend views and help strings;
* add some test for is_ongoing with timezones;
* remove unnecessary copy=True added while converting fields;
LINKS
Task ID 2228189
closesodoo/odoo#48959
Forward-port-of: odoo/odoo#48652
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Commit 397872a07f remove most onchange in event related modules to replace
them by computed r+w stored fields. At that time copy was by default set to
False for computed fields as resulting of standard behavior.
Since 4b274d3b4101fbae154a572cdf40d23838899773 this is not True anymore as we consider those fields are
duplicable. We can therefore remove unnecessary copy=True on fields to clean
their definitions.
Task ID 2228189
Community PR odoo/odoo#48652
X-original-commit: c6b378987bd3351deba7770b51c2a5755f7ff341
Purpose of this commit is to remove some complex check embedded in templates
and replace them by a computed unstored field. It eases definition and
understanding.
Its computation has been cleaned, so that sold out appears only when tickets
are really sold out, not if their end sales date is reached. Sold out label
is displayed in both event list and event specific page views in frontend.
Small spacing issues in frontend registration form are also fixed.
Task ID 2228189
Community PR odoo/odoo#48652
X-original-commit: c36cf90e7b83d2424b2f52ad8a2fec0bf367e8d8
Using a compute_sudo ensure this field is correctly computed (aka without
crash) if someone is allowed to read the event but not all its sub models.
For example event_registrations_open reads the active flag of a product
linked to a ticker which may not be readable by public users. This field
is used in frontend templates and therefore usable by external people.
Also remove unnecessary registrable rendering parameter in website_event
as it has been replaced by computed fields.
Task ID 2228189
Community PR odoo/odoo#48652
X-original-commit: b2b334a65f3a1379f25717ec39f0a52f3305b19c
Purpose of this commit is to try to lessen random conditions being concatenated
in templates by correctly computing event_registrations_open field that is
now correctly based on
* event.date_end -> if event is done, registrations are not open anymore;
* event.start_sale_date -> lowest start date of tickets (if any; start_sale_date
is False if no ticket are defined, see _compute_start_sale_date);
* any ticket is available for sale (seats available) if any;
* seats are unlimited or seats are available;
Some better timezone computation is included even if it could be done better.
Task ID 2228189
Community PR odoo/odoo#48652
X-original-commit: a11af9074499465b6dd8ad1400e60c7af96e21c7
Rumors were heard of is_ongoing not working well. First try with playing
with timezones.
Task ID 2228189
Community PR odoo/odoo#48652
X-original-commit: d54faa336da29ff3167edb2331edd3e2508bc64f
Embedded tickets view: improve labels, start and end dates are now labeled
Sales Start and Sales End when having sale installed.
Help are added on event_registrations_open and start_sale_date to clearly
define what they mean.
Some linting is also performed to ease readability, notably some computed
fields reorganization to have them ordered by group like fields.
Task ID 2228189
Community PR odoo/odoo#48652
X-original-commit: e2deabc451aa2d62365b1e1b43ea3947907d2648
- Create a MO for a product tracked by S/N
- Perform the MO
- Print the 'Finished Product Label (PDF)'
The barcode printed is `False`.
If the S/N is not set on the `move_line`, we should fall back on
`lot_id.name`.
opw-2228337
closesodoo/odoo#48949
X-original-commit: fb69b5a99becd92ee0ee7698709da05a0b33850f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
It's not necessary anymore as all supported Python versions implement
get_instructions, and inlining the usage of that is as readable as
calling _get_opcodes.
Also use the subset/superset predicate for validity testing instead of
difference as it's a fair bit faster:
❯ python3.8 -mtimeit -s 's1 = set(range(10)); s2 = set(range(5))' 's2 - s1'
5000000 loops, best of 5: 88.3 nsec per loop
❯ python3.8 -mtimeit -s 's1 = set(range(10)); s2 = set(range(5, 15))' 's2 - s1'
2000000 loops, best of 5: 159 nsec per loop
❯ python3.8 -mtimeit -s 's1 = set(range(10)); s2 = set(range(5))' 's1 >= s2'
5000000 loops, best of 5: 71.1 nsec per loop
❯ python3.8 -mtimeit -s 's1 = set(range(10)); s2 = set(range(5, 15))' 's1 >= s2'
5000000 loops, best of 5: 53.6 nsec per loop
we're paying double in the failure case but that doesn't super duper matter
because we're raising an exception and bailing out, the 24% gain on the
happy path seems more relevant.
closesodoo/odoo#48948
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Install project,sale_management,industry_fsm
Create a new product with:
- Product type: service
- Service Invoicing Policy: Timesheets on tasks
- Service Tracking: Create a task in sales order's project
- Project Template: Field Service
Save, then edit also Field Service chaning Bill from Tasks to the new
product
Create a sale order with such product, save and confirm
Error Message "An FSM project must be billed at task rate"
will popup blocking the action. This is due to changes introduced in
071711bf1db82ae7fc65dcc1292da6ef82278168 (enterprise commit), new fsm
projects should not have a sale order line, instead rates are derived
from the tasks.
This commit refactor the code of '_timesheet_create_project' to make
possible to override project creation values. In the counterpart commit,
in enterprise, the sale order line id will be removed to match the behavior
of 071711bf1db82ae7fc65dcc1292da6ef82278168
opw-2220184
closesodoo/odoo#48936
X-original-commit: 4094cb12a617df99fdc7d6d8796568217c34c175
Related: odoo/enterprise#9645
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
The "Views > CalendarView > drag and drop on month mode with all_day
mapping" test would fail regulary with "Found 2 elements to click on,
instead of 1" because the drag and drop would be ongoing and the event
would sometimes appear two times in the DOM when we try to click on the
drag and dropped event.
closes#48928closesodoo/odoo#48937
X-original-commit: 9bc0b11b2e255852c1376fe6fa87722186681a73
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
This commit is a fine tuning of 348a5d0a6.
It fixes the same issue but for larger screens
with some themes (e.g. Orchid).
When there are big button to chose the quantity,
this padding is hiding the input's text.
Another solution would be to remove `width: 50%`
but I found that removing the padding is prettier.
OPW-2220893
closesodoo/odoo#48934
X-original-commit: 105a34accc6123cfb6be9738858499737df95613
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
In 3f4092d837d50d25d6c9630d84f67545cf586c7a, the SummernoteManager that
was previously owned by RTE was removed, this was because the wysiwyg
already has one. One problem with this however is that when an editor is
created in an iframe, the wysiwyg is instanciated outside, while the
editor is instanciated inside. This means that they don't have the same
core.bus to listen for and trigger events, such as those used to open
the various editor dialogs. This commit fixes that by always using the
top-level core.bus when opening dialogs. This also has the advantage
that the dialogs are no longer confined to the iframe and can take up
the whole screen, making them more comfortable to use.
closesodoo/odoo#48932
X-original-commit: 68ac735aa7e17e66910f51706829035697dfcc1e
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
replace the "return" with "continue". What should have been done when
the loop that was originally a "foreach" became a "for" loop.
closesodoo/odoo#48919
X-original-commit: 8af8e6ddb2be9a0c57356d075e092b8da42662f0
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The `payment` module introduces a certain amount of payment acquirers,
each one corresponding to a `payment_` module.
When a `payment_` module is installed, this data is updated so that
payments done with the corresponding acquirer change in behaviour using
the provider installed by the `payment_` module.
When a `payment_` module is uninstalled, this data should be reset to
default, more especifically the `view_template_id` and the `provider`
fields of `payment.acquirer`.
This was not possible before this commit, and more importantly it would
make the uninstallation of such `payment_` module impossible as the
`view_template_id` is a required m2o ondelete='set null', which will
make the registry crash. Even if the former wasn't a problem, the
provider field would remain set to a non-existing selection option,
which would make the registry crash (eventually, when checking a record
with such a selection option).
With this commit, we reset these fields to their default value upon
module uninstall.
In 13, the issue with `view_template_id` should be fixed, as required
m2o that are ondelete='set null' are no longer possible. As for the
provider Selection field, a fix should arrive in master soon.
opw-2225333
closesodoo/odoo#48916
X-original-commit: 4f0c1c1bfd71dd1ff6793d0a91b49984c54d1351
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
In a recent commit, we decided to change the image url format generated
by the media-dialog to leverage browser caching using unique.
Unfortunately, when saving an img tag to a binary field, the url parsing
did not support this new url format, causing a traceback when changing
the website logo and attempting to save.
closesodoo/odoo#48914
X-original-commit: 9c618c7f903f1a0b32e067cfd713cd39762250f9
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Go to inventory>product variants (list view), search for
'FURN_78236'.
Set quantity on hand (qty_available) 50
Now, back in list view, adjust your search to FURN_7
QTY on hand for FURN_78236 is 0.
This occur because during the computation of qty_available, the bom
kits (FURN_78236) are calculated first, but the qty_available depends
on the bom lines products, which are calculated only at the end.
Since qty_available became protected by the global environment, it
cannot be recomputed recursively and it is not in cache, thus is 0.
Making the simple products compute first in the _compute_quantity fix
the issue
opw-2226417
closesodoo/odoo#48924
X-original-commit: f41c650f162021bb6c76736c7dcbe4eee059cec1
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- moved company_id in other info tab
- currency_id is shown near journal_id
- invoice:
-- ref renamed to 'customer reference' and move to other info tab
-- payment_reference hidden if state is draft
-- Fixed bug in l10n_in where xpath did not find removed element
- vendor bill: auto-complete only shown in edit mode
was task:2209497
closesodoo/odoo#48913
X-original-commit: 170635c901914cfe8f33fdbe8d498cbd5f54054e
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
- Activate Multi UoM
- Create a product P with 120 Units in stock
- Create a SO for 1 Dozen
120 Dozens are expected in the forecast widget instead of 10 Dozens.
This happens because the various product quantities are always expressed
in the product UoM:
https://github.com/odoo/odoo/blob/c95fad77ea5b4663130e256f76031560171f09e6/addons/stock/models/product.py#L190
We add a conversion when necessary.
opw-2224335
closesodoo/odoo#48885
X-original-commit: 39eab482c765ce0404c2c689aa522a023cac284e
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
*google_drive
Go to a user form view and click on "Change Password" in the action
menus.
=> traceback `Cannot read property 'constructor' of undefined`
This error is raised because `active_domain: undefined` is in the context
and py_eval can't handle an undefined value.
closesodoo/odoo#48915
X-original-commit: 69694c627be42e3d068e48be14026493628a3a8d
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
Co-authored-by: aab-odoo <aab@odoo.com>
Since Bootstrap 4, a popover object does not have an `option` attribute,
as it has been renamed to `config` instead.
This occurrence must have been missed out when we migrated.
closesodoo/odoo#48911
X-original-commit: 662dd304d5a46a028ce74864076361865d759080
Signed-off-by: fja-odoo <fja-odoo@users.noreply.github.com>
- Create an invoice without partner.
- Set a custom receivable account.
- Set a partner => the account used as payment terms is not recomputed that is wrong.
closesodoo/odoo#48898
X-original-commit: 33de1c8f5e459eb26194736c17c053dce3a1c206
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Because: (1) the upgrade starts by committing the current cursor; then
(2) the upgrade instanciates a new registry to use for the database; and
(3) the test cleanup involves setting up the old registry, which creates
a new environment referring to the new registry!
The points (2) and (3) makes the field setup crash when it relies on
data stored on the registry itself: the field in the old registry tries
to set up with data stored on the old registry.
closesodoo/odoo#48920
X-original-commit: f5e5aba9e203b42b661cc3b503fd37051ec20f93
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
The goal is to avoid a class from being added in the dictionary
`MetaModel.module_to_models`.
We use this feature in tests to prevent classes extending models from
triggering bugs when reloading the registry (for whatever reason).
X-original-commit: 12db61b787b2035bf0c1f2a68a24449d484744c8
In 10.0 having a `section`, `subsection` or `subsubsection` on a footer
element would replace the content with the page top three level of
headings.
This was removed in 11.0 with b446930dc after which only `page` (current
page number) and `pages` (total number of page) classes would work.
This commit reintroduces the above-mentionned classes.
opw-2226700
closesodoo/odoo#48888
X-original-commit: 14c6b947ecf222524a577ec6a40d4a6e283aa2ad
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: Nicolas Lempereur <nle@odoo.com>
The note content was not sanitized against HTML content.
This is not considered as a security issue as an activity can only be
created by trusted employees, however there is no reason not to
sanitize it.
Courtesy of Lauri Vakkala, silverskin
closesodoo/odoo#48889
X-original-commit: 970b460295c3d33dbb089ef6b7224b472e6b568d
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>