Purposes:
* Remove bridge module event_sale_product_configurator
* Ease developement of product configurators AND product-based sale_order_line configurators
* Fix the tests for those extensions
* Note that despite the widget being extensible, the tests from the other configurators can easily crash when other configurators are installed because of query counts or limited data available in tests environments.
Technical clarifications:
A main product_configurator widget base in odoo/addons/sale, set on the product_product and product_template on the sale_order_line inline list, providing:
* 5 hooks:
* _onTemplateChange for product_product configurators based on product templates
* _onProductChange for sale_order_line configurators based on product_product
Those two hooks are expected to return a boolean promise to know whether the line has been configured or not, avoiding the opening of multiple wizards.
* _isConfigurableProduct
* _isConfigurableLine
If true, a pencil button is shown next to the product/product_template, calling _onEditProductConfiguration when clicked.
* _onEditProductConfiguration
Called when clicking on edit pencil button.
Examples :
Product configurator : odoo/addons/sale_product_configurator module --> product_configurator (true one, the one in sale doesn't do anything until extended)
Sale Order Line configurator : odoo/addons/event_sale/ --> event_configurator, future rental configurator
Traceback coming from tests are currently logged
line by line. This will implies that runbot will have one
ir_logging entry per line which is not practical. More than
that, the log prefix can make the traceback less readable
because of line returns and difficult to copy paste.
This commit simply remove this feature. After discussion with odo
and chs, we will also remove the docstring from test shortDescription
since most of the time this information is not clear and can be accessed
in source code if needed.
closesodoo/odoo#33911
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
If you are logged into a company that differs from the company of your
employee, you won't be able to read the informations on that employee,
and you will have a crash.
Instead of taking the employee linked to the current user, we use search
in order to first apply the ir.rules hence we ensure that we will be
able to read the needed informations.
closesodoo/odoo#33903
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Before this commit, call a controller defined as:
```
@http.route('/route', type='http', auth='public')
def controller_func(self, foo):
do_it()
```
and called with url like /route?foo=1&bar=2
will crash with an exception:
`TypeError: controller_func() got an unexpected keyword argument 'bar'`
Now, we remove the extra parameters if the controller doesn't support it.
This case is not uncommon, you can easily arrive in this case with utm or
debug as extra parameter.
closesodoo/odoo#33962
Signed-off-by: Christophe Simonis <chs@odoo.com>
In JS tests, when the ready code takes too much time, a warning is
logged. As a consequence, the runbot updates the github status as a
failure, causing real pain to people who simply wants to merge their
features.
With this commit the warning is changed into an info and the runbot will
be happy.
closesodoo/odoo#33931
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
export.selection.withdefault and export.selection both have a selection field
with Foo and Bar as possible selections.
When doing
self.env["base.update.translations"].create({'lang': 'fr_FR'}).act_update()
the base.update.translations wizard exports the translations of ALL modules,
including the ones of the test_impex module.
The generate po entry is something like:
#. modules: test_impex, test_translation_import
#: selection:export.selection,value:0
#: selection:export.selection.withdefault,value:0
#: selection:test.translation.import,import_type:0
msgid "Bar"
msgstr "Bar in french"
but may also be
#. modules: test_translation_import, test_impex
#: selection:export.selection,value:0
#: selection:export.selection.withdefault,value:0
#: selection:test.translation.import,import_type:0
msgid "Bar"
msgstr "Bar in french"
(not sure where the indeterminism comes from)
which creates 3 translation entries that are sometimes linked to the module
test_impex (ignored when exporting the translations of test_translation_import)
but are sometimes linked to the module test_translation_import instead
In the second case, this makes 3 more translations that is was supposed to
exist.
This commit hides the symptom by making sure there is no longer a clash
when exporting the translations of the module test_translation_import.
A real fix to avoid creating unnecessary translations during an execution of
the base.update.translations wizard must also be made in the future.
It is assumed the unnecessary translations problem was already present before
a7621137cb but polib introduced the indeterminism
making the test fails from time to time.
closesodoo/odoo#33958
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Since forward-port, `/sale/get_combination_info_website` and `_cart_update`
would lead to a concurrency error.
Indeed, the session would not have an order_id at first. Then both rpc would
be sent at the same time:
- `cart_update` would create an order and add it in the session
- `/sale/get_combination_info_website` would end up calling `_compute_cart_qty`
which would call `sale_get_order` and would set the `sale_order_id` to none,
just aftet the `_compute_cart_qty` would actually add an order in the
session, simultaneously.
closesodoo/odoo#33993
Signed-off-by: Christophe Simonis <chs@odoo.com>
Co-authored-by: Romain Derie <rde@odoo.com>
Co-authored-by: Christophe Simonis <chs@odoo.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
In order to setup the tour environment, the tour would create and write on
some records.
This part of code could be moved from JS to python to avoid potential
concurrent error and to gain time.
Comparing the length of the recordset is not enough for determining if
there is changes on m2m.
This also fix the merge of f14ae73a98 and
d0bb596f1d
Oversight of previous forward-port.
Before this commit, the test `list: edit view menu item` would sometimes crash
as now the debug manager loads its templates with an `xmlDependencies` where it
was not the case before (included in base.xml), see 73327db065.
Remove ugly custom po files parser and use polib for reader and writer.
Refactor reader/writer to use a class and have an abstraction for csv or po files.
Task-id: 1986334
closesodoo/odoo#32165
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
if an POEntry has an occurrence with a 0 res_id
>>> entry.occurrences.append(("selection:report.paper,format", 0))
>>> str(entry)
#: selection:report.paperformat,format
...
Use the string '0' to bypass this
This probably a bad idea for odoo but is definitly a bad idea for pofile
As shown in gettext reference, the spaces are used as separator in po files
https://www.gnu.org/software/gettext/manual/html_node/PO-Files.html
For instance
#: src/msgcmp.c:338 src/po-lex.c:699
#, c-format
msgid "found %d fatal error"
msgstr "..."
The line "model_terms:ir.ui.view,arch_db:website_sale.search count"
was considered as two references:
- 'model_terms:ir.ui.view,arch_db:website_sale.search'
- 'count'
Correct external id of fleet, even if not translatable
fields account_id and refund_account_id on account_tax_template have been moved on the repartition line of the same model.
closesodoo/odoo#33829
Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
When talking via the Live Chat to a known partner, should be able to see
his name in the chat window title, from the commit: c04b9c019e
the partner name wasn't showing in the title as sudo is being used.
After this commit, known partner name will be shown in the
Live Chat window title.
And improving a test case, in which we're checking for the known partner's
name in the chat window title.
task-1940407
closesodoo/odoo#33831
Signed-off-by: Martin Geubelle (mge) <mge@openerp.com>
Creating a new database with only website_sale_coupon installed will
make some (website_)sale_coupon tests fail. This is due to a race condition
messing with the value of the pricelist product.list0 currency.
The tests are failing due to amounts being compared after the USD
currency rate of 1.2834 has been applied.
Example on a 10% discount:
expected:
>>> 320 * 0.9
288.0
actual:
>>> 320 * 1.2834 * 0.9
369.62
This is due to
https://github.com/odoo/odoo/blob/3cf9cfc985950c30c6b76480f77f5ffe53650b24/addons/website_sale/data/demo.xml#L228
overriding the value to USD. The tests should not rely on this.
This commit aims to ensure the currency is enforced before each test run.
closes#4371
Signed-off-by: Christophe Simonis <chs@odoo.com>
X-port/Cherry-pick of odoo/enterprise@c1cc464c44
Now in 12.3, when the a editable list view is grouped, the "Create"
button is no longer shown as was the case before (when it would open the
form view when clicked).
In 12.3 when lines are resequenced, the position of the current line
does not take into account that it could have been changed (because of
drag and dropping a line before or after).
opw-1966589
closes#33878