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>
`Products` and `Stock Move Lines` are main models, for which the creation is batch happens frequently. Their creation in batch shouldn't be split because of one "create single" override.
closesodoo/odoo#48874
Forward-port-of: odoo/odoo#48838
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Products are created in batch, unless hr_expense is installed, because its create
override isn't defined and implemented for batch creation.
Because products creation in batch can be up to 10 times faster than creation record
by record, it is important to ensure the creation of products is always done in batch.
X-original-commit: e8e34ed5b66274264c27e9a379a7857e086e5264
Similar to 186b599246321465eae937b875b6c970656b145a
opw-2229306
closesodoo/odoo#48873
X-original-commit: ac5f269fc514a041f51b5ad2039ac80b37f25abd
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Steps to reproduce the bug:
- Let's consider a vendor V with a supplier currency €
- Let's consider the current company's user C in $
- Let's consider two vendor bills journals J1 in € and J2 in $ from C
- Create a vendor bill for V
Bug:
The default currency was $ instead of € and the default journal was J2 instead
of J1. This fix keeps the same behavior as implemented in 82794c8662
opw:2226115
closesodoo/odoo#48857
X-original-commit: 801182f6222521c2961560b3b67743a143a22eff
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Using the `complete_name` allows searching more easily in case several
sub-locations have the same name.
Closes#38733closesodoo/odoo#48846
X-original-commit: 764433669b8b9d675bd9e3ec6668c4b166901534
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Showing these fields does not actually make sense when bank_account_id isn't set as well, since setting them and saving will result in them losing their value (as they're actually related on an empty field). We need to hide them while bank_account_id is not set.
closesodoo/odoo#48842
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Steps to reproduce the bug:
- Module website is installed
- Multi companies is set
- Go to Website > Settings
- Remove the company for the current website and save
Bug:
A traceback was raised
opw:2228183
closesodoo/odoo#48839
X-original-commit: 2c27b9d100c1f3759bfe864f8ac78bc5c0436ecd
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
In some situations, the context can contain a default journal id. When creating the cash
basis entry, we are correctly retrieving the Cash Basis Journal for the account.move, but
as we do not explicitly set the journal on the account.move.line also, it is using the
context default value for journal_id (usually the customer invoices journal). As journal_id
on account.move.line is a related field to journal_id of account.move, we are wrongly
updating it. We should populate journal_id on account.move.line explicitly to avoid this.
closesodoo/odoo#48837
X-original-commit: 73bcbdfddf0751d9aba27c9d101f60e6e844edb2
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
Since the wizard to set a logo and chose a layout has been removed, we
don't need anymore to throw an error if they are not set because the
report can be generated.
closesodoo/odoo#48831
X-original-commit: b7c7039667d9ec816e647a0dd30570a4a690cca2
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
If a user with Sales rights but no Accounting rights is trying to send an already
paid invoice, it will raise an access rights error before this commit while we
should allow him to send it without error.
closesodoo/odoo#48820
X-original-commit: 27cb9197c6b64fb9cb8fe46a20d9557914045e59
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
Steps to reproduce the bug:
- Let's consider an instance with crm_iap_lead and crm_iap_lead_enrich installed
- Uninstall crm
Bug:
An error was raised: ('Record does not exist or has been deleted.\n(Record: ir.model.fields(15085,), User: 1)', None)
because the field reveal_id is shared on model crm.lead and modules crm_iap_lead and crm_iap_lead_enrich are independent
from each other.
Inspired from https://github.com/odoo/odoo/commit/ff7efbb1e81cd6987601c03f0b75a37d2df8e331
opw:2224952
closesodoo/odoo#48813
X-original-commit: 80879be5d7ab863a097439df1cd61aa236edaca4
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Issue
- Install Website
- Edit your website
Do this 8 times:
- Add the block "Image - Text" under each product
- Make image on left smaller and text longer
- Edit the size/color of the title and the description
There is some case where it will crash
Cause
We override the method who gets the editor:
`x = $('[data-note-id="' + list.last($target.attr('id')) + '"]');`
When there is more than 9 editors in the page
(because we edited 10 different HTML fields), we reach the
editor with ID 10 but the code erroneously will not find the
editor with ID 0
Solution
Use this instead:
```
x = $('[data-note-id="' + list.last($target.attr('id').split('-')) + '"]');
```
OPW-2218467
closesodoo/odoo#48810
X-original-commit: c95fad77ea5b4663130e256f76031560171f09e6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
The geolocation service from OpenStreetMap will not be unblocked until a
'meaningful' and identical user-agent added in the request.
opw-2221857
closesodoo/odoo#48805
X-original-commit: 9018039b835547ea4adbc32a23901214613a033a
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Issue
- Install Accounting & Studio
- Accounting > Open studio
- Reports > Invoices
- Add a Field Column in the table
and drag it after "Description"
Some elements are shifted, which
causes inconsistency in the table
Cause
In 924ca78068 we added
a th "source document" with
a td containing the value.
In bc131c0cfb we removed
the td but not the th.
Studio adds hook after each th & td.
Since there is th but no td, there is an
inconsistency in the hooks.
Solution
Remove the th from the view to avoid having
a useless hook.
OPW-2226726
closesodoo/odoo#48798
X-original-commit: 351355c8cb8c64927b5f82d4c1e1deca74353305
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
- Have a clean V13 db with point_of_sale and account_accountant
- General Settings => Accounting => Check "Anglo-Saxon Accounting"
(debug mode)
- Choose or create a storable product P with category C
- Go to category C and set 'inventory valuation' to 'automated'
- Open a new POS session PS
- Sell product P with qty 1
- Pay
- New order
- Sell product P with qty -1 (refund)
- Pay
- Close session PS
- Validate session PS
Error "You are trying to reconcile some entries that are already
reconciled." will popup because the 0 sum AML is already marked as
reconciled. This can be fixed by avoiding asking reconciliation when the
amount_residual is 0.
opw-2177881
closesodoo/odoo#48799
X-original-commit: 2c5ef4ed7ea98f890f95f8892c8a0df64b88db98
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
opw-2226421
The analytic accounts are not set on creation of a new invoice from a
Sale Order, and when they are set, the default should not override the
values selected on the SO.
This commit reverts what was done in be7d1d7510bc94f949a4fc55a6038a83fb026147
which basically reverted what was done in 69bf61bbc991eee96e673316ae8c37e98e1b8a1d
closesodoo/odoo#48793
X-original-commit: 02c75a70458b45f213a2f26fb16d47e9470fecfe
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Issue
- Preferences > Change your avatar with a big .gif
- Install Forum
- Go on a question
The gif is not resized in the nav and in the post
answer box
Cause
In fact, all gifs are not really resized. They just
look fine because there is CSS to handle the case
where the server resize does not work.
Solution
Do as it is done everywhere else, add CSS rules
OPW-2223260
closesodoo/odoo#48792
X-original-commit: 35137cea7fd0eef067749721ef808acd298e0aae
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
This commit bring back the filters on Project Overview.
closesodoo/odoo#48780
Taskid: 2223820
X-original-commit: 047bf7f2c23157db1c6db3eaa650a43ca8404f63
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Kevin Baptiste <kba-odoo@users.noreply.github.com>
1) Add a hidden optional field to the timesheet tree view.
2) Try to display that field by checking the checkbox.
=> the column appears then directly disappears.
Asynchronous calls (here: fetching the server time) should
always be in the `willStart` method.
Task 2204084
closesodoo/odoo#48775
X-original-commit: 39fa08c4d6a1b467b520bdd0f75950d2c33f4a2e
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: lul-odoo <LucasLefevre@users.noreply.github.com>
Task 2206699
* All the amounts are now expressed in the company currency
- The amounts are taken from debit/credit on the aml
- When opening the report for multiple companies, convert in the
current company's currency
* New default view:
- Group by month instead of category
- Line chart instead of bar chart
- Filter on customers
* Remove useless fields:
- name
- invoice_partner_bank_id
- invoice_payment_term_id
- residual (including taxes)
- amount_total (including taxes)
- nbr_lines as it is a generic feature
* Rename currency_id to the more correct company_currency_id
* Remove useless group_by clause from the SQL query
closesodoo/odoo#47066
Related: odoo/upgrade#1021
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Currently when zoom slowly from right to left on employee image it
will not zoom the image.
currently to hide the zoom image we used target.width() and the method width
gives the width of the selected element (excluding padding, border
and margin) so due to border excluded it will hide the zooming image.
Aslo the offsetHeight property returns the viewable height of an
element in pixels, including padding, border and scrollbar, but not
the margin.
The reason why the 'viewable' word is specified, is because if the
element's content is taller than the actual height of the element,
this property will only return the height that is visible.
so instead of method width we used method outerWidth which gives
width of the selected element (including padding and border, excluding
margin).
closes odoo/odoo#46619
Co-authered-by: Mahendra Barad <mba@odoo.com>
Task: 2199218
Closes: #46619
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>