Commit Graph
164538 Commits
Author SHA1 Message Date
Christophe Simonis 6e7cf8e6c8 [FIX] point_of_sale: always create missing picking types
Don't do it only at install.

closes odoo/odoo#133505

X-original-commit: 359f3ac3075f4b79e830ebe33fded49f3e8febcb
Signed-off-by: Nicolas Seinlet (nse) <nse@odoo.com>
Signed-off-by: Christophe Simonis (chs) <chs@odoo.com>
2023-08-29 15:47:45 +00:00
Dylan Kiss (dyki) 94a66d9c6b [FIX] base: allow to create branches again
Since the relational model JS refactor in
d4fe919db5, we are unable to create new
branches of companies.

The required field `partner_id` (which is created in the model's
`create` method), was set as `required="0"` on the form view, but not on
the list view. After the relational model refactor, when merging the
modifiers of the field in both views, it is considered required. When
trying to save a new branch, it thus complains that the `partner_id`
field is empty.

Setting the `required="0"` modifier on the list view solves the issue,
making the `partner_id` not required anymore for the JS form dialog.

task-3461421

closes odoo/odoo#133488

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2023-08-29 15:47:44 +00:00
Nshimiyimana Séna a6f8d1554f [FIX] loyalty: add link to discout products in loyalty.program form view
A customer has a gift card product linked to a specific income account.
When sold, the income account associated with the gift card product is
credited correctly. The issue arises when the gift card is consumed
within a sales order. An order line is added using a "dummy product" to
indicate the gift card's usage (one dummy product is created for each
loyalty program). Due to this, when an account move is created from the
sale order, the income account defined on the dummy product is used
instead of the one on the gift card product. This leads to the wrong
income account being debited, causing unbalanced accounting entries.

There's currently no way to link back to the original gift card product
from a `loyalty.card` record. Because of this, the system cannot
identify the correct income account to debit. Fixing this would require
adding a new field, which we can't do in stable.

A potential workaround is to find the dummy product and set the income
account to the same as the gift card product. However, with one dummy
product for each `loyalty.program`, all named "Gift Card", finding the
right dummy product is difficult.

This commit aims to simplify the workaround by adding a link to the
associated dummy product on the `loyalty.program` form view. This change
should ease the process of finding and modifying the correct dummy
product, thus mitigating the issue in the current stable version.

opw-3239720
opw-3373287

closes odoo/odoo#133461

X-original-commit: 767eccb122055cd9a474ce5110cb7296eb9ef4c2
Signed-off-by: Séna Serge Nshimiyimana (sesn) <sesn@odoo.com>
2023-08-29 15:47:43 +00:00
Tiffany Chang (tic) 8a3a13d821 [FIX] mrp,purchase,repair,stock: cleanup of modifier refactoring
Minor cleanup after odoo/odoo#104741 thanks to edge-cases and the fun
complexity of logistics code. Fixes include:

- removing some readonly=False that were added on computed/stored fields
  that already have an inverse func or were already not readonly (i.e.
  redundant => cleanup)
- fixed visibility of qty to prod in subcontractor portal view of a MO
  (i.e. yay they know how much they're supposed to make again)
- remove unused imports
- adding back in readonly functionality of default dest of repair
  operation type (and removing the now useless field override that used
  to add in the readonly functionality)
- adding back in the `_set_product_qty` inverse function since it was
  probably removed by mistake (and is still important to have)

unrelated to viewpocolypse change, also fixed:
- mobile view of PO was for some reason allowing products to be changed
  in already confirmed/done POs, which could lead to some inconsistent
  data => made this consistent with existing desktop view behavior

closes odoo/odoo#133502

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2023-08-29 14:09:53 +00:00
zel-odoo 72da6f0ae9 [FIX] mail: chatter message overflow
1. When the width of a message is greater than the width
of the chatter, a horizontal scroll bar should be activated
on that message, and not on the whole chatter.
2. margin on the seperator to make it more consistent

task-3478057

closes odoo/odoo#133482

X-original-commit: 56a7278edfc717e9e856feccc7514d99d1bf0b2c
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-29 14:09:52 +00:00
std-odoo 8b54b08c26 [FIX] web: properties, fix the label requirement check
Bug
===
The labels of the properties and their names are always required,
the check was wrongly done and still used the historical name "id"
instead of "name".

If a property value is missing, the color of the label is marked in red.
But the datepicker and dropdown are also in read which we don't want
(only the label).

Task-3188915

closes odoo/odoo#133479

X-original-commit: 5c0720743d299eec305a025d20201103f9f45dc5
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-08-29 14:09:51 +00:00
Hubert Van de Walle (huvw) ef11a89899 [FIX] point_of_sale: hide cash move button for users without permission
Steps to reproduce
==================

- Remove the Accounting/Billing permission from Marc Demo
- Login as Marc Demo
- Start a POS session
- Click on "Cash In/Out"

An error occurs because the user doesn't have the appropriate
permission

Solution
========

Add a key `has_cash_move_permission` in the pos config.
Set it to the presence/absence of the group `account.group_account_invoice`.
If the permission is missing, hide the "Cash In/Out" button.

opw-3333622

closes odoo/odoo#133444

X-original-commit: 62ea247953e5d8e81b3af7d4bbde3ec2ffb49f19
Signed-off-by: Robin Heinz (rhe) <rhe@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-08-29 14:09:47 +00:00
Alexandre Kühn 78c2dba93f [FIX] mail: show full company logo in avatar of message
Before this commit, avatar url of author of message always had
style `.o_object_fit_cover`, which makes a nice crop when
ratio of image does not match ratio of the `img`.

When the author of message is a company, it shows the logo of the
company, and it doesn't look nice to crop it.

This commit fixes the issue by using `.o_object_fit_contain` for
avatar of company, so that the logo is fully visible.
When displaying the avatar of a partner whose `is_company` is
undefined, the data is group-fetched, in order for models to
eventually know the value of `is_company` and use the correct
desirable showing.

Task-3381748

closes odoo/odoo#133311

X-original-commit: 48194366f2364e2eb9d99dc4fb71e2de83d8f7a2
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-29 12:36:01 +00:00
Noe Antoine b96512a23c [IMP] crm: replace meeting count by date for lead stat btn
Instead of having a count field for meetings linked to
a crm.lead, show a (start) date instead:
- If there is a next meeting, show its date + "Next Meeting"
- Otherwise, show last meeting date + "Last Meeting"
- If no meeting, show no date and display "No Meeting"
- hide button for new records

This commit removes the field "calendar_event_count" that
has no use anymore. A test using the count field is adapted.
Another is added to assert new fields behavior.

UPG PR odoo/upgrade#4935

Task-3418397

closes odoo/odoo#128366

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-08-29 12:36:00 +00:00
Sébastien Theys fa8f68ce05 [REF] mail: tests: add scrollTop to contains
This is much more robust and faster than relying on arbitrary number of
animation frames.

closes odoo/odoo#133333

Related: odoo/enterprise#46407
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2023-08-29 11:10:52 +00:00
Sébastien Theys ea9615cce6 [FIX] mail: fix race condition "closing hidden chat window"
Should wait until each chat window is opened before clicking on the next
one to guaranteed proper opening order.

Part-of: odoo/odoo#133333
2023-08-29 11:10:52 +00:00
Aaron Bohy f065276a46 [FIX] web: tests: click helper: throw error if target is disabled
Before chrome 116, programmatic clicks on disabled buttons weren't
actually fired. With chrome 116, they are. As a consequence, some
tests fails on chrome 116 because they click (on purpose) on
disabled button to highlight the fact that nothing happens.

This commit improves the click helper to make it throw an error
when the target is disabled. It also adapts the tests that were
clicking on disabled button, in general to simply assert that the
button is disabled instead.

closes odoo/odoo#133196

Related: odoo/enterprise#46398
Signed-off-by: Samuel Degueldre (sad) <sad@odoo.com>
2023-08-29 11:10:50 +00:00
Michael (mcm) 1f5e8f0fd4 [IMP] web,*: remove web.session
This commit removes the legacy session and adapts the modules where it
was used.

task 3439226

closes odoo/odoo#133153

Related: odoo/enterprise#46290
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2023-08-29 11:10:47 +00:00
Michael (mcm) 629a046e03 [IMP] web,*: empty services/core.js
This commit removes almost all exports of the module services/core.js
(only the bus is left) and adapts the module that imported it.

task 3439226

Part-of: odoo/odoo#133153
2023-08-29 11:10:47 +00:00
Michael (mcm) 55f1822911 [IMP] web,*: remove services/config.js
This commit removes the module services/config.js and adapts the module
that imported it.

task 3439226

Part-of: odoo/odoo#133153
2023-08-29 11:10:47 +00:00
Jorge Pinna Puissant 4bf77b9ef1 [REF] web: RelationalModel: add option to save after update
This commit adds an option to save the record after an update. When the
save option is set to true, the record will be saved and reload after
the update. Note that, the onChange is not done in this case.

Part-of task-id~3179751

closes odoo/odoo#130328

Related: odoo/enterprise#44905
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-29 11:10:45 +00:00
Damien Bouvy c21ff19a32 [FIX] web: typo in var for list 'add a line' row colspan
hasSelector is undefined so the row's colspan was never adapted

closes odoo/odoo#116989

Related: odoo/enterprise#44595
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-29 11:10:42 +00:00
Pierre Rousseau 234a5e6245 [IMP] account, project: open form view from editable list view
This commit uses the new options of the editable list view to open a
form view when clicking on a line.

Task-id 3063425

Part-of: odoo/odoo#116989
2023-08-29 11:10:42 +00:00
Pierre Rousseau 258e6a019a [IMP] web: allow to open a record in editable list
With this revision, it's now possible to display a button to switch from
an editable list view to a form view. It's possible by adding the
attribute open_form_view to the tree element in the list definition. It
works both with base and embedded list views.

Task-id 3063425

Part-of: odoo/odoo#116989
2023-08-29 11:10:42 +00:00
Rodolpho Lima 3e938043dc [FIX] web_editor: style-inline option in HtmlField
Before this commit, the "style-inline" option was misspelled as
"styleInline", resulting in setting the Wysiwyg "inlineStyle" option as
undefined. This broke functionality that depended on such option, such
as disabling the convertion of pasted/dropped base64-encoded images to
attachment for mail compose.

OPW-3448851

closes odoo/odoo#133406

X-original-commit: 4ec687366eca1e05716fe93dad77eef5a9981153
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
Signed-off-by: Rodolpho Cammarosano de Lima (rcdl) <rcdl@odoo.com>
2023-08-29 09:11:59 +00:00
Yannick Tivisse 2e2c43119c [IMP] account: Add method to retrieve valid payment account types
Purpose
=======

Allow inheritance to register payment per payslip in Payroll application

closes odoo/odoo#132495

Related: odoo/enterprise#45994
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2023-08-29 09:11:57 +00:00
Bastien (bvdn) 1e181b6dd0 [IMP] project: add new controller for project model calendar view
Needed a new view just to be able to change the default display text in the calendar

Task-3251698

closes odoo/odoo#126358

Related: odoo/enterprise#41304
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-08-29 09:11:52 +00:00
Bastien (bvdn) ee52f87a36 [IMP] web: add hooks to calendar controler, fix css for filterPanel
- For the Planning app calendar we now need to be able to fetch specific fields from the filters record
we don't want to inherit the whole loadDynamicFilterSection method so we created an addFilterFields method
used to fetch specific fields from the record accroding to the filterInfo ()

- we also need to display specific text when creating a new record from the calendar view, for exemple in calendar 'New Shift'
rather than 'New event' but we don't need to override the whole editRecord() method so we created a getter: editRecordDefaultDisplayText()

- For the css files, we lowered a bit the checkmark icon in the filters, and we added a new class that prevents the icons background
to become invisible when the filter checkmark isn't changed

Task-3251698

Part-of: odoo/odoo#126358
2023-08-29 09:11:52 +00:00
std-odoo 1008383d9e [IMP] web: allow to drag and drop properties
Purpose
=======
Allow to drag and drop properties to re-arrange them. Also allow to drag
and drop an entire group of properties by drag and dropping the
separator of the group.

Specification
=============
If we have no groups, and we move properties, we want to create
automatically new groups in order to keep the column separation.

So if we have
```
AC
BD
```

and you move B in the second column, we will create 2 groups to keep
the separation, so it will become
```
12
--
AC
 D
 B
```

so `C` stay in the second column.

Task-3188915

closes odoo/odoo#113974

Related: odoo/enterprise#37668
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-08-29 09:11:51 +00:00
std-odoo 29c7b23e22 [IMP] base, web: add the "separator" properties type
Purpose
=======
Add the "separator" properties type, to be able to group properties.

Specification
=============
The separator creates a group until the next separator, we can fold and
unfold the properties in a group.

Technical
=========
The separator is only stored on the definition record, so it does not
take more space than needed.

The "fold" information is stored in the local storage, and is therefore
per user, but shared for all records of the same parent.

We use a properties type for it, to be able to use the exact same code
as other properties (so we can easily move the separator, etc). So
the order of the properties in the definition, and the position of the
separators will create the groups.

Task-3188915

Part-of: odoo/odoo#113974
2023-08-29 09:11:51 +00:00
Benoit Socias 89c93aba75 [FIX] website: remove "rem" unit from body line height theme option
Since [1] the line height is specified as an absolute height instead of
a ratio of the font size. This leads to multiline text with big font
sizes to overlap.

This commit removes the `rem` unit from the `body-line-height` primary
SCSS variable.

Steps to reproduce:
- Drop a text snippet.
- Select a paragraph.
- Change font size to 62.

=> Lines of paragraph did overlap.

In case the value had been edited before this fix, it will be shown
with the "rem" text within the option, which can be removed to update
the value to the correct behavior.

[1]: https://github.com/odoo/odoo/commit/388e4bb2bfcaebdd4ff30277fb49a034592d7086

task-3471117

closes odoo/odoo#133401

X-original-commit: a368dad33d128c95262053769e3f5de852d2be3a
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Signed-off-by: Benoit Socias (bso) <bso@odoo.com>
2023-08-29 07:48:17 +00:00
miad-odoo 2e3b13c040 [FIX] mass_mailing: fix phone preview
This commit fixes an issue introduced in #118966.  For the mobile preview
feature of email marketing, styles used to be loaded by rendering an "empty"
template with the necessary styles.  These styles, however, are no longer
imported in a template, but instead in mass_mailing's manifest.

The fix is to manually load the bundle and create the link tags to add the style
to the mobile phone preview.

Task-3465776

closes odoo/odoo#133400

X-original-commit: b2796d8016be83a1d08f28ef48e98db90c07da69
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2023-08-29 07:48:16 +00:00
Benjamin Vray f7ac68c31d [FIX] website: fix images wall with link on image
After this commit, we prevent the slideshow from appearing when clicking
on an "Images Wall" snippet image that has been set as a link.

Steps to reproduce the bug:

- Drag and drop an "Images Wall" snippet onto the page.
- Add some images in the snippet.
- Click on an image within the snippet.
- In the editor text toolbar, click on the "Link" button.
- Set the URL of the link to "/contactus".
- Click on the "Save" button in the modal.
- Save the page.
- Click on the image with the link.
- Bug: The slideshow briefly appears before redirecting to the "contact
us" page.

task-3425624

closes odoo/odoo#133396

X-original-commit: 8b29eabbd5a01ab225c93f519ea39724bdf3c0b9
Signed-off-by: Colin Louis (loco) <loco@odoo.com>
2023-08-29 07:48:15 +00:00
Aaron Bohy 1da9684ddf [FIX] web: kanban grouped by many2one: keep false group open
In a kanban (or list actually) view grouped by a many2one field,
the "false" group is folded by default. Before this commit, if the
user opened it and then reloaded the view (e.g. by applying a
filter in the search view), the group was folded again. With this
commit, the group remains open if the user manually opened it.

closes odoo/odoo#133305

Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
2023-08-29 07:48:13 +00:00
Aaron Bohy 049fe6f9ed [FIX] web: multi level grouped list: do not consider empty
Before this commit, when a list view was grouped by more than 1
field, the view was considered empty, and the no content helper
was displayed. For instance, go to Contacts and group by Company
and Country.

Part-of: odoo/odoo#133305
2023-08-29 07:48:13 +00:00
mehjabinfarsana 3ea63ee616 [FIX] stock: make scrap name field readonly
before this commit, name field for scrap was editable
and user can input any value , but on validating
it will be over written by the sequence record

introduced in : https://github.com/odoo/odoo/commit/75a105f46a13f75eb56a0de80faa2a6e146730aa

after this commit, name field is readonly and user
cannot input any value

closes odoo/odoo#133226

Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-08-29 07:48:11 +00:00
dinolew eca0114837 [FIX] l10n_cn_city: correct the zipcode from the list
closes odoo/odoo#133102

X-original-commit: 854923b8d07eed30865a684248c60ea2d4df772e
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Josse Colpaert <jco@odoo.com>
2023-08-29 07:48:10 +00:00
Dino Lew f145d02a1c [CLA] signature for wllbll
X-original-commit: b9de6fc2d2966d9dc730dfe58db3a7415c7035c1
Part-of: odoo/odoo#133102
2023-08-29 07:48:10 +00:00
Gurupreet Singh b0936710c6 [FIX] sale_project: fix milestone stat button visibility issue
Description of the issue/feature this PR addresses:
In the sales module, when creating a new product, it is important to ensure that
the product type is set to Service and that the invoicing policy is based on
milestones. Additionally, selecting the project field is necessary to ensure
that the product is linked to a specific project. Once the product is linked
to a project, it is important to make sure that there is at least one milestone
available within the project.
Once the above steps are completed, creating a sales order (SO) and adding the
newly created product will allow for the milestone stat button to be available
in the draft state.

Current behavior before PR:
The inclusion of the milestone product triggers the visibility of the stat
button.

Desired behavior after PR is merged:
If the state is draft, the milestone stat button ought not to be visible.

Fix:
Adding a condition prevents the stat button from being displayed when the
the current state is draft

task-3374861

closes odoo/odoo#133025

X-original-commit: 2b046e2c6c1e473f71c638c17c588b5b7fed7173
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-08-29 07:48:09 +00:00
Merel Geens (mege) 29acbe8230 [FIX] odoo: import was broken for non-admin users
A check was added to prevent importing records with prefixes of existing
modules: https://github.com/odoo/odoo/pull/130825 . This queries the
known modules, but non-admin users don't have access to that by default,
causing the import to fail for them. Allow the module query regardless
of access rights.

closes odoo/odoo#133405

X-original-commit: e1dcf886129f47fdc121f121df15a2c4724bb0e2
Signed-off-by: Raphael Collet <rco@odoo.com>
Signed-off-by: Merel Geens <mege@odoo.com>
2023-08-29 06:31:37 +00:00
Malay Khamar 03cc644202 [FIX] mrp: add missing Enterprise widget to setting
closes odoo/odoo#133312

X-original-commit: 395ac20f6169f488327f814812fe6cf18bd08ef9
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-08-29 04:56:44 +00:00
Ricardo Gomes Rodrigues (rigr) 9f49312fb1 [FIX] account: prevent deletion of hashed and deferred journal items
The account tour was failing in case some entries were hashed or
were linked to deferral entries because these kind of entries cannot
be deleted but only reverted.

task-id 3437130

closes odoo/odoo#133330

X-original-commit: 4a3ce2701179c481e7506ccbde06663759f03e53
Related: odoo/enterprise#46404
Signed-off-by: Ricardo Gomes Rodrigues (rigr) <rigr@odoo.com>
2023-08-29 03:19:01 +00:00
Jeremy Kersten 9a442591f5 [IMP] fields: log diff of html field when you cannot edit it
Since commit cf844e34, we have a new group `group_sanitize_override`
that allow to prevent users from adding code that will be evaluated.

To know if a user can edit a field if they are restricted editor and
without this group, we do the diff between the normalized version and
the sanitized.

It is difficult to debug in production why a user cannot edit a html
field because we don't have the log of this diff.
Now we add the unified diff into the log. It should not occur too often
and if necessary we will reduce the occurrences in the log later.
(if debug mode, if loaded into the iframe [in edit mode with @], ...)

closes odoo/odoo#133395

X-original-commit: d60759d637a85d2220cee7566483bf3cff93b810
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2023-08-29 01:32:47 +00:00
Bruno Boi 7746c67c0a [IMP] web,*: make x2ManyCommands naming consistent
*: event_booth_sale, sale_product_configurator

Before this commit, the naming convention for x2m commands
is not consistent with the python ORM.

After this commit, the commands use the same terminology
on both side. The JavaScript side has been adapted.

closes odoo/odoo#133357

See: https://www.odoo.com/documentation/16.0/developer/reference/backend/orm.html?highlight=commands#odoo.fields.Command
Related: odoo/enterprise#46418
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2023-08-29 01:32:44 +00:00
Jurgen (jugj) 6673a5b304 [FIX] l10n_be_hr_payroll_(fleet): Fix Bike tax deduction computation
closes odoo/odoo#133243

X-original-commit: 7bdb6e66e8d34b7a9af824817b51c7b307686fef
Related: odoo/enterprise#46362
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Jurgen Gjini (jugj) <jugj@odoo.com>
2023-08-28 23:14:01 +00:00
Nicolas Lempereur a66c6006c3 [FIX] web: accept is_html_empty in layout wizard
Scenario:
- edit the current document layout and use is_html_empty method in it
- it works in Preview Document, when printing any report, ...

=> it breaks when opening document layout wizard by clicking on
   "Configure Document Layout"

Reason: is_html_empty was added to _get_rendering_context, but the
preview instead the document layout wizard doesn't use this method.

Fix: add is_html_empty in the context

opw-3433583

closes odoo/odoo#133122

X-original-commit: 5f1ad0c1e4c1e8ed41337ccd4c12e70c9c760c85
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2023-08-28 23:14:00 +00:00
hapa-odoo fb4b951037 [FIX] l10n_in_edi: improper alignment of E-Invoice code in Invoice.
In this commit, I have made the changes to align the IRN no.
and its related QR code image properly in the invoice
report. before this commit,it overlapped with the tax details.

Steps To Reproduce:
- Install the `l10n_in_edi`
- Switch to `IN Company`
- Go to Configuration->Journals
- Under the `Advance Settings` tab, tick the `Electronic Invoicing`.
- Create an invoice
- Click on `process now` to process an e-invoice.
- Now, print the invoice report.
- You will find the E-invoice code overlaps with the Tax Details.

task:- 3347517

closes odoo/odoo#133007

X-original-commit: 0693552dbb6cf4d160c88da90b8b08d28213d9b6
Signed-off-by: Brice Bartoletti (bib) <bib@odoo.com>
2023-08-28 23:13:59 +00:00
Hbto [ Vauxoo ] 760065157a [IMP] stock_account: Allow tracking COGS Journal Items origin
Main
-

[IMP] stock_account: Allow to keep track of the COGS Journal Items origin

Explain
-

So far It is quite cumbersome to try to figure out which lines are
coming from where for the COGS journal items. It becomes more difficult
to find them out when there are several lines from the same product with
the same quantities and similar characteristics.

By having what invoice line originated which COGS Journal Items you can
auditing and analysis in a more thorough way.

- You can figure out which Sale Line o Invoice Line was more profitable.
  Based on the actual revenue and the actual COGS.
- What COGS line was mistakenly created. For instance, when the invoice
  is created prior delivery, you can figure out how to surgically fix
  the of COGS journal items that that were wrong.
- To try to reconcile properly the lines in a Sale Order Line when there
  is drift and reconciliation is not properly made because there were
  differences and they cannot be easily spotted because you get lost in
  middle of several COGS lines but you do not know where they are really
  coming from.

closes odoo/odoo#125134

Signed-off-by: William André (wan) <wan@odoo.com>
2023-08-28 23:13:55 +00:00
Kamlesh Pathekar 74aad3e19c [IMP] project: display project color in calendar
In this commit, we have implemented the functionality to show the color
of the project in the left side panel of the calendar and calendar entries.

task-3251766

closes odoo/odoo#130700

Related: odoo/enterprise#41569
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-08-28 23:13:53 +00:00
Victor Piryns (pivi) cc567f26c1 [FIX] sale_project: correct expensable services in proj.profit.
Issue:
Two services which difference is that one is expensable with an
expense policy different of none, the expensable service is not
included in the project profitability as revenue from a service,
even it's not actually an expense, just a service that "could be"
expensed. The other service which is not marked as "can be expensed"
is correctly computed in the project profitability.

Steps to reproduce:
- Install Project, Accounting, Sales, Expenses
- Settings > activate analytic accounting
- Create a service, invoiced on milestones, creates a project on SO
  confirmation, can be expensed with an expense policy of Sales price.
- Create an SO, confirm the SO
- Set the milestone to 50% reached, invoice the SO, post it
- Go to the project profitability of the project, notice there is no
  revenue section for the service.
- If you follow these same steps for a service which is not set "can
  be expensed", the service is correctly included as revenue from
  service billable milestone.

Cause:
When computing the profitability items from services, we first get
the `sale_line_ids` (whose domain excludes the expenses), then we get
the product that are linked to those sale_line_ids, but we exclude
products that have an expense_policy different than 'no'. This
domain may not be necessary, because `sale_line_ids` already exclude
expenses.

Fix:
Remove the particular domain leaf.

Affected versions:
16 up to master

Reference:
opw-3430020

closes odoo/odoo#133307

X-original-commit: ac02616c4d54120defa53e9ef463cdcbab69063b
Signed-off-by: Piryns Victor (pivi) <pivi@odoo.com>
Signed-off-by: Xavier Bol (xbo) <xbo@odoo.com>
2023-08-28 21:29:59 +00:00
Thomas Lefebvre (thle) e5b41a63a4 [FIX] calendar: add attendee_id for deletion
Steps to reproduce:
-------------------
- create an event in the calendar;
- click on "Everybody's calendars" filter;
- delete the event.

Issue:
------
The event name is crossed out (declined)
instead of being deleted,
even if we are the organizer.

Cause:
------
The value of `event.attendee_id` inside the
`_onDeleteRecord` is `undefined`.
The condition will therefore never be `true`.

Solution:
---------
Add the organizer's id to the event
so that he can delete it in the case
of "Everybody's calendars" filter.

Note:
-----
Correct decline event from calendar view.

opw-3230254

closes odoo/odoo#133298

X-original-commit: 4ef44f403f1c93b62230307f5fa909b8a83f4eb8
Signed-off-by: Arnaud Joset (arj) <arj@odoo.com>
Signed-off-by: Thomas Lefebvre (thle) <thle@odoo.com>
2023-08-28 21:29:58 +00:00
Hubert Van de Walle (huvw) c2b93f7f0e [FIX] hr_maintenance: use hr.employee -> .public when missing rights
Steps to reproduce
==================

- Login as a user with no rights
- Use a mobile viewport
- Create a new Maintenance Request
- Edit the Created By field

-> A traceback occurs because the user has no rights

Solution
========

We extend the Many2OneField to accept a relation option and Depending on
whether the user has the rights, use the correct one.

This is similar to 41eaff0f4c17

opw-3430105

closes odoo/odoo#133261

X-original-commit: e78998c2951ec906fbccbe24e3fa454711a37c2b
Signed-off-by: Sofie Gvaladze (sgv) <sgv@odoo.com>
Signed-off-by: Hubert Van De Walle <huvw@odoo.com>
2023-08-28 20:14:44 +00:00
Tiffany Chang (tic) 2c54f58670 [FIX] stock_account: avoid changing property_val for any setting change
Previous PR: odoo/odoo#113973 assumed that if stock_accounting_automatic
setting was disabled, then the user deactivated the setting and it was
previously on => we should change all of the property_valuations to
'manual_periodic'. Unfortunately this missed the case where the
property_valuations were set to `real_time` without the setting being
active (i.e. upgraded db and the setting isn't activated or the
value is set directly via ssh or community module)

Additionally, it was causing an unnecessary search on product.category
every time a setting is changed. Therefore we now only change the
`property_valuation` if the setting was active and was changed to not
active.

OPW-3474598 for context

closes odoo/odoo#133254

X-original-commit: 96b17f9a19855a78a7b879299ea51eb5bde0acf8
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Tiffany Chang (tic) <tic@odoo.com>
2023-08-28 20:14:43 +00:00
Alexandre Kühn 1c7a4449c1 [REF] mail: remove custom useService() hooks in discuss
They existed solely for typedoc and wrapping `useState()`.
- Typedoc is managed by `useService()` and `services.d.ts`.
- `useState()` is a minimal code in component, and is actually
  more useful as explicitly visible in component.

closes odoo/odoo#133202

Related: odoo/enterprise#46327
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2023-08-28 20:14:40 +00:00
Alexandre Kühn 8c983c17f5 [REF] mail: remove unused discuss services in services/components
Part-of: odoo/odoo#133202
2023-08-28 20:14:40 +00:00