Fix some activity tests: use real test models, try to avoid date issues
by using freezegun.
Followup of odoo/odoo@a26e6e954c and odoo/odoo@06dee038dd .
Task-2654840
closesodoo/odoo#77120
X-original-commit: 2387c2ee6272a7c260386427c108208e747b819b
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This matches the behavior of GDocs and CKEditor.
closesodoo/odoo#77115
X-original-commit: a84a6c869b815bf372d81db538b458cd23c99b07
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
If you unplug the iot box and wait 15 seconds or so, and then plug it
back in, it's possible to get an exception from helpers.get_ip, because
neither the wired nor the wireless interface has an IP. In that case,
the exception would kill the Manager thread, since it was uncaught.
This fix adds a catch-all to the Manager thread that logs any uncaught
exceptions and continues its main loop.
closesodoo/odoo#77111
X-original-commit: a9808a4efe46c4ba7948f5d6a8757546c6b4147b
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Signed-off-by: Raf Geens <raf-odoo@users.noreply.github.com>
The combination of a RR and a supplier that has a minimum quantity and a
lead time leads to incorrect results
To reproduce the issue:
1. Create a product P:
- Type: Storable
2. Add a reordering rule for P (min: 10, max: 50)
3. Add a vendor to P
- Quantity: 1
- Price: 1
- Delivery Lead Time: 7
4. Run the scheduler
5. Open the generated PO
Error: The order deadline is <today minus 7 days> instead of today. The
receipt date is today instead of <today plus 7 days>
When computing the quantity to order, the method needs the value of
`qty_forecast` (L254 in [1]) The computation of `qty_forecast` leads to
the computation of `lead_days_date`. To do so, it gets the lead days of
the associated stock rule `_get_lead_days`. In this method, a seller is
selected: [2] However, none of the parameter is defined: [3]
In the above case, the seller has a minimum quantity of 1. Therefore,
since this information is not given in [2], the vendor is not selected
and his lead time is therefore not taken into account. So,
`lead_days_date` will be equal to 0 and won't be recomputed. As a
result, the planned delivery date is today. Then, the quantity to order
is computed (L260 in [1]), so later, the module is able to select the
correct seller. However, this one has a lead time of 7 days -> the
generated PO will have the planned date to today and the order deadline
to <today minus 7 days>
Once an orderpoint has its quantity to order defined, its lead time
should be recomputed because it may be different depending to the
selected seller (and thus we should take this quantity into account when
searching for a seller)
[1]
https://github.com/odoo/odoo/blob/59ac8d891de6e20604494d6cfc6fc357a88d226c/addons/stock/models/stock_orderpoint.py#L254-L260
[2]
https://github.com/odoo/odoo/blob/1b03087524080f1a9751b1561cd8891466e72367/addons/purchase_stock/models/stock_rule.py#L153
[3]
https://github.com/odoo/odoo/blob/045c6ad3353bb0849d3f93d3488d8dcd8b8975b0/addons/product/models/product.py#L602
OPW-2614798
closesodoo/odoo#77110
X-original-commit: f2eb1dca99d16d70613c2f724d4b73f273a49ae7
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
t-field of a Text field, will use nl2br function that replace \n to <br>.
So it is html that we need to parse.
Add one return line in your sale description, and the rendering will fail
with an error opening and ending missmatch for br...
closesodoo/odoo#77108
X-original-commit: 3b3f9b24362e57b4c1538d8377ef4de5f3d65058
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
`fields.Date.today` doesn't give date based on TZ which might be wrong
in some cases as it doesn't respect TZ.
With this commit, we are using `fields.Date.context_today` as default date.
closesodoo/odoo#77104
X-original-commit: 24b91073a67b97af1ef3d61aee02a4ddd7053cd5
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
- add outer shadow to bill in wizard preview
- move address block to right in generated pdf, same as in wizard preview
- set invoice date & due date on one line in pdf, same as in wizard preview
closesodoo/odoo#77093
Task: 2581377
X-original-commit: ecf2bba66782cd8b2455bf656cdf2a41fafecf89
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Signed-off-by: jbw-odoo <jbw-odoo@users.noreply.github.com>
Currently when move the task from one project(A) to another project(B)
and open the burndown chart of second project(B) it shows the stages
of first project(A). which is wrong.
so in this commit, include the tracking values of the current project
only, do not include the tracking value of the older projects.
Task-2616736
closesodoo/odoo#76964
X-original-commit: 9a6624f5f743677a233489932840e3a739330452
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
We don't have any option to see to see all the events currently. However
this option can be useful sometimes. For example you are looking for an
event but don't know whether it's already finished or upcoming. Or if you
are looking if some event "types" are available (e.g.: Do they sometimes
organize Tennis competitions ?).
In this commit a new filter is added in the last 'All events' which allows
users to see all the events.
Task-2581308
Part-of: odoo/odoo#75066
Before this commit, the useTooltip hooks didn't call clearInterval
when the component using it was unmounted/destroyed. In practice,
it wasn't an issue because the only component using it was the
webclient, and it is never destroyed. However, for this hook to be
usable in other contexts, it is important to remove this leak.
closesodoo/odoo#77113
X-original-commit: d076afd035ad8fadc5a0774c6c0eec15acb15026
Related: odoo/enterprise#21147
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Allowing to specify components inside tooltips to obtain dynamic
and/or html content was a bit overkill and unnecessary: a template
can do the trick and it is easier to define.
This commit thus renames attribute "data-tooltip-component" into
"data-tooltip-template" (the name of the qweb template) and
introduces the "data-tooltip-info" attribute (its value is then
available in the template under the "info" variable).
X-original-commit: 8683a8d762339451e3d9f8706aac86da80510b37
Part-of: odoo/odoo#77113
Since the merge of 0573aca the override was no longer working.
closesodoo/odoo#77097
Taskid: 2651838
X-original-commit: 947194644a09f186899f2b2526cf0b0675af7304
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Don't set 'repeat-y' to false explicitely as it is the default value.
X-original-commit: 26612818d71f072eaf291df6d4ee839301f36dc7
Part-of: odoo/odoo#77119
In [1], we rewrote the effect feature in the wowl infrastructure.
However, we lost something in the process: the "type" of effect
(basically "rainbow_man" as it is the only implemented effect)
became a mandatory param, whereas before it simply defaulted to
"rainbow_man" when not set. As a consequence, previously defined
effects in views could crash.
This commit fixes that issue, and reworks a bit the feature by
introducing a registry of effects, which easily allows to add new
effects from the outside. An effect is a function that may return
a Component (and its props) to display.
Most of the diff in the tests is about moving files where they
should be (the effect feature being in core/, the tests must be
in core/ as well, and not depend on the webclient).
[1] 0573acae23
Task 2652927
closesodoo/odoo#77109
X-original-commit: 74dc3f654ee5849982b494e46eefb1fc2b4e0c74
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Fixes a traceback when generating work entries.
How to reproduce:
- Create a contract with a working schedule with 0 attendances
- Set the contract as running
- Make sure you have another contract for another employee running on
the same period, this one must have attendances
- Go to the work entries views, this should generate working entries for
the viewable dates
- If the work entries were already generated, go to a month where they
are not generated yet, you should have the traceback
Task ID: 2654797
closesodoo/odoo#77085
X-original-commit: 13f7f8c4e066b0a2fadef95cdff4a24a4f67f95c
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <Williambraecky@users.noreply.github.com>
There was 3 keys for the same icon 😠 while one of them is usually used
in normal text. For example:
- Item 1:
- Item 2:
- Item 3:
The last one would convert to `- Item 😠`
This PR removes one of the above to keep the other two
closesodoo/odoo#77075
X-original-commit: 45e9636c2e0457d3bc4ea1d346ff71ed6824bbe1
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Right now, when we only have the website_event installed and ther are no
other regular(view based) customize menus available, we won't have a
divider div tag. And the current code tries to push our menu after
the first divider and thus fails due to no divider available.
With this commit, we simply check that if there's no existing divider
div, we simply add one and then push the menu after divider.
Task-2616588
closesodoo/odoo#77083
X-original-commit: 11a54d5fed9e21469363dabc4e973662418b9920
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The check added in 643e093a4bc9d46973705831697036b56a89b143 was too
strict in case a purchase order was created from an orderpoint
triggering multiple rules. The orderpoint's location could be below
another warehouse that the first rule's location and thus raising the
error.
closesodoo/odoo#77079
X-original-commit: df1f90673fc06f3d535833229d8af3ef6a51dd61
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
get_ip and get_mac_address respectively try to get the IP and MAC from
the IoT box's active network interface. If the interface isn't fully up
yet (due to waiting on a slow DHCP server response for example), both
functions can end up raising a KeyError exception since neither
interface has a value.
This can be bad if it's uncaught and happens in something like the
Manager thread, potentially killing it as a result. This can then
disrupt the rest of the application. The network being gone for a bit or
slow is something that can happen during everyday use, so we should be
robust against it.
Since the box can't do any useful work without an active network
connection, this fix keeps retrying until one of the interfaces comes
back up.
opw-2357144
closesodoo/odoo#77052
X-original-commit: d0359858b17fb84c04c267bdf5cc1626569f5cce
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
Added Vat 0, vat self invoice and vat import line which needed in the israely market. Then, we have added the related fiscal positions.
In addition, we have modified the chart of accounts with the up to date accounts and orgenized them with the correct account groups.
closesodoo/odoo#77000
X-original-commit: 8b38350cea310930de226a879fdc1fd93de01adf
Signed-off-by: Josse Colpaert <jco@openerp.com>
current_date was absent from py_builtin. For that reason, it was
impossible for the search model to evaluate a dynamic domains like
"[('date_deadline', '<', current_date)]"
We add current_date to py_builtin.
closesodoo/odoo#77035
X-original-commit: ade082c5ad9221c82de90ddbe68b814b1487753d
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
The class PyDateTime did not have a method to_utc. For that reason, it was
impossible for the search model to evaluate a dynamic domains like
"[('date', '>=', (datetime.datetime.combine(context_today(), datetime.time(0,0,0)).to_utc()))]"
We implement that method.
X-original-commit: 3ad9a3be64da78d596ee3dc435d4b224728a9e76
Part-of: odoo/odoo#77035
In order to be able to easily patch Date in py_date_tests and elsewhere,
we refactor the code of the legacy and new patchDate functions.
X-original-commit: 0e697c82be80cae9cc993b4be179fec42b8dae83
Part-of: odoo/odoo#77035
This commit removes the action_confirm from the run_manufacture to do it
only after all the orderpoints have been processed.
In case a production, created in run_manufacture, triggers procurements
for one of its component. And those procurements have the same
parameters than another one still not run because after the manufacture
one in the queue. This new procurement will replenish its quantity plus
the other procurement's one.
That means too much quantity will be replenished.
closesodoo/odoo#77026
X-original-commit: a7bb9f1ac392c00be5bdd133fc5c73b9803c8b4b
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
The amount on generated COGS lines can have the UoM factor applied two times. For example, if we have a product costing 1$ per item and we sell it by pack of 12 ("Pack" UoM) we will have 1$*12*12=144$ instead of 1$*12=12$
0/ Go to a V14 runbot
1/ Create a company which use COGS (eg. Mexican accounting)
2/ Have a storable product priced at 1.5$ from a product category with Costing Method as "First In First Out (FIFO)" and Inventory Valuation as "Automated"
3/ Create a UoM 12 times bigger than the default Unit (eg. 12 Pack)
4/ Create a purchase order costing 50$ for 50 Unit of the product => cost of the product should be 1$
5/ Create a new purchase order for 50 Unit but costing 0$ (like if got free products from supplier)
6/ Create sale order for 50 units of the product, validate the transfert and create/confirm the invoice => computed COGS amount is 50$ on the invoice => ok
7/ Create a sale order using the "12 Pack" UoM, validate transfert and create/confirm invoice => computed COGS is 144$ => nok
opw-2503368
closesodoo/odoo#77007
X-original-commit: d0d9c0a8f8e35fbd9624d934a8ca6152677fbd3e
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
Ask for camera/microphone access when landing on the WelcomeView of a
channel created via the "Start a meeting" feature.
Part of task 2651831.
closesodoo/odoo#77011
X-original-commit: ef92577ae2ef602c279b47c5c0b1235334d5984c
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
This commit allows anyone to create a new mail.channel by visiting the
URL /chat/<token>[/<channel_name>], providing that the
mail.chat_from_token system parameter is set. This is useful in some
situations where new channels need to be created quickly as needed by
anyone without special permissions (eg, during the Odoo experience)
task-2648580
closesodoo/odoo#77010
X-original-commit: 56ddc073213a148579dd72f4a9336bc4d6a11f22
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
Before this commit, the "purple" main menu navbar disappeared before
the editor was loaded (after clicking on the "Edit" button).
task-2652381
closesodoo/odoo#76920
X-original-commit: 63aebbfb0749c59bd336e3431aed12a902d3bf13
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Before this commit, when a "100% height" snippet was set in a popup
snippet, it was still computed to take full-screen height minus the size
of the navbar.
Now, it will properly be full-height.
closesodoo/odoo#76913
X-original-commit: 008d776e2f35916c00e0c80daa51a0526de44a21
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Reproduce :
CRM.
Go to a task and schedule next activity.
Then mark this activity as done.
Write a feedback.
Result :
Server error traceback
Solution :
The written feedback is given as a kwarg to translate.
opw-2641747
closesodoo/odoo#76985
X-original-commit: 222bda82e034869590530fc634428dca596be198
Signed-off-by: Arnaud Joset <arj-odoo@users.noreply.github.com>
Signed-off-by: Audric Onockx <auon-odoo@users.noreply.github.com>
We were trying to sort a list of date with potentially falsy elements in
the list, causing a crash while trying to compare a date object with a
bool. This commit just makes the check that all dates are not falsy
before attempting to sort.
closesodoo/odoo#77012
X-original-commit: 6bd2a86e37809b4d77aad4597e926e99f9d2b2ce
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Samuel Degueldre <sdegueldre@users.noreply.github.com>
Before this commit, the translation alert might briefly appear in
form views displayed in dialogs (on new records), just before the
dialog closes.
Task 2639227
closesodoo/odoo#77002
X-original-commit: c9aa20160cd8b1bc9c9bdcd34bb996b8dfefc291
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This commit replaces the control panel dropdowns with the new <Dropdown/> component, in order to get consistent through the new/legacy views (because the current Odoo version is in a state where some views uses the new infrastructure and some others are still not converted - see odoo/odoo#73311).
The diff seems massive, but it is mostly due to tests adaptations.
closesodoo/odoo#77001
X-original-commit: d679cd0d8ba9a2420e81a42a698763e9be2327e1
Related: odoo/enterprise#21077
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Co-authored-by: Aaron Bohy <aab@odoo.com>
Co-authored-by: Mathieu Duckerts-Antoine <dam@odoo.com>