Sometimes due to new ids / not existing records for previewing crash may
happen when rendering the preview of templates. In this commit we rewrite
a bit the computation to try to be more resistant.
Task-3093257 (Mail: The Composer Update)
Part-of: odoo/odoo#107356
Using 'res_domain' should always activate the batch mode, either in mailing
or comment mode. In this commit we fix some glitches linked to the usage
of this new mode recently introduced.
Followup of odoo/odoo#99482
Task-3035101 (Mail: Support batch-posting from composer)
Part-of: odoo/odoo#107356
As subtype has no usage in mail mode, let us consider subtype_is_log as being
True in mail mode, as it eases display of buttons. This is its main usage
aka display "Log" instead of "Send" on composer. In mail mode it should
always be send.
Followup of odoo/odoo#99482
Task-2710804 (Mail: Clean MailThread API)
Part-of: odoo/odoo#107356
Previously, reward_id was an array of two elements containing
the ID and name of the reward. But in the frontend,
reward_id is supposed to be an int with the ID
Adaptation of the _prepare_order_line function in the following modules:
- point_of_sale
- pos_restaurant
- pos_loyalty
Now the data is correctly sent to the frontend and the error
is no longer present.
closesodoo/odoo#111048
Signed-off-by: Heinz Robin (rhe) <rhe@odoo.com>
Debit Notes are a type of financial documents that is not very often used. Even though it's an official document type, in many countries their usage is not
Odoo does not come with a preinstalled Debit Note management, but it can be added by installing the module account_debit_note. The module as mostly been developped following localisation requirements, and while it's a corner case, it appears all the time in one of our most critical screen. Let's make it a bit more discrete.
task-3125955
closesodoo/odoo#109539
Signed-off-by: Laurent Smet <las@odoo.com>
All the localisation should be written in english and then translated to the native language of the country. In this case, the Dutch localisation was written is Dutch, this PR translate all the module in english and add the corresponding PO file in Dutch.
closesodoo/odoo#108954
Task-id: 3115909
Related: odoo/enterprise#35345
Signed-off-by: Laurent Smet <las@odoo.com>
Before this PR, all this localisation was written in Finnish, but all the localisation have to be written in english and then translated back in the native language. This PR correct that.
closesodoo/odoo#111107
Task-id: 3151267
Related: odoo/enterprise#36338
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
Before this PR, all this localisation was written in spanish, but all the localisation have to be written in english and then translated back in the native language. This PR correct that.
closesodoo/odoo#110930
Task-id: 3149070
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
All the localisation should be written in english and then translated to the native language of the country. In this case, the Panama localisation was written is Spanish, this PR translate the module in english and add the corresponding PO file in spanish.
closesodoo/odoo#110656
Task-id: 3127385
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
All the localisation should be written in english and then translated to the native language of the country. In this case, the Uruguayan localisation was written is Spanish, this PR translate the module in english and add the corresponding PO file in spanish.
closesodoo/odoo#109504
Task-id: 3126154
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
Steps to reproduce:
- increase price_precision in decimal accuracy (in debug mode)
- create a product with multiple digits
- create a PO with that product
- unit price is rounded to 2 digits (currency pricision)
Bug:
in previous versions conversion was only done if currency
was different
Fix:
do not round during conversion and round to the highest digits
(alternatively we could revert to only converting if currecy is
different and accept the loss of precission in that case)
the wrong currency was used also for the conversion
opw-3050044
closesodoo/odoo#111223
X-original-commit: 2e46bf073c2251ce3d3ab5d5184feceb741df6db
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Walid Hanniche (waha) <waha@odoo.com>
The lack of a default `options` parameter for `toggleLinkTools` led to a trace
when this method was called without parameters.
This method was introduced by [1].
This commit fixes it by adding an empty object as default parameter.
[1]: https://github.com/odoo/odoo/pull/106796/commits/862d93f9eef16ec45b0d27b246fae560f7feaf1e
task-3149496
opw-3149496
opw-3151829
closesodoo/odoo#111222
X-original-commit: 24293e2a3217d0b851a3ab1c083f2984efb31d60
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Since [1] when selecting item images, the 'Blocks' tab is displayed
while the options are refreshed. This is visible because the image
selection awaits an RPC which therefore allows the browser to render
the 'Blocks' tab selected version of the display.
This commit prevents the return to the 'Blocks' tab to be rendered by
waiting for the image info to be obtained on start.
Steps to reproduce:
- Drop an "Items" block.
- Click on an image.
- Click on another image.
=> The options panel flickers on the 'Blocks' tab before showing the
second image's options.
[1]: https://github.com/odoo/odoo/commit/0acc5e784b15d9c963660da3781763448503f33e
task-2821398
closesodoo/odoo#111094
X-original-commit: d5cb2810968476b82f30582cd0d6cfdbaf351b2b
Signed-off-by: Guillaume-gdi <gdi@odoo.com>
Co-authored-by: Benoit Socias <bso@odoo.com>
Before this commit:
Importing multiple translations was failing due to concurrent update
After this commit:
1. `translation_importer.save` is moved out of the `try except` to prevent
`UserError` overriding `OperationalError`. So the service can retry the
transaction.
2. batch import is supported to allow RPC to import multiple translations at
once, which is faster and has lower chance to trigger OperationalError
closesodoo/odoo#111211
X-original-commit: 0545f323a67a3bf42d76c94c4d4c375245a69417
Signed-off-by: Raphael Collet <rco@odoo.com>
before this commit, when try to create a sale order without inputting pricelist field it was showing exception like "The operation cannot be completed:
- Create/update: a mandatory field is not set."
after this commit, user cannot save the record without filling pricelist field
closesodoo/odoo#111209
X-original-commit: 5ff011912e7dac8177d4a03ff51534e29fa4ddb4
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Have a product P configured with:
* Product Type: Storable Product
* Product category:
* costing method: standard
* Inventory Valuation Automated
* Price Difference Account: "500000 Cost of Goods Sold"
* Cost $100
Activate Multicurrency:
* USD main currency, CZK foreign currency
* On CZK set the rates
* date1, Unit per USD: 30
* date2, Unit per USD: 25 (date2 > date1)
* date3, Unit per USD: 26 (date3 > date2)
Create a purchase order:
* Date: date2
* Currency: CZK
* Order line:
* Product P
* Quantity 10
* Unit price 3000
Confirm, receive product on date2 (svl needs to be in date2)
Create the vendor bill with:
* Bill date: date 1
* Accounting date: date 3
Confirm the bill
Issue
Check the bill journal items. Price difference account is debited with 4000 czk.
This amount is not correct.
The valuation layer price unit is 100$
At the receipt date the price unit should be 2500czk
The price unit difference 3000-2500 = 500czk
Price difference 500*10 = 5000czk
The issue occur because the price difference unit is converted at bill
accounting date, resulting in 4000czk
opw-3063809
closesodoo/odoo#111199
X-original-commit: bbc0b003f6ff08a50196e07b66083ee7e8896150
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Issue:
Merchant account created inside Philippine will use PesoPay,
created inside Thailand will use SiamPay, and created inside
Indonesia will use BimoPay. Currently. only PayDollar is
available.
Cause:
Missing PesoPay, SiamPay and BimoPay.
Solution:
Add a brand setting on payment provider to allow user to select
which branch will be used.
More:
- What is PayDollar, PesoPay, etc. to AsiaPay?
PayDollar, PesoPay, SiamPay, BimoPay is the same system under AsiaPay
but is for different countries to apply.
PesoPay is for the PH market
SiamPay is for the TH market
BimoPay is for the ID market
while PayDollar is for all other market likes HK, CN, MO, TW, SG, MY,
IN, VN, NZ and AU
- Why are there multiple endpoints for a given API?
Below reasons are from AsiaPay side
Local regulators requirements for BimoPay
Branding purposes to localize for the users for PesoPay and SiamPay.
- Why didn't we integrate all these endpoints in the first version of
our AsiaPay implementation?
We got in touch with AsiaPay after our first integration. Therefore
after partnership established with AsiaPay, they provide more
integration guides on the whole development
- If many customers ask for these endpoints?
Right now, there is no customers asking for these endpoints. However
if they register AsiaPay under certain countries, they have to use
the other endpoints otherwise they will not able to use AsiaPay on Odoo at all.
task-3073748
closesodoo/odoo#110357
Related: odoo/documentation#3423
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Steps to reproduce:
- create an employee and fill in the email address;
- duplicate this employee;
- change the email address of the new employee.
Issue:
The email address is changed on both employees.
Cause:
When we duplicate an employee, we keep the same contact.
By modifying the email address, we will modify the contact's email address.
Then we "synchronise" all employees with their contact
using the contact information.
Solution:
When an employee is duplicated, a new contact must be created.
Therefore it is necessary to avoid copying the `work_contact_id` field.
opw-3144129
closesodoo/odoo#111201
X-original-commit: 1582f6834bee2123f8703b2ae52996b0978e2311
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
Before this commit, the changed test sometimes failed because the
autocomplete dropdown wasn't opened yet when we tried to click on
one of its items. Setting the autocomplete delay to 0 doesn't
remove the setTimeout, but overriding the setTimeout method from
browser like this commit does ensures the callback (i.e. the
dropdown opening) is called directly.
Fixes runbot error 15715
closesodoo/odoo#111178
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
If a field is present twice in a view, the field information
stored in the relational model `activeFields` holds and consider
only the latest xml node found.
Therefore, a field is sometimes considered alwaysInvisible
when it is visible and editable. This means that you might click
on the 'Save' button and get a server error because a required field
is not set when you should the required field should have been
highlighted and requested before making a `create` rpc request.
This commit makes sure that for the alwaysInvisible logic,
both nodes are considered.
closesodoo/odoo#110959
X-original-commit: 3d490a264b2fe837f9dc5138f8605f5466b7c312
Signed-off-by: Georis François (fge) <fge@odoo.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
When opening a work order and the quantity_producing is set at 0 by default, and since it is not possible to record 0 as done, the user always gets an error message when trying to carry on without manually editing that quantity producing field. This is not very user friendly as a manual input there on any device is burdensome.
This fix automatically sets qty_producing to be equal to qty_remaining in workorders for non-unique serial products when opening a workorder if the quantity is zero.
task 3113153
closesodoo/odoo#111156
X-original-commit: ff96659e7f8d4a239ff641d1b3541226ae3cb9e5
Related: odoo/enterprise#36369
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
Signed-off-by: Diez Stéphane (snd) <snd@odoo.com>
Before this commit, the creation date and last modification date in
the metadata dialog (in debug, in any form view, click on the debug
item, then View Metadata) were displayed in UTC, whereas they
should be formatted in the user timezone. This commit fixes the
issue.
closesodoo/odoo#111153
X-original-commit: 104e17211be9098b48eac842d65b1c378af5c05a
Signed-off-by: Michaël Mattiello <mcm@odoo.com>
This commit fixes a function call that was trying to call on `this`
while the function is imported and not assigned to the object.
closesodoo/odoo#111138
X-original-commit: b01be3ea8f77d42d5162648a078f09328491c102
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Steps to reproduce:
- install Time Off and Attendances apps;
- making sure an employee doesn't have extra hours;
- create a time off type which is "Deduct Extra Hours" (A);
- create a time off type which is not "Deduct Extra Hours" (B);
- create a time off with the type (A);
- save;
- edit the time off with the type (B);
- save.
Issue:
The time off is modified and it is possible to approve it.
Solution:
Check that the employee has enough extra hours
if the type of time off used is "Deduct Extra Hours".
opw-3141108
closesodoo/odoo#111166
X-original-commit: 2a1db0d803ea04a6d94f3d07ba3ea7ddcb24828e
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
Steps to reproduce:
- go to Time Off app.
Issue:
Dates in the dashboard do not respect the language format.
Cause:
We give a date format to the `format_date` function.
This function applies this format and not the language format.
opw-3138369
closesodoo/odoo#111130
X-original-commit: 432f146884d0a8b302b8f322f775087da027152b
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Lefebvre Thomas (thle) <thle@odoo.com>
Currently, the `Send E-waybill` button show in all company no matter what
company is installed.
So In this commit, we check whether the invoice company country code is `IN` or not,
based on that we hide/unhide the `Send E-waybill` button.
closesodoo/odoo#111017
X-original-commit: 4aadca32da4e983f707b0f9eaa812b530c971666
Signed-off-by: Josse Colpaert <jco@odoo.com>
Signed-off-by: Bhavin Patel (bat) <bat@odoo.com>
Before this commit, the dbuuid was added to the session info in order
to reset the last known notification id.
This is not necessary since #103025. Indeed, if the last notification
passed to the server is superior to the last one, the last notification
default to 0.
This commit removes this information from the session info.
closesodoo/odoo#111154
X-original-commit: 80c2d32009e07bef05cce0b53221c6a8ca024fb0
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
*: _sale, _crm
Steps to reproduce:
- install Email Marketing
- duplicate an existing demo template
- edit > drag a block from the editor onto the email
Issue:
`Traceback: Uncaught Promise > Cannot read properties of undefined
(reading 'droppable')`
This happens because the email templates are not editable, which means no dropzones can be attached to them.
Solution:
Add classes 'oe_structure' and 'o_editable' to one div in the
templates so that at least one dropzone can be created.
opw-3050732
closesodoo/odoo#111161
X-original-commit: 5f19f9c33656d8b38e827383e0dc8d65e5ebad2a
Signed-off-by: Stefan-Calin Crainiciuc (stcc) <stcc@odoo.com>
This merge is a manual FW of odoo/odoo#110728
In this merge we add tests as done in 16.1. They are updated to match some
recent changes done in the mail composer. This includes notably the usage
of 'res_ids' field, rewriting of values generation, renaming of some
fields, ... See odoo/odoo#99482 for more details.
We also provide some fixes, following the merge of this composer cleaning.
Finally it also prepares ground for the update of composer to use editable
stored fields.
Task-3149286 (Account: cleanup account.invoice.send wizard)
Task-2088884 (Mail: Use editable computed stored fields in composer)
closesodoo/odoo#110919
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Using a set for langs means ordering is not deterministic. Having deterministic
processes is better for debug and testing. Use a sorted to ensure ordering
of langs iterable.
Task-2088884 (Mail: Use editable computed stored fields in composer)
Task-3149286 (Account: cleanup account.invoice.send wizard)
X-original-commit: odoo/odoo@d903424
Part-of: odoo/odoo#110919
Purpose is to add some tests for the invoice composer, both unit tests
and performance tests. Some cleaning is coming for 16.2 better avoid
(too much) regressions.
Task-2088884 (Mail: Use editable computed stored fields in composer)
Task-3149286 (Account: cleanup account.invoice.send wizard)
X-original-commit: odoo/odoo@978d50d
Part-of: odoo/odoo#110919
Add some information and values propagation in some custom asserts in mail
test tooling.
Task-2088884 (Mail: Use editable computed stored fields in composer)
Part-of: odoo/odoo#110919
Mail composer does not support direct assignment of res_ids for rendering
using active_ids context key anymore when res_ids or res_domain are present.
With this commit we allow to force the rendering on some specific IDs in the
composer using a temporarily 'composer_force_res_ids' context key.
This will be removed once languages are better supported in the mail composer
which is the source of that small hack in the invoice composer.
Followup of odoo/odoo#99482
Task-3149286 (Account: cleanup account.invoice.send wizard
Task-3046371 (Mail: Better Language Support in Composer)
Part-of: odoo/odoo#110919
The view `hr_job_search_view` needs an xpath anchor set on the view
`view_job_filter_recruitment`. Since both views have default priority
the order they are applied depends on their ID. In a normal install
process the views are created in the right order, but there are cases
where the IDs are not on the right order.
Steps to reproduce:
1. Install hr_recruitment in 15.0
2. Remove the view pointed by view_job_filter_recruitment
3. Update to 16.0
We get an error:
```
ValueError: Element '<xpath expr="//filter[@name='my_favorite_jobs']">' cannot be located in parent view
```
closesodoo/odoo#111140
X-original-commit: 1e77fabfa087fbeedab974645646bc1761c07468
Signed-off-by: Christophe Simonis <chs@odoo.com>
Signed-off-by: Alvaro Fuentes Suarez (afu) <afu@odoo.com>
The logic of following acc_pay code if there was a tx and following
account code if there was no tx was no wrong but was simplified too much,
losing 'Reversed' and 'Cancelled' state if there was any tx linked to
the invoice.
closesodoo/odoo#111139
X-original-commit: 8ae3413e42e2591934593d61a899df88fadbba45
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Some amounts were wrong because quotations were included, even though
they do not make revenue.
opw 3121450
task 3130829
X-original-commit: 0fa2510c34a41e9e91131909a0b24af25aa770fc
Part-of: odoo/odoo#111137
Before this commit, a traceback would be thrown when no options were
passed to `_getEditorOptions` because of a code mistake using the
variable `options` rather than `finalOptions`.
Also, this error revealed that the `this.options` of the wysiwyg could
be wrongly reset if no argument `options` was passed to `resetEditor`.
task-3149085
closesodoo/odoo#111100
X-original-commit: 475775d3dfc230c06c7a2b127b67bc22543e8a27
Signed-off-by: Antoine Guenet (age) <age@odoo.com>
Don't limit on the first directory found in the upgrade-path.
It follow the same behavior regarding scripts found in the `maintenance`
directory and the ones in the local `upgrades` directory of modules.
opw-2868713
closesodoo/odoo#111087
X-original-commit: d2e6c9d5010ab8092eff37775e92b486f89d28fc
Signed-off-by: Christophe Simonis <chs@odoo.com>
before this commit, in sale order form view, while clearing the quotation date it was showing Traceback error. field is already required in the model level, so removing the conditional required attribute from the view
after this commit, the quotation date is required
closesodoo/odoo#111066
X-original-commit: f8db67897c1b533a591eaf48ae18b625b1dd4d33
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This PR addresses a bug introduced in odoo/odoo/pull/109776
The user can indeed modify the timer, but because a started timer is a readonly field,
the timer does not update.
Using isDirty allows to check if the user really modified the timer.
closesodoo/odoo#111064
X-original-commit: 9aa8752da18ed679d7ddae93682c045204083104
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
To reproduce the issue:
- Website page (e.g. "Contact us") > Edit mode > save.
- Try to click on the page right after the save (and before the preview
is blocked) > traceback.
In this specific case, clicking in the page will activate the targeted
snippet and initializes its "SnippetEditor" while destroying the
options and cleaning the DOM, leading to wrong behaviors.
The goal of this commit is to fix this issue by simply ignoring the
click on the page during the save process.
opw-3119347
closesodoo/odoo#111030
X-original-commit: 6bf3823c2996af4ec0534ff69471887ac43a8ddf
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, if if the discount policy of the pricelist is set
to "show public price & discount to the customer" and then the unit
price of a product is changed frompoint of sale, a note is added to
the invoice, that shows a "price discount".
This also happens in case of a price increase, which should not happen.
opw-3121143
closesodoo/odoo#110969
X-original-commit: b7b642cf797090c68f659a23a5e11e4fc47ecc43
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Khanalizadeh Ahmad (khah) <khah@odoo.com>
Steps to reproduce:
- Go to base Runbot and install Time Off.
- Go to Time Off > List View and select a list view item (checkbox).
- Go to Action and notice there is no Archive option.
- Go to the form view and go to Action > Archive.
- See error about not being able to archive leaves.
Issue:
We can see the action archive but we can not run it
Expected behaviour:
We shouldn't be able to see that action archive
Cause:
When computing the value of archiveEnabled we use the wrong variable "activeFields".
Solution:
Give the good one, "this.props.fields"
opw-3079475
closesodoo/odoo#110836
X-original-commit: 122fa724e1f15e8c28a29bbe8a80c089ff954956
Signed-off-by: Bruno Boi (boi) <boi@odoo.com>
Purpose:
========
The "Activities" button in the reporting section in the dropdown menu
of teams kanban cards is the only button that has a different layout than
the other buttons in this dropdown, and this layout makes the button
difficult to read when the dark mode is activated.
This commit makes the button have the same look as the other ones, by
removing an unnecessary div wrapping this button, and removing the custom
style attribute.
Task-3137791
closesodoo/odoo#110736
Related: odoo/enterprise#35962
Signed-off-by: Stéphane Debauche (std) <std@odoo.com>
Add hooks before rendering the `website_sale.cart` and
`website_sale.extra_info` templates. This allows to pass flags to
trigger style variation in the checkout wizard (add an extra step). In
addition, add the country_code to the sale_order view form, since it
will be needed everytime we add l10n_* fields in this view (with attrs
based on `country_code`).
Related: https://github.com/odoo/enterprise/pull/35050/commits/fce5e682946cfa7d9e19c0c3c6abfab3dcbcc54a.
task-3089169
closesodoo/odoo#108181
Related: odoo/enterprise#35050
Signed-off-by: Laurent Smet <las@odoo.com>
Previously, the columns of the checkout wizard were hardcoded (3 columns
or 4 if the extra step is enabled). Using a bootstrap grid allows us to
support any number of steps. This is convenient, for instance, when we
need to specify some country specific fields in an additional
information tab.
related to task-3089169
Part-of: odoo/odoo#108181