100 Commits
Author SHA1 Message Date
William BraeckmanandBertrand Dossogne b23fea1b96 [ADD] l10n_fr_hr_holidays: add french time off for part timers
Adds 2 new modules:
l10n_fr_hr_holidays
l10n_fr_hr_work_entry_holidays

This commit adds modules allowing to compute accurately
the number of days off taken by a french part-timer.

Both modules will automatically install when hr_holidays is installed and
at least one of the companies is located in France

In France, when taking a time off using a different calendar from the
company's calendar you have to count the days as if you were taking time
off in the company calendar.

For example let's say you have an employee working only monday through
wednesday, if that employee were to take a time off ending with
wednesday afternoon, the time off would count up until friday (if the
company calendar if monday->friday), so that a whole week is always 5
days regardless of the employee calendar.

This is also the case for 'holes' in the employee calendar, for example
a calendar where one would work monday, wednesday and friday only.

l10n_fr_work_entry_holidays:
By default time off only generate work entries for intersections between
time off and attendance period, so that when taking a time off for a
whole month you wouldn't get work entries on the weekend if you normally
don't work that day.

But since l10n_fr_hr_holidays computes the number of days it would
normally cost with french rules. We also have to make sure that the work
entries are generated appropriately. Essentially this modules adds the
logic required to fill the holes needed using the company calendar
instead of the employee one.

OTHER:
Fixes a redundant call to super function in hr.leave._get_number_of_days,
improving its performance a bit

task-2602897

closes odoo/odoo#82637

Related: odoo/enterprise#25805
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Co-authored-by: Bertrand Dossogne <bedo@odoo.com>
2023-04-27 16:10:19 +02:00
William Braeckman 43ba296046 [FIX] calendar: fix invalid function call
This commit fixes a function call that was trying to call on `this`
while the function is imported and not assigned to the object.

closes odoo/odoo#111138

X-original-commit: b01be3ea8f77d42d5162648a078f09328491c102
Signed-off-by: Arnaud Joset <arj@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2023-01-27 09:18:01 +01:00
William Braeckman 46835d5a85 [FIX] hr_holidays: fix limit on accrual plans using hours
Prior to this commit the limit set on accrual plans was in hours but
effectively used as a limit in days in the code.
Meaning that a level with a limit of 240 hours effectively applied a
limit of 240 days (or 1920 hours with 8 hour days).

TaskId-3145560

closes odoo/odoo#110835

X-original-commit: c9df4a33fcfe2dbcbac35923d0bceb3757516fb1
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2023-01-24 16:18:20 +01:00
William Braeckman a35dd0d43f [FIX] sale_loyalty: reset taxes on payment program lines
Since we reuse sale order lines as much as possible, having reward lines
with no tax means that we need to explicitely reset the taxes on those
lines. However this was not done before.

TaskId-3138483

closes odoo/odoo#110785

X-original-commit: e945526f3a69d0adaa283c9a5aa4f5dde6027e4e
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2023-01-24 09:12:01 +01:00
William Braeckman d941333582 [FIX] sale_loyalty: fix mixing payment rewards and discounts
Fix two issues:
 - Payment rewards have to be applied after any other reward, the logic
   to do so was already implemented but the condition got inverted
   somehow.
 - Allow discounts to be applied on orders if the total is zero in case
   a payment reward is being used.

TaskId-3138483

X-original-commit: 7104527ffc5606c054e2b8d596b869cd4ccfce64
Part-of: odoo/odoo#110785
2023-01-24 09:12:01 +01:00
William Braeckman ae497d22e5 [FIX] website_sale{,_stock}: fix issue with tests
Multiple tests introduced in 16.0 created a product template and then a
default product for that template, however a default product is already
created by default in the product module when creating a template and it
somecases triggered an unicity constraint.

closes odoo/odoo#108523

X-original-commit: 3c9ff6e148cd0ee77442dd31079f0fec9c456b4c
Related: odoo/enterprise#35180
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-12-22 13:47:58 +01:00
William Braeckman fedede859e [FIX] website_sale: fix traceback with express checkout
It can happen that the payment transaction route is called without the
amount kwargs, the code would crash in that case as we tried to access
it either way.
We moved the code after setting the default amount in the kwargs to
avoid a crash.

closes odoo/odoo#105576

X-original-commit: c124fb3292439a6237f16eff406c0a7d375cab65
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-11-10 23:17:16 +01:00
William Braeckman a901105299 [FIX] website_sale: fix traceback when unselecting attribute
This commit fixes a traceback when changing the attributes when the
current page has no products to display

TaskId-3045085

closes odoo/odoo#105515

X-original-commit: b8a1b1143eec4a85b9dc8b2c6fbb0112f6b813d7
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-11-09 22:12:48 +01:00
William Braeckman 48b476f337 [FIX] website_sale: fix base_unit_price and pricelists
Prior to this commit the base_unit_price was computed using the price of
the template instead of the list price displayed on the eCommerce, so it
sometimes made no sense when compared to another currency.
It will now be converted properly and use the list_price instead of
template price to compute the base_unit_price.
Some other issues with the base_unit_price display in the form view have
also been fixed (mainly mobile stuff)

TaskId-3006015

closes odoo/odoo#102884

X-original-commit: 7701033a4d480881d9e1d2c3c842150ca8f55aec
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-10 17:11:33 +02:00
William Braeckman 461aeca9bb [FIX] website_sale: reorganize menus
TaskId-3010484

closes odoo/odoo#102610

X-original-commit: 603ac8b7ea1cadfce44317baca61f4866833ec97
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-07 14:37:33 +02:00
William Braeckman 09c53d8eee [FIX] website_sale: fix offcanvas bubble
The bubble is showed whenever a filter is activated and/or a price range
is selected in the filters.
However due to float precision the comparison made to check whether
there is a price filter could be wrong when using "weird" numbers.

TaskId-3009210

closes odoo/odoo#102507

X-original-commit: 9359a5b5f0f72550d69671f975da23d4734b490f
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-06 22:22:39 +02:00
William Braeckman b42c621438 [IMP] website_sale: add possibility to switch pricelist on mobile
This commit makes it possible again to change pricelist while on mobile
view.

TaskId-3009210

X-original-commit: d3f6dc8d269f82860d8e93482e03462ef66fa37f
Part-of: odoo/odoo#102507
2022-10-06 22:22:38 +02:00
William Braeckman 5a633d0061 [FIX] website_sale: fix clicking on radio button not applying
In the new aside to control filters and attributes (mobile mainly)
clicking on the radio input directly would not refresh the page
accordingly.

TaskId-3009210

X-original-commit: 989c827be5de366e37d92d6a35bcd0e0995db78d
Part-of: odoo/odoo#102507
2022-10-06 22:22:38 +02:00
William Braeckman 6390dbb45c [FIX] website_sale: fix icon alignment
Fixes an alignment issue between the grid and list icon on the /shop
page.

TaskId-3009210

X-original-commit: 2ea3a5609d5d955ad75baa4bf5c31f8aefb55554
Part-of: odoo/odoo#102507
2022-10-06 22:22:38 +02:00
William Braeckman eec2f1eea4 [FIX] website_sale: reintroduce pricelist selector on product pages
There was a missing class on the pricelist selector for product pages
leading to the pricelist selector simply not being displayed.

TaskId-3007737

closes odoo/odoo#102425

X-original-commit: 522cb8116d959dbc17717e149b76490b0ec2fd63
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-06 19:03:55 +02:00
William Braeckman b6221c87d7 [FIX] loyalty: fix test day bugs
- Make content helper more generic for programs
- Add search fields for loyalty.card
- Fix creation emails for gift cards in pos not being sent properly
- Fix validity date check on loyalty rules being inverted.

TaskId-3002190

closes odoo/odoo#102160

X-original-commit: f893fda1a40127b7510e861c96f4d4cf9d10f79d
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-05 14:25:46 +02:00
William Braeckman ee9a282c19 [FIX] web: fix file upload service event listeners
The event listeners were added to the upload object instead of the xhr
object making them being called before they were supposed to.

closes odoo/odoo#102061

X-original-commit: 804467d7b0a583ab36a47212d482b41d29ca2203
Related: odoo/enterprise#32247
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-04 17:01:29 +02:00
William Braeckman cd14193919 [FIX] loyalty: make it possible to import coupons etc
TaskId-2991207

closes odoo/odoo#102062

X-original-commit: d4a92b112d0554a2624f7768feb7d54e0484469f
Related: odoo/enterprise#32249
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-04 16:01:13 +02:00
William Braeckman 7f80831ae2 [FIX] website_sale: fix traceback on login page
auth="none" pages don't have self.env.user filled in, this throws a
traceback if you try to get the current cart.
This causes an issue when we try to fetch the cart quantity on the login
page.

closes odoo/odoo#102010

X-original-commit: d1c053158f1d306df1f5f1e9d4c81ee642a73f48
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-04 10:55:45 +02:00
William Braeckman fb6e9a9ec0 [FIX] website_sale: fix crash when using unsplash in extra images
The way we request images for the product's extra images feature did not
work properly with the patch made by `web_unsplash` since we did not
call the super function.
It is now called properly making it work with unsplash as expected.

TaskId-3003948

closes odoo/odoo#101928

X-original-commit: da23f3ad52179c145cbf9a19db20ed6a46193f0d
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-10-03 15:19:29 +02:00
William Braeckman bca87fd5ab [IMP] hr_fleet: migrate hr_fleet_kanban to wowl2
closes odoo/odoo#101681

X-original-commit: 443123b64e2984026541c44c524f20c7f08eda0b
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-30 09:32:23 +02:00
William Braeckman 6095eff9e2 [IMP] project: migrate project_calendar to wowl2
closes odoo/odoo#101603

X-original-commit: fb7c615fcec3743f31d34ebb79664f8a8eb5a50f
Related: odoo/enterprise#32012
Signed-off-by: Xavier <xbo@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-29 15:27:06 +02:00
William Braeckman 286eee3320 [FIX] web: prevent selecting an invalid scale in calendar
By pressing the date in the calendar's date picker, a function computes
a new scale to be used depending on the previous focused date and scale,
for example clicking on the focused date in month scale will switch to
week and so on.
However it bypasses the scales that are available on the calendar's
definition.
It is now prevented.

X-original-commit: a9059b0bee02f635d563b45ee94f04bab5532fe4
Part-of: odoo/odoo#101603
2022-09-29 15:27:05 +02:00
William Braeckman 6a42ec7c73 [IMP] calendar: migrate attendee_calendar to wowl2
Migrates the attendee_calendar view aswell as the modules patching it.
The code has been simplified as much as possible to reduce complexity
while still retaining a similar flow.

TaskId-2999194

closes odoo/odoo#101492

X-original-commit: ee14c3ec4830454d80a63793a91f6d1c838363f1
Related: odoo/enterprise#31963
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-28 20:29:51 +02:00
William Braeckman 99adf83e38 [IMP] web: expose sub template of calendar components
Make it easier to override component's sub templates by making them
overridable on the component.

TaskId-2999194

X-original-commit: 4f4e91ebb14d563dd3ec6d305b9984db25e06cbf
Part-of: odoo/odoo#101492
2022-09-28 20:29:50 +02:00
William Braeckman 6a0efdb7c4 [IMP] web: expose before and after execute action on controllers
Make it possible to override both before and after execute actions on
all view controllers using `useViewButtons`.
This avoids having to change a value in the env to override the function
being called when clicking on a button.

closes odoo/odoo#101310

X-original-commit: 9f6c2b8e969635f35786d58ee89ca767ff57144d
Related: odoo/enterprise#31860
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-27 18:14:49 +02:00
William Braeckman dc930e8e2a [IMP] web: add afterExecuteAction to view_button_hook
The function will be called after the action has been executed.

X-original-commit: 1e4c6e457a9c42da76c647ca0972b06e6d838349
Part-of: odoo/odoo#101310
2022-09-27 18:14:49 +02:00
William Braeckman 322a2135c6 [FIX] hr,mail: reintroduce legacy x2m_avatar widgets
Some views still use them.

closes odoo/odoo#101081

X-original-commit: adb5508afd2749dbbfeb85803d707df43358b011
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-26 10:37:00 +02:00
William Braeckman 0e0c959a49 [FIX] crm: fix crash when saving new record
A crash would occur when creating new records as the code did not take
into account the possibility of having empty "base" data.

closes odoo/odoo#100973

X-original-commit: 497db878fa3f9303ce33035d5737352289c4f97d
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-23 13:34:34 +02:00
William Braeckman ee951c945b [IMP] hr: remove mixins
Prefer using hooks instead.
Makes use of the new open_chat_hook from mail when possible.

closes odoo/odoo#100764

X-original-commit: d058734cf55f2c3f46f2f23e0bbbfc54f2f0da15
Related: odoo/enterprise#31605
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-22 12:23:27 +02:00
William Braeckman 18426a62eb [IMP] mail,hr: migrate m2x_avatar_user and m2x_avatar_employee to wowl2
Those fields may be used in the new views.

Some of the legacy fields had to be kept because they are used
in some legacy views, more notably the gantt and activity views as well
as in the mrp work order tablet mode.

X-original-commit: 1c871ad9ea4a77468911ff6a5546688a26398a8b
Part-of: odoo/odoo#100764
2022-09-22 12:23:27 +02:00
William Braeckman 7909827571 [IMP] web: add displayText option to tags_list
In addition to the `displayBadge` option which is already present this
commit adds a new option `displayText` which dictates whether we want
any text at all on our tags list.
This is useful for kanban view where we only want to display the avatar.

X-original-commit: 7930865f0514092960acb0f76532e794f35882a3
Part-of: odoo/odoo#100764
2022-09-22 12:23:27 +02:00
William Braeckman d2dd9a2f45 [FIX] web: fix invalid popover for tags_list
The `TagsList` component may be provided with a list of tags and a
number of tags that should be visible.
In the case where there are more tags then there are tags that should be
visible a ball with the number of remaining records is added with a
popover containing the names of the records.
However the popover contained plain text resulting in
`record1<br/>record2` instead of marked up html.
It will now use a tooltip template and more info.

X-original-commit: baf9711407a01ec196bf7de191372056aa4cab6e
Part-of: odoo/odoo#100764
2022-09-22 12:23:27 +02:00
William Braeckman f6a1f0dd28 [FIX] web: fix wrong css selector for many2one_avatar in kanban views
It seems that the css rule was copied from the legacy version of the
kanban view however the dom related to those rules changed with the new
fields and thus the rule was never applied.

X-original-commit: dbb10524b2d97a0004e4e998e4f2252c1e46982a
Part-of: odoo/odoo#100764
2022-09-22 12:23:26 +02:00
William Braeckman 55659d3f7b [IMP] web: expose ListKanbanMany2ManyTagsAvatarField
X-original-commit: fac4dbdce7f2c24ae3dd1f7cca0e9ccca00a14e9
Part-of: odoo/odoo#100764
2022-09-22 12:23:26 +02:00
William Braeckman 699994fccf [IMP] web: make it possible to add classes to fields
`additionalClasses` can now be set on field components to add certain
classes the wrapper should have.
This is useful in case css rules have been defined on a field widget
that we want to inherit from.

X-original-commit: e882c892ad2bf476a6d25cbd90e72974c5453a38
Part-of: odoo/odoo#100764
2022-09-22 12:23:26 +02:00
William Braeckman f5edde3624 [FIX] website_sale: fix missing file in assets_editor
Due to the new way of handling qweb assets, one file was missing from
the editor bundle, throwing a traceback when clicking on a product in
the product grid.

closes odoo/odoo#100477

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-19 11:29:14 +02:00
William Braeckman 24fbcf2266 [FIX] hr_org_chart: fix label in res_users form view
The colspan attribute was missing for the form view making it look like
there was a label for the org chart widget, which should not be there.

closes odoo/odoo#100469

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-09-19 11:29:11 +02:00
William Braeckman 42237c0ddc [IMP] crm: migrate CRM to wowl2
Migrate `crm_form`, `crm_kanban` and all `forecast_` views.

closes odoo/odoo#98837

Related: odoo/upgrade#3895
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-09-19 11:28:51 +02:00
William Braeckman c0e2c64967 [FIX] web_tour: fix drag_and_drop_native in kanban views
Due to how drag and drop works in grouped kanban views now, no event is
triggered when dragging and dropping, this fix listens to mousedown in
order to define whether the element is going to be dragged.

Part-of: odoo/odoo#98837
2022-09-19 11:28:50 +02:00
William Braeckman 51333adefe [IMP] web: extract progress bar parsing code
The progress bar parsing code was inside a big block of code making it
impossible to override to add custom behaviour.
It is not in a separated function.

Part-of: odoo/odoo#98837
2022-09-19 11:28:50 +02:00
William Braeckman 51a3d0e19f [IMP] web: make it possible to prefix KanbanAnimatedNumber
Use the `prefix` slot to give a prefix to KanbanAnimatedNumber, making
it possible to add text while not needing to extend the class/template.

Part-of: odoo/odoo#98837
2022-09-19 11:28:50 +02:00
William Braeckman 01d18acb34 [FIX] loyalty: fix position of generate coupons button
The generate coupon button would appear after the export button prior
 to this commit.

closes odoo/odoo#100463

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-19 10:30:11 +02:00
William Braeckman 3ed96f292e [FIX] loyalty: include date_to in program's validity
closes odoo/odoo#100339

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-16 14:25:53 +02:00
William Braeckman df51898abd [IMP] delivery_mondialrelay: use loadJS util function to load lib
closes odoo/odoo#100134

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-15 00:30:28 +02:00
William Braeckman 1e09eaea73 [FIX] loyalty: fix use of invalid widget
The widget `many2one_tags` tags was used in the loyalty program form
view, however it does not exist.

TaskId-2982239

closes odoo/odoo#100170

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-14 23:37:58 +02:00
William Braeckman cfa09cedce [IMP] loyalty: use program default values for reward and rules
Prior to this commit the default values of a reward/rule would be static
and not depend on the program type.
It will now use the default value if the program_type is given in the
context.

TaskId-2982239

Part-of: odoo/odoo#100170
2022-09-14 23:37:58 +02:00
William Braeckman d5a1b78de0 [FIX] loyalty: fix generate ewallet from list view
Prior to this commit it was not possible to choose the customer when the
wizard was started form an ewallet's program ewallet list view.

TaskId-2982239

Part-of: odoo/odoo#100170
2022-09-14 23:37:58 +02:00
William Braeckman e2ba23ea17 [IMP] mail: Migrate many2many_tags_email widget to Owl
closes odoo/odoo#99230

Related: odoo/enterprise#31254
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-13 13:53:08 +02:00
William Braeckman 44cfa03587 [IMP] mrp: migrate mrp_documents_kanban to wowl2
This views has multiple custom features such as file upload, attachment
viewer and download.
A lot of files have been rendered obsolete and have been deleted,
notably `file_upload_mixin` which has been replaced by the
file_upload service and hooks.

closes odoo/odoo#99769

Related: odoo/enterprise#31145
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-09-12 17:33:14 +02:00
William Braeckman 98df7cdb41 [FIX] website_sale_autocomplete: fix styling
Bootstrap 5 changed the display of `dropdown-menu` to be absolute,
meaning w-100 would take the whole screen.
We set it as relative to take the width of the input.

closes odoo/odoo#100005

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-12 13:49:46 +02:00
William Braeckman f129fd3e57 [FIX] website_sale_picking: fix access error as public user
When selecting on site picking and/or onsite payment the public user was
presented with an access error while it shouldn't.

closes odoo/odoo#100001

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-12 13:49:43 +02:00
William Braeckman 5162186579 [IMP] loyalty: lots of small ui changes
This PR is a followup to odoo/odoo#99023

TaskId-2977152

closes odoo/odoo#99900

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-09 14:41:28 +02:00
William Braeckman 3bfd3581f9 [FIX] website_payment: fix provider button styling
Since a field is put inside of the button, the space used by the button
is a bit overblown compared to the text inside, by adding oe_inline we
make it use less space.

closes odoo/odoo#99830

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-08 21:43:18 +02:00
William Braeckman dc02b1cdba [FIX] website_sale_loyalty: fix possible crash during tests
This commit attempts to fix an undeterministic error, calling an
ensure_one method on an empty recordset.

closes odoo/odoo#99808

X-original-commit: 8e079bc0509f13794c61efeb1080c59baad65590
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-08 14:53:21 +02:00
William Braeckman f36045625a [FIX] hr_recruitment: fix crash outside of multi company
Since recently fields are not present in the views if the user does not
match the groups attribute on that field, this means that the field is
not loaded an may not be used in domains in `attrs` for example.
Most fields were properly checked but some remained broken.

closes odoo/odoo#99751

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-08 11:45:21 +02:00
William Braeckman 90c035b70e [FIX] hr_org_chart: fix data not being reloaded
This commit fixes an issue with the org chart since it was converted to
owl, the data would not be reloaded when changing from record to record.
Instead it would always show the data from the first record it ever
loaded.

closes odoo/odoo#99618

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-07 11:25:48 +02:00
William Braeckman 3dada389d4 [FIX] hr: Fix automatic employee creation
Introduced by #85428

closes odoo/odoo#99672

X-original-commit: e6cef5ab9ec189f1f0b86e21a1400859f021ba06
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-07 07:20:41 +02:00
William Braeckman 87e7f30abc [IMP] website_sale_loyalty: make it possible to remove an auto reward
Prior to this commit there was no way of removing an automatically
claimed reward from a website order, since it would always get claimed
right after the update to the cart.

TaskId-2951413

closes odoo/odoo#99023

Related: odoo/enterprise#30794
Related: odoo/upgrade#3820
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-02 20:10:59 +02:00
William Braeckman 2b5f9114aa [IMP] website_sale,mondialrelay: add mondial relay setting
Adds a setting to enable mondialrelay from the settings just like the
other shipping methods and a way to access the configuration of such
shipping methods more easily.

TaskId-2845799

closes odoo/odoo#98156

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-01 15:32:51 +02:00
William Braeckman 30f885c877 [IMP] delivery_mondialrelay: migrate widget to owl
This commit adapts the `mondialrelay_relay` widget to use wowl instead
of legacy.

closes odoo/odoo#99380

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-09-01 14:17:04 +02:00
William Braeckman d325c028db [IMP] mail: change identifyingmode of attachment viewer
Part of the document B2B (see odoo/enterprise#29807 )

The attachment viewer can be opened without being a dialog in the
documents app now.

TaskId-2863861

closes odoo/odoo#98389

Related: odoo/upgrade#3835
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-31 22:13:04 +02:00
William Braeckman 498b9476d3 [IMP] hr_holidays: improve days calculation based on worked time
Prior to this commit accrual levels based on worked time did not
properly compute the number of days when the period prorata was taken
into account.

TaskId-2924364

closes odoo/odoo#99183

X-original-commit: d9000d3d883ab6fa8325692f1ac5249d6822046a
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-30 08:19:06 +02:00
William Braeckman 75cb824902 [IMP] website_sale: improve zoom features in front-end
This commit adds a new option for picture zoom on product pages.
The designer may now select a attachment viewer like carousel upon
clicking on images in the view.
The hover zoom has also been fixed as it was broken due to the bootstrap
5 changes.
The designer may choose between zoom on hover, on click, both or no
zoom.

TaskId-2922062

closes odoo/odoo#98305

Related: odoo/upgrade#3785
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-30 03:44:50 +02:00
William Braeckman 3754600694 [FIX] website_sale: fix cart popover
The cart popover was broken since the bootstrap changes as data that was
previously set on the jquery element upon creating the popover was not
set anymore.

closes odoo/odoo#98991

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-27 03:34:01 +02:00
William Braeckman e1b32bcc8b [IMP] website_sale: migrate video_preview field to owl
This commit migrates the `video_preview` field to owl.

closes odoo/odoo#98819

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-25 04:21:17 +02:00
William Braeckman a571875c32 [FIX] website_sale_gift_card: remove unused file
During the forward port of https://github.com/odoo/odoo/pull/96855 the
file gift_card_controller.py was reintroduced by mistake.

closes odoo/odoo#98740

X-original-commit: 0d80cf7c6999f968e9aee1d9622fdf21f3dd5806
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-23 20:05:43 +02:00
William Braeckman bb4324a69e [FIX] base: fix t-field with empty value/default value
Since odoo/odoo#97347 we support default values for `t-field`
directives.
However this causes some issues in the case where we have: no value, no
default value AND force_display is true.
This is because the indentation for one of the lines in the compiled
code was not correct. (full explanation here: https://github.com/odoo/odoo/pull/97347#issuecomment-1222430659)

closes odoo/odoo#98714

X-original-commit: 2b605d3ccd55dc4f5b1ad44439411542e5b04b31
Signed-off-by: Rémy Voet <ryv@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-23 17:55:35 +02:00
William Braeckman 2656bcf55d [FIX] website_sale_wishlist: fix undeterministic error in tour
This commit attempts to fix an undeterministic error during one of
`website_sale_wishlist` tests.
Due to a race condition it may happen that the button to add to the
wishlist would be re enabled while it should be disabled (if the product
is already in the wishlist) causing the tour to fail.

closes odoo/odoo#98206

X-original-commit: e10f50e6eb3b825113058d29ae79c7aeafd94a55
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-17 11:21:47 +02:00
William Braeckman b274cf2427 [IMP] website_sale: unify product page editor configuration
By adding features to the web editor for the product page we only
increased the amount of possible categories we might have for our page.
This commit unifies all of those categories into a single one that is
enabled for the editor on the whole page.

TaskId-2925690

closes odoo/odoo#97917

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-17 11:21:19 +02:00
William Braeckman 0f4904a0f1 [FIX] web: fix invalid class being used in search_panel
odoo/odoo#87678 redesigned part of the search_panel however one of the
old bootstrap calsses was still used which resulted in sub categories
rendering poorly.
This commit changes that class to the new name.

closes odoo/odoo#97585

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-08 21:03:23 +02:00
William Braeckman 4f35751bb0 [FIX] hr_holidays: fix accrual level maximum leaves
A test introduced with https://github.com/odoo/odoo/pull/96432
revealed an issue with the level limits for the accrual plans.

The only applied limit was the one of the current level at the end of
the run, however if for whatever reason multiple levels had to be
processed at once (if the database was shut down for a long period of
time for example), the individual levels would not apply any limit logic
to their behaviour which meant that you could have a different behaviour
between running the cron each day and running it after a long period.

This commit aims to fix that issue by applying the said limit.

OPW-2868297

closes odoo/odoo#97540

X-original-commit: 09fa1020f42d641fc0011d482cdd08aea4f4085a
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-08-05 08:11:45 +02:00
William Braeckman 79eb9187ba [FIX] website_sale: fix invalid product type in test
Prior to this commit a non existing product type was used in one of the
test.
This commit changes it to an existing one.

closes odoo/odoo#97380

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-03 15:09:50 +02:00
William Braeckman 2179401726 [FIX] sale_loyalty: fix invalid invoice status
The invoice status was badly computed since the loyalty refactor due to
the use of the wrong value when comparing to the previous state.
(to_invoice instead of to invoice)

TaskId-2936708

closes odoo/odoo#97002

X-original-commit: e88dcd26eebf0e527929a0c48e259895822cf23e
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-08-02 10:31:54 +02:00
William Braeckman 5662b31b40 [IMP] loyalty: adapt views to wowl 2
Due to the new form and list views some of the customisation of loyalty
were not working properly anymore.
This commit adapts the js customisation inside of loyalty to wowl 2.

TaskId-2929488

closes odoo/odoo#96731

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-07-27 07:59:50 +02:00
William Braeckman 11938424c3 [FIX] website_sale: prevent adding archived products to cart
Prevents adding archived products to the cart.

TaskId-2925397

closes odoo/odoo#96483

X-original-commit: 623014802e643e19eb61966c5f639e2b04ff9e81
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-07-21 01:53:41 +02:00
William Braeckman 42f0dd02ae [FIX] website_sale: fix test_05_google_analytics
This commit increases the timeout for some steps in the
`google_analytics_view_item` tour.
The step would time out semi-regularly due to a timeout.

TaskId-2925407

closes odoo/odoo#96454

X-original-commit: 8e6eae7b2a3e6da195e4283a008a14d8296539b4
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-07-21 01:53:35 +02:00
William Braeckman 57a1776c36 [IMP] website_sale: allow using alternative products in dynamic snippet
With this commit we replace the current way to show alternative
products with a new option on the dynamic snippets.

Instead of having alternative products show up on all products if the
option is enabled, it will now be on a per product (template that is) basis
using the dynamic product snippet.

TaskId-2695187

closes odoo/odoo#85189

Related: odoo/upgrade#3277
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-07-21 00:49:46 +02:00
William Braeckman c91c2712a1 [FIX] website_sale: fix dynamic product snippet
Since "website in backend" the dynamic product snippet on product pages
did not work at properly due to not being able to do a jquery find
inside of an iframe, making context dependent product filters such as
"alternative products" (which will become a dynamic snippet filter) not
show up as an option.

TaskId-2695187

Part-of: odoo/odoo#85189
2022-07-21 00:49:45 +02:00
William Braeckman b06a2ace32 [FIX] website_sale: fix product grid not updating
This commit fixes the product image grid not being updated after
changing a variant.

TaskId-2922057

closes odoo/odoo#96102

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-07-18 18:41:46 +02:00
William Braeckman f3590959b0 [IMP] mail: improve attachment_viewer
This commit improves the expendability of the attachment_viewer model
and component by making it less dependent on attachment_list.

This is required by the refactoring in wowl of the documents app(s).

TaskId-2898342

closes odoo/odoo#94930

Related: odoo/enterprise#28976
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-07-15 23:29:44 +02:00
William Braeckman 7cb9805b2e [FIX] website_sale: fix carousel indicators
Due to the recent bootstrap changes one attribute on the carousel
indicators was badly migrated which caused bootstrap's carousel code to
throw an error.
This commit fixes that issue.

TaskId-2833507

closes odoo/odoo#92447

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-07-14 16:41:52 +02:00
William Braeckman 54c6d36cfb [IMP] website_sale: add alternative product image displays
This commit adds a new display type for a product page, namely the grid
mode.
The web designer will now be able to choose between carousel (previous
mode) and grid.
The web designer may also choose how much space the images take on the
page between 0%, 50% 66% and 100%.

TaskId-2833507

Part-of: odoo/odoo#92447
2022-07-14 16:41:52 +02:00
William Braeckman 1741b1552e [FIX] hr_holidays: fix a bad call to relativedelta
This commit fixes a bad call to relativedelta missing a `day` key for an
argument.

closes odoo/odoo#95705

X-original-commit: b59e81b6c34e7a4e2f35cf719c811883b289ddb5
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-07-09 22:58:10 +02:00
William Braeckman d54c6a7c12 [FIX] mail: fix css for o_kanban_attachment
This commit fixes the css rule for the class `o_kanban_attachment` that
was broken for owl kanban views since f795af0160ed7977d07041d1bb1923598df48320.

closes odoo/odoo#95444

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-07-06 17:10:45 +02:00
William Braeckman ee947329c1 [IMP] website_sale: improve mandatory sign in
15.3 introduced a new setting in the website to force users to sign
   in/up whenever they try to buy something from the store.
This commit adds the mechanism to redirect the "process checkout" page
to the login page whenever the option is enabled and the user is not
logged in.

TaskId-2844980

closes odoo/odoo#90901

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-06-29 12:19:11 +02:00
William Braeckman 7aae635831 [IMP] website_sale: slightly improve website_order_line
Slightly improve `_compute_website_order_line` by reducing the
complexity when `website_sale_delivery` or `website_sale_loyalty` is
installed.

TaskId-2786691

closes odoo/odoo#90025

Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-06-29 10:00:47 +02:00
William Braeckman b4f77a5362 [FIX] hr: fix access error on language change
Backport of odoo/odoo#81474
Before odoo/odoo#86889 a regular user with employees in multiple
companies was not able to change his own language due to a chain of
event calling onchange on all the employee_ids and employee_ids on
res.users being read as sudo.
The fix does work but was wrong because it gave access to the user's
public employee regardless of the active company_id
A domain was added to employee_ids to make force the security rules even
in sudo.

closes odoo/odoo#94618

X-original-commit: 90cec4073e065c142043fcea1d68a10c7cb72e73
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-06-25 10:50:48 +02:00
William Braeckman f38ff9754d [FIX] hr_work_entry_holidays: prevent not being able to cancel time off
Prior to this commit if work entries/payroll was installed you could not
cancel a time off in the future if the work entries were generated for
that period, however you should still be able to cancel a time off as
long as the work entries have not been validated yet.

TaskId-2791386

closes odoo/odoo#94165

X-original-commit: 975ac8d2a1809bf7725d577b0fa9143a5b255e0d
Related: odoo/enterprise#28673
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-06-21 16:52:02 +02:00
William Braeckman 46efe7df1b [IMP] project: allow modification of personal stages
This commit allows project users to create and modify their own personal
stages.
A lot of overrides have been done on the kanban view to handle our
multiple cases.

Project user will now only see the options to create columns/edit stages
when grouping by personal stage.
This is hardcoded and does not follow possible custom access rules
however.

Any stage created while grouping by personal stage will directly be
assigned to the user and will be seen in the 'My Tasks' menu.

A special method has been added to delete a personal stage.
Upon deletion any task assigned to this personal stage will move to a
lower sequence stage if possible otherwise the next in line.

TaskId-2858445

closes odoo/odoo#92103

X-original-commit: 7b3acbc0b0c21ab106b1b34d9f5c8bc1ceb2fe58
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-05-23 18:36:14 +02:00
William Braeckman 8c32ed3fb2 [FIX] project: fix deletion of column in task kanban
Upon deleting a column in the project task view a popup will be
displayed warning the user that the stage will not be deleted but
instead archived.
Prior to this commit that popup would be displayed regardless of the
group by option that is selected. However this could lead to issues when
opening the archive wizard with an id from another record.

closes odoo/odoo#91872

X-original-commit: 24d307716cbd9e05a32dde108838e16d04309116
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-05-20 07:12:08 +02:00
William Braeckman 40b10d0295 [FIX] website_sale: Avoid traceback when adding deleted products to cart
Prior to this commit an user could try to add a product to cart that does not
exist anymore because it was deleted while the user /shop page wasn't refreshed.

This commit avoids this (rare) use case to happen.

TaskId-2835736

closes odoo/odoo#91752

X-original-commit: 7aeec2921d7159f0c7fa4c8caf2d00f802c69264
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-05-19 13:45:12 +02:00
William Braeckman b15206ad5d [FIX] hr_holidays: exclude cancelled time off by default in report
Prior to this commit cancelled time off were included in the leave
report calendar model and were shown as regular time offs.
They will now be hidden.

closes odoo/odoo#91675

X-original-commit: c8d17c760e27736d0cb809b59e9945f808b1138e
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-05-18 17:09:48 +02:00
William Braeckman d90153180d [FIX] base: fix file extension when using default name
The file extension detection previously used to determine whether a
filename required an extension was not very smart and in fact only
checked for a dot in the filename.
`mimetypes.guess_type` is now used on the filename to better determine
whether the filename still needs a file extension or not.

This commit is a follow-up to: https://github.com/odoo/odoo/pull/90614
Which aimed to fix the same issue.

TaskId-2826061

closes odoo/odoo#91254

X-original-commit: bf904a7f98ba5bcc0a8909cca3241e2965c4464c
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-05-12 21:13:34 +02:00
William Braeckman bbad356f13 [FIX] sale_loyalty,pos_loyalty: fix discountable on specific products
Prior to this commit the discountable amount on specific products was
not computed correctly when using fixed price discounts as it did not
take the taxes into account.
They will now be taken into account and result in the correct discount.

TaskId-2834863

closes odoo/odoo#91202

X-original-commit: 669f4cca94af0c022318f6cb508c1c197aae0846
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: William Braeckman (wbr) <wbr@odoo.com>
2022-05-12 14:51:10 +02:00
William Braeckman df984fff4e [IMP] resource: improve performance of _attendance_intervals
This commit aims to improve the performance of
`_attendance_intervals_batch`.

The complexity in space has been reduced by a lot.
Prior to this commit an intervals object was generated for each resource
request.
However every resource of the same timezone will share the same ending result.
The number of calls to `localize` and `astimezone` has also been reduced
as they get quite expensive with such a high volume.

Overall we can see a 10x improvement during `test_performance_attendance_intervals_batch`

closes odoo/odoo#90933

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-05-11 16:00:34 +02:00
William Braeckman 9985fd0725 [FIX] hr_work_entry_contract: fix generation of work entries
This commit aims to fix an issue with work entries generation when the
requested period is completely outside of the contracts period.
In this case no work entries should be generated.

Part-of: odoo/odoo#90933
2022-05-11 16:00:34 +02:00
William Braeckman f51afa1ed4 [IMP] hr_work_entry_contract: prep work for multiple sources
Prep work to allow work entries to be created from multiple sources when
using contracts.
The end goal is to be able to generate work entries from attendance as
well as the planning app.
After that the plan is to make sure the implementation works well with
payroll for hourly wages.

This commit contains the necessary changes for the next work_entry
modules to work.

TaskId-2466871
2022-05-11 11:23:04 +02:00
William Braeckman 3b1e37ce67 [FIX] hr_work_entry_contract: fix first batching
While investigating an error that occured on production it was noticed
that work entry batching did not happen correctly on the first batch for
contracts that started on the same date, this is due to the microseconds
being different in the `date_generated_from` and `date_generated_to`
fields.

TaskId-2466871
2022-05-10 14:56:10 +02:00
William Braeckman 4bf43e21de [FIX] account: fix terms in sitemap when it is not enabled
The /terms page may be disabled/enabled in the company settings, however
the page would always be present in the sitemap whether it is enabled or
not.
This commit adds a method that checks for this settings before adding it
to the sitemap.

TaskId-2820292

closes odoo/odoo#90930

X-original-commit: 729b99a789b52c09be0272cefa3bb0eaccd6803c
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-05-09 19:56:53 +02:00