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
If user would add addictional field in one of reports it could break other
reports as other models do not share all the same fields. Now modules inherit
template and create their version of field.
task-2858097
closesodoo/odoo#106140
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Payment methods without image or without name does not make any sense.
Previously created payment methods without a name will be
given default name and ones without an image will be deleted.
Payment icon can no longer be created or edited from payment
provider form view.
task-2853424
closesodoo/odoo#105909
Related: odoo/upgrade#4043
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
This commit split the function confirming SO in populate with
the purpose of adding populate method for subscription SO,
recurrent product, recurrence and pricing in odoo/enterprise#33305closesodoo/odoo#104269
Signed-off-by: Arnaud Joset <arj@odoo.com>
UI improvements for the form of product.product model.
task-3043184
closesodoo/odoo#111052
X-original-commit: d8bc64e6cf04291370e577abe8c58303ae4a9741
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Older tooling used prettier config files. The issue was that the
disable command of the tooling was also changed to not remove those
files as they shouldn't exist anymore.
But changing from 16 to master without manually triggering a tooling
"disable" would then left the prettier config and mess with the addons
eslint whitelist.
closesodoo/odoo#110582
Signed-off-by: Samuel Degueldre <sad@odoo.com>
This commit brings a new way to detect sql injection.
Previously, this test was meant to push developers to use the second argument of cr.execute(query,args) for parameters.
However, this also meant that the test will always be green as soon as the second argument is used.
This commit aims to change that by tracking the source of information of all variables used to build a query. Parsing of the AST in reverse, starting from the query variable itself.
However these are some current limitations:
-The hierarchy of Odoo modules is currently not taken into account. If two functions have the same name, they will both be evaluated to find if their return value is part of the query
-Object mutation is not supported and is not evaluated
-Whitelisted values are too wide in order to reduce the amount of false positives.
Even if this test is blocking, it can be disabled by adding #pylint: disable=sql-injection at the end of the line.
closesodoo/odoo#101237
Related: odoo/enterprise#35697
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Co-authored-by: xmo-odoo <xmo@odoo.com>
Use case:
- Create a user default value to set the warehouse as empty
- Create a SO
The SO warehouse is filled. It happens because there is an
extra check to add the warehouse based on the user preference
or first company's warehouse.
However the user default could be use to prevent that behavior
and force the user to choose a warehouse (15.0 behavior)
This commit always respect the user default if it's set.
Also remove a strange condition that could set warehouse of
wrong company
closesodoo/odoo#111033
X-original-commit: 3afb0bae0b48dc152908a2a39b0de7e2f966b54c
Signed-off-by: Adrien Widart <awt@odoo.com>
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
When activating the option "Restrict Template Rendering" the employee
group no longer gets the group automatically via the Implied Groups
field. However this did not have much effect because
- all the existing employees still had the group
- new users had the group via the template user
Remove the group with active_test=False to include the Default
Template User in the list.
Before this commit it was a bit confusing that new users still got the
group by default, even after deactivating the option in the settings.
closesodoo/odoo#110900
X-original-commit: ea0f674ac15964aaeb3def31758cec558b354a99
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Current behavior:
When you imported a sales order with a kit in the PoS, the kit quantity
was not correctly computed.
Steps to reproduce:
- Create a product kit with atleast 1 component with a different UoM
than the kit
- Update the quantities on hand of the component
- Create a sales order with the kit
- Import the sales order in the PoS
- You will have a traceback
Note : There is no traceback if both components and kit uses same UoM,
but the quantity of component was not correctly computed.
opw-2983703
closesodoo/odoo#110714
X-original-commit: 3000515a1c96c203e644e3d2cf783fe9efd0e45e
Signed-off-by: Trinh Jacky (trj) <trj@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
Steps to reproduce:
- Increase decimal accuracy of product price (eg: to 4)
- Create a product with fifo automated valuation and price of 280.8475
- Confirm a sale order of that product and Confirm stock picking
- Create a return on the stock picking
Bug:
rounding error on the stock valuation
Fix:
do not round unit price on currency rounding
opw-2988071
closesodoo/odoo#110112
Signed-off-by: William Henrotin (whe) <whe@odoo.com>
- Automatically compute the average number of hours per day on
resource.calendar;
- Don't allow to change the working hours of an employee when they have
a current running contract;
- Seperate smart buttons on resources to distinguish Material / Human.
task-3102517
closesodoo/odoo#109768
Related: odoo/enterprise#35718
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit avoids potential concurrent updates if you create 2 users
simultaneously.
The method is called by an override of the method create from res.users.
In production, we have concurrent update because it writes to the group
no matter if someone is to remove or not. And orm will do a query in all
cases to update the write_date, ...
Now we only execute a query if somebody need to be removed.
closesodoo/odoo#111031
X-original-commit: 5a0cf8bc8a9747e18eca5ddd3f135eb0cfcfd13d
Signed-off-by: Kevin Baptiste <kba@odoo.com>
The tax totals computation requires a currency to be provided. When a user removes the currency deliberately and tries to add a line, an uncaught error is thrown.
The currency_id is required, and the user will not be able to save the move anyway.
To reproduce:
New Invoice or Purchase
Clear the currency field
Add a line
Stack Trace
After this PR:
tax totals are computed based on the journal currency or company currency when not available
No task, discovered thanks to #110920closesodoo/odoo#111021
X-original-commit: f74f9bc04ed8f18746eb509f3c8dc598b1618230
Signed-off-by: William André (wan) <wan@odoo.com>
Currently the Spanish address format does not include the province/state.
This change adds the province between parentheses after the zip code and city.
task-3147965
closesodoo/odoo#111012
X-original-commit: 2c31ad84137b3a764116bea6a6d765a2c7d03eb7
Signed-off-by: Nicolas Viseur (vin) <vin@odoo.com>
Signed-off-by: Dylan Kiss (dyki) <dyki@odoo.com>
Since [this commit], a tooltip is displayed on the blocks that can be
dropped in a page so that the user understands that he must not just
click on it but drag and drop the block. Unfortunately, these tooltips
were not well positioned in the email marketing application because the
editor is in an iframe in this application. This commit allows to
position correctly these tooltips.
Steps to reproduce the bug fixed by this commit:
- Go to the email marketing application
- Create a new mail
- Select a template other than "plain text".
- Triple click on a block
=> The tootlip is displayed way too high.
[this commit]: https://github.com/odoo/odoo/commit/a50c09e3b432d7601cd0e02cbbfabe24a67ba70f
task-2777738
closesodoo/odoo#111011
X-original-commit: 42d32a4f40d685e10f2ae4bb678df2009cb4bd21
Signed-off-by: Romain Derie (rde) <rde@odoo.com>