Commit Graph
151462 Commits
Author SHA1 Message Date
Sébastien Theys ffcd256d50 [IMP] mail: move _makeChatterContainerTarget code into caller
Now that the method no longer requires an override in enterprise, it doesn't
need to exist as a separate method.

Part of task-2871070

Part-of: odoo/odoo#94188
2022-06-21 19:03:21 +02:00
Sébastien Theys 22293929c0 [IMP] mail: move _updateChatterContainerTarget in community
This allows reducing the complexity of overrides in enterprise.

Part of task-2871070

Part-of: odoo/odoo#94188
2022-06-21 19:03:21 +02:00
Jeremy Kersten a9b2ac0f06 [FIX] http_routing: add missing space in qweb template
Since last refactoring of qweb to replace postprocessing cleaning by
onEval cleaning, the space between xml node are now ignored.

It's not a bug, but a tradeoff of the new implementation to avoid empty
line with code like
```xml
    <t t-if="condition">
        <div>...</div>
    </t>
```

closes odoo/odoo#94170

X-original-commit: 18ae4d804064dab284dadf53eed0681b8c56a555
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2022-06-21 17:58:10 +02:00
Huy Le 414d4f98a1 [FIX] website: og:url should be localized
Before this commit, with a website using multiple languages, when sharing
any links with a language other than the original language on Facebook,
the content of Optimize SEO always receives the value of the default
language.

The reason is that `og:url` does not change according to the
language of the website because it's using `http.httprequest.url`.

Note that `http.httprequest.url` doesn't contain the lang part since we
already went through the dispatch's rerouting.
So we need to localize `og:url` to fix this.

Steps to reproduce:
1. Set up 2 different languages for your website (e.g. English, Vietnamese).
 Set the default language for the website to English.
2. Create any page, promote seo page for both languages.
3. Share this link on Facebook with Vietnamese language, see the title
and description on preview are still in English.

closes odoo/odoo#93998

X-original-commit: d47a2e4d08110df380c0060eebb1e9c2924b523e
Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2022-06-21 17:58:07 +02:00
Demesmaeker 25cb1542b9 [FIX] test_sale_product_configurators: error in matrix tour
Following the steps that changed every quantity in a matrix, the next
step was triggered after at least one sale order line's quantity was
changed. Due to the number of lines created, one of the so lines was
sometimes not updated before the next step, which produces an error in
the final sale_count.

In order to check the total and ensure every line was updated, we set
the partner sooner in the tour, which in turn sets the pricelist used to
get the price of each line. Thus allowing a check on the subtotal.

task-2886524

closes odoo/odoo#93892

Signed-off-by: Morgane Demesmaeker <edm@odoo.com>
2022-06-21 17:58:01 +02:00
Yannick Tivisse 86e7c7d8a6 [IMP] hr_recruitment: Scan CV on application forms
Purpose
=======

This commit add an option on the configuration to install the enterprise
module to scan and import CV information on the application form.

closes odoo/odoo#92019

Related: odoo/enterprise#26687
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-06-21 17:57:58 +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
Hardik Prajapati c5fa2e7e29 [IMP] project: improve user experience
This commit brings some user experience improvement:
- Add a line break between the content of the email and the
  'this customer survey has been sent...' indication in mail template
- Move the project_ids field out of the debug mode

task-2792027

closes odoo/odoo#92048

Related: odoo/upgrade#3579
Related: odoo/enterprise#27655
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-21 16:51:54 +02:00
Jeremy Kersten af8b192327 [FIX] website: fix twitter image format and use it
Twitter image was wrongly computed, appending /300x300 after the unique
parameters.

Twitter image was always overwrite by `website_meta_og_img` or
`opengraph_meta['og:image']`

closes odoo/odoo#94158

X-original-commit: 086724929bd8d21537b626a79d12f8739933f5a5
Signed-off-by: Jérémy Kersten <jke@odoo.com>
2022-06-21 15:41:53 +02:00
Thanh Dodeur 259cb3a9bd [REF] mail: cleanup the CallView template
part of task-2692836

closes odoo/odoo#94035

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-21 15:41:50 +02:00
Thanh Dodeur 8805558f0b [IMP] mail: reposition the CallActionList of the CallView
This commit moves the `CallActionList` of the `CallView` so that it sits
below the main card view but not below the sideBar.

part of task-2692836

Part-of: odoo/odoo#94035
2022-06-21 15:41:50 +02:00
Thanh Dodeur 12326de30f [REF] mail: create CallSidebarView component and model
Move the sideBar part of the `CallView` to its new model and component.

part of task-2692836

Part-of: odoo/odoo#94035
2022-06-21 15:41:49 +02:00
Sébastien Theys 19f48283d2 [IMP] mail: reorder methods in form renderer override
Overridden methods from Form view are separated from custom mail methods, and
are sorted according to their call in the lifecycle.

This will make it easier to understand the file, in preparation to clean it
further.

Part of task-2871070

closes odoo/odoo#94140

Related: odoo/enterprise#28655
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-21 14:33:37 +02:00
Rémy Voet (ryv) d2cb61dd84 [IMP] core: use faster count(*) instead of count(1)
Some article supports that count(*) is more efficient than count(1):
- https://blog.jooq.org/whats-faster-count-or-count1/
- https://www.citusdata.com/blog/2016/10/12/count-performance/ (sub menu Exact Counts)

In my own test (https://github.com/ryv-odoo/odoo_scripts/blob/master/test_count.py):
indeed, we can see a small performance gain with `count(*)` (between 2%
to 4% depending the number of row).  This isn't a big improvement but the
change is small and is now more consistent with the documentation of
postgresql (https://www.postgresql.org/docs/14/functions-aggregate.html).

closes odoo/odoo#94069

Signed-off-by: Raphael Collet <rco@odoo.com>
2022-06-21 14:33:32 +02:00
bat-odoo 4f6b9ab9d5 [IMP] l10n_in: update l10n_in_code in UOM
Purpose
=======
The Indian government updated its UOM code
https://einvoice1.gst.gov.in/Others/MasterCodes (select UQC Codes)

So In this commit, I have updated `l10n_in_code` in UOM Millimeter, Square Meter,
Litre, Cubic Meter, Yard, Square Foot, Cubic Inch and Cubic Foot.

closes odoo/odoo#93805

X-original-commit: 936bdc30c2837cfc79d1c8fce5c6cead16bb6020
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2022-06-21 14:33:29 +02:00
Dossogne Bertrand 6cf977b078 [IMP] hr_contract: avoid screen shaking
On a contract view, if you hover the warning of a calendar mismatch,
the appearing warning text may lengthen the page, adding a scrollbar and
modifying the overhaul layout of the page on the chrome browser.
This commit keeps the text visible anyway so that no changes can cause
that screenshake.

Visual of the error:
https://watch.screencastify.com/v/MGPnCksg2eW49b7CoZc5

taskID 2878189

closes odoo/odoo#94142

X-original-commit: ddb4d6e463cbd410d59685effb189d654c581994
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-21 13:22:50 +02:00
Victor Feyens b6e2637fb1 [REF] sale: simplify price computation logic
* Make sure discount is correctly computed, while considering the
  attributes extra prices in the computation
* use available pricelist methods to compute base price
  (remove duplicated code)
* use the correct pricelist method to get only the needed rule wherever
  the price is not needed.
* reduce parameters exchange between SOL methods, use SOL fields
  instead when needed
* do not try to compute discount when no pricelist rule was found,
  there is no discount anyway
* Add docstrings, comments and use 'clear' methods name to ease
  the understanding of the logic.

closes odoo/odoo#88230

Related: odoo/enterprise#28552
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
2022-06-21 13:22:38 +02:00
Vincent Larcin 55d8da526d [IMP] project: adjust portal visibility followers behavior
Currently, portal followers of a project and its tasks are removed when
the project visibility is changed to something else than portal.
=> We want to keep the behavior, but only when changing the visibility
from portal to something else.

When the project visibility is changed to portal, we currently add
its customer to its followers.
=> In that case, we also want to add the customer of the tasks to the
followers of the corresponding task.

When the customer of a project in portal visibility is changed, the
new customer is added to the followers of the project.
=> We want to remove this behavior.

When a project is created with a customer and the portal visibility,
the customer is added to the followers of the project.
=> We want to remove this behavior to avoid mistakenly showing a project
that is not ready yet to the customer.

This commit implements those changes, and also adds a warning when
changing the visibility of the project if that change will automatically
add/remove followers to the project and its tasks.

Related: https://github.com/odoo/enterprise/pull/25800

Task-2812551

closes odoo/odoo#87747

Related: odoo/enterprise#25800
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-21 13:22:32 +02:00
Barad Mahendra b5f8f2133b [IMP] project: unarchive tasks when unarchiving stages
Currently, all of the tasks contained in a stage are archived
when the stage is archived. However, the tasks remained archived
when the stage is unarchived.

So in this commit, If the user unarchives a stage, ask the user to
unarchive the tasks it contains in the process.

task-2835624

closes odoo/odoo#94008

Related: odoo/enterprise#28301
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-21 12:20:53 +02:00
Simon Genin (ges) c81c1ac6b1 [FIX] web: tooling -> cp -r doesn't copy symlink on macOS
closes odoo/odoo#94124

Signed-off-by: Samuel Degueldre <sad@odoo.com>
2022-06-21 11:20:26 +02:00
tsm-odoo b575fa53a7 [FIX] web, *: fix scroll tests
*: mail, point_of_sale, test_mail_full.

The alt of images can be displayed slightly after the programatic
scroll which means the scroll height we set and the one we assert
are slightly different (the client height have changed). In order
to solve this issue, all alt attributes are replaed by data-alt
during tests. The src attribute is removed as well to make sure
images won't trigger a GET request on the server.

closes odoo/odoo#94092

X-original-commit: 0446923db6b7376ee2c27e3f6e94b5f8e43a14fb
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Signed-off-by: Stockbauer Matthieu (tsm) <tsm@odoo.com>
2022-06-21 11:20:20 +02:00
Tommy (tong) fb43199c8b [FIX] base_import_module: fix imported static files cannot be replaced
Issue:

 Imported module is not able to search existing static files to replace them

Cause:

 After changing the new loc calculation, ir.attachment will link to the
 ir.model.data. However, those attachments will not able to search anymore
 without sudo. Therefore, the system will try to create the attachment again.
 It will return error because constraint "ir_model_data_module_name_uniq_index"
 will prevent ir.model.data to create again.

Solution:

 Use sudo to search the attachment.

closes odoo/odoo#93752

X-original-commit: 8f604847eb1ec96955ee724ad7b882c74160b9d7
Signed-off-by: Vincent Schippefilt (vsc) <vsc@odoo.com>
2022-06-21 11:20:17 +02:00
Rob Coekaerts a2ba3739b8 [IMP] hr_expense: disable quick creation of taxes
Disable the (quick) creation of taxes in places where
it is likely to result in faulty data entry. This forces
the user to fill in new tax records consciously.

task-2860025

closes odoo/odoo#93319

Signed-off-by: Kevin Baptiste <kba@odoo.com>
2022-06-21 11:20:13 +02:00
sofiagvaladze f938dc397d [FIX] board: filter records according to selected companies
Before, when we added view to the dashboard, context was saved too,
including allowed_company_ids. As a result when we checked the same view
from the dashboard, the displayed records corresponded to the active companies
during the time the view was saved and not the current ones - the companies
that are currently ticked from the multi-company widget.

After the fix, the displayed records in dashboard, correspond to the currently active companies.

task - 2809597

closes odoo/odoo#94105

X-original-commit: 9f854262a197782793d329487792a09a101a1a38
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2022-06-21 10:17:41 +02:00
Joseph Caburnay 055dbc25a4 [IMP] point_of_sale,pos_restaurant: use company's barcode nomenclature
This change removes the `barcode_nomenclature_id` in the `pos.config`.
Each pos session now starts based on the company's barcode nomenclature.

closes odoo/odoo#93072

Task-id: 2849415
Related: odoo/upgrade#3575
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2022-06-21 09:17:50 +02:00
mafo-odoo 652d235c8d [FIX] hr_timesheet : allow project managers to handle timesheets
Steps to reproduce:
- Install project and timesheet
- Create a project with settings "invited employees only"
- Create a user with administrator project right (and non admin
rights for timesheet)
- Create a task in the new project
- Try to generate a timesheet on the task with the new user (the
user has to not follow the task)

Current behavior:
This generate an access error due to not respecting some rules

Expected behavior:
The timesheet is created

Explanation:
The project admin should be able to handle any timesheet that is
linked to a project to do so we add its groupto the rule that gives
access to the model analytic.model_account_analytic_line if there
is a project_id.

opw-2861042

closes odoo/odoo#94102

X-original-commit: 70a0ad280e0c8a62f24d6943be082298fa98e443
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-20 20:45:29 +02:00
Rémi Rahir a4c843784b [FIX] hr_skills_slides: Fix completion step
This commit addresses several issues:

1. The overwrite of `_recompute_completion` was not properly filtering
the partners that had actually completed the course. meaning that
passing through this function could add a course/slide.channel as an
employee skill iven if they did not complete it. Now, we only act upon
employees that have actually finished the course.

2. The function would add the same skill over and over again, assuming
that we could only pass through it once but it is actually called every
time we publish or archive any slide of a course since 9920f20e.
This can lead to a bit of bloat on an employee resume  (See task
attachments). Now, we try to make the function idempotent and only add a
resumé line only once.

3. The addition of a resume line could not be achieved and would raise
an ACL when the current user was not an HR Officer (group `hr_user`).
Since it can be called by any eLearning(`slides`) manager, a sudo
privilege is necessary.

Related Task: 2830016

closes odoo/odoo#94095

X-original-commit: 385884afd31f25d61e99d139ecd4c574d99a1863
Signed-off-by: Kevin Baptiste <kba@odoo.com>
Signed-off-by: Rémi Rahir (rar) <rar@odoo.com>
2022-06-20 20:45:24 +02:00
Alexandre Kühn da8e5f2489 [IMP] im_livechat, *: Refactor JS Public Livechat (step 2)
*: website_livechat

This commit is a step towards refactoring the JS of public livechat,
so that it reuses the same architecture as the code of Discuss.
This implies code that uses JS models and OWL components.

Task-2888734

closes odoo/odoo#94090

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-20 19:48:54 +02:00
Sébastien Theys 3332bff665 [IMP] mail: clean up main attachment js model
Part of task-2886642

closes odoo/odoo#93895

Related: odoo/enterprise#28532
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-20 18:56:19 +02:00
Sébastien Theys a6d6a71fdf [IMP] mail: only send thread to chatter rendered
As a first step clean up, attachments can be read directly from thread instead.

Part of task-2886642

Part-of: odoo/odoo#93895
2022-06-20 18:56:18 +02:00
Sébastien Theys 0c30945d36 [IMP] mail, *: clean up attachment format and isolate legacy calls
* = im_livechat, portal, portal_rating, test_mail

Part of task-2886642

Part-of: odoo/odoo#93895
2022-06-20 18:56:18 +02:00
Ricardo Gomes Rodrigues (rigr) c4bfaf3336 [IMP] base,l10n_be: move the company_registry from res_company to res_partner
This commit:
- moves the "Company Registry Number" from `res_company` to `res_partner` (which might be different from the VAT in some localizations). This must be unique among all partners of the same country.
- allows the search of partner by using their "VAT" or their "Company Registry Number"

Task-id: 2857253

Community PR: odoo#91938
Enterprise PR: odoo/enterprise#27605
Upgrade PR: odoo/upgrade#3570

closes odoo/odoo#91938

Signed-off-by: Quentin De Paoli <qdp@odoo.com>
2022-06-20 18:56:10 +02:00
Ricardo Gomes Rodrigues (rigr) 17d44d6617 [IMP] account{,fleet,lock}: add quick invoice encoding
This commit:
- adds a fiduciary mode which allows fast encoding of invoices. This is an Accounting setting which must be activated. This fiduciary mode allows one to edit directly the invoice sequence and enter the total amount of the invoice (by creating a single line which contains the base price, the tax amount, and the most frequent account) such that we match this 'quick total amount'.
- adds a new test for this feature
- adds a 'quick edit total amount' in the tax computation which verifies that the 'quick edit total amount' correctly matches sum of the base and the tax (in case of fiduciary mode)
- sorts and filters the accounts suggestions in an invoice line. The most frequent accounts for a particular partner rank higher while filtering on the type of account suggested (this is disabled if the user searches itself for the account)
- selects by default the most frequent account for a particular partner when creating a new invoice line
- adds the option to hide some columns (label & quantity)
- moves the car column after the account column in case the Fleet app is installed

Task-id: 2857253

Community PR: odoo#91938
Enterprise PR: odoo/enterprise#27605

Part-of: odoo/odoo#91938
2022-06-20 18:56:09 +02:00
Audric Onockx (auon) f07439fbc8 [FIX] mail: display follower subtypes order by sequence
Before this fix, follower subtypes were displayed by order of id,
whereas in DiscussController.read_subscription_data(),
it was ordered by :
\- parent_mode
\- res_mode
\- internal
\- sequence

See : https://github.com/odoo/odoo/blob/fc115ebdf7c3783f9eaabba71eccce23c676d957/addons/mail/controllers/discuss.py#L471-472
In this commit, we just reproduce the same order.

Also, for `parentModel` and `resModel`, we want the record
with their values unset to come first.
We added 'undefined-first',
as this sort order might be needed for other models.

closes odoo/odoo#93315

Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
2022-06-20 17:57:38 +02:00
Sébastien Theys ba59359420 [IMP] mail: make sort methods more reliable with unexpected types
Part-of: odoo/odoo#93315
2022-06-20 17:57:38 +02:00
Louis Baudoux 74bb7b1dc0 [IMP] account: change occurrences of "digitaliz*" to "digitiz*"
The correct word for the extraction of data from a document is
digitization, not digitalization.

See feedback #2862606.

closes odoo/odoo#92569

Related: odoo/enterprise#27912
Signed-off-by: Florian Daloze (fda) <fda@odoo.com>
2022-06-20 17:57:26 +02:00
Pierre-Yves Dufays 8b410860f9 [FIX] website_event_track: fixes the condition of event start warning
The condition to display the start event warning in the track view was that
the event was not ongoing. This fix adds the condition that the event is
upcoming, preventing the warning to be displayed after the event date.

Task-2692907

closes odoo/odoo#94066

X-original-commit: 17a46270dd826172e072ada1da9911c062a827fb
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
2022-06-20 16:51:20 +02:00
Odoo's Mergebot 01d4e4ab20 [FW][MERGE] sales, sales_team: set lead team when creating quotation
Steps to reproduce:
-Install sales and crm
-Apply multiteam option in crm settings
-Create a user with two teams A and B
-Create with this user a lead with team B
-From this lead create a quotation

Current behavior:
The quotation could have team A (the team of the lead is ignored)

Expected behavior:
The quotation always has team B

Problem when creating the quotation the team id is not propagated
in the context to the final function _get_default_team_id and in
this function the default context team is only check if no teams
have been found for the user, so the function always selects the
first team of the user. To solve the issue we propagate the team
id to the default function and we change it so that if the context
default team is in the user teams it is this one that is going to
be selected and no other.

Small behavior change:
Two cases are added in the _get_default_team_id function that slightly change
the current behavior. For the two first cases instead of just choosing any team in
the list we add a case so that IF there is a default team in the context AND that this
team is in the list then its going to be this one that's gonna be selected. See function
comments:
         1- any of my teams (member OR responsible) matching domain
          2- any of my teams (member OR responsible)
becomes
          1- default from context if in my teams (member OR responsible) matching domain
          2- any of my teams (member OR responsible) matching domain
          3- default from context if in any of my teams (member OR responsible)
          4- any of my teams (member OR responsible)

opw-2830913
Task-2852947

closes odoo/odoo#94045

Forward-port-of: odoo/odoo#93896
Forward-port-of: odoo/odoo#90289
Signed-off-by: Fockedey Martin (mafo) <mafo@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2022-06-20 16:51:16 +02:00
mafo-odoo 6a0ab5f3c6 [FIX] sale,sales_team: set lead team when creating quotation
Steps to reproduce:
-Install sales and crm
-Apply multiteam option in crm settings
-Create a user with two teams A and B
-Create with this user a lead with team B
-From this lead create a quotation

Current behavior:
The quotation could have team A (the team of the lead is ignored)

Expected behavior:
The quotation always has team B

Problem when creating the quotation the team id is not propagated
in the context to the final function _get_default_team_id and in
this function the default context team is only check if no teams
have been found for the user, so the function always selects the
first team of the user. To solve the issue we propagate the team
id to the default function and we change it so that if the context
default team is in the user teams it is this one that is going to
be selected and no other.

opw-2830913

X-original-commit: 0b6c63f2be90928f5d6806ef489c369a1310be04
Part-of: odoo/odoo#94045
2022-06-20 16:51:15 +02:00
mafo-odoo ac6957700a [FIX] sales_team: better support default_team_id
Purpose of this commit is to better support default_team_id in context when
computing default team. Indeed currently default key is ignored if the user
is member or responsible of any team. It is used only when no membership
exists as a fallback.

However when giving a default_team_id in a default-like method we think we
should better try to match this value. When having memberships the final
team is the default one if present in the subset of teams. Instead of
taking the first found one in the teams set (filtered on a domain or not)
we first check for the default team presence, then fallback on the ordering
based on sequence.

Task-2852947
opw-2830913

X-original-commit: fb060c86daf0c1d737abc9228002cdfa280e1d2c
Part-of: odoo/odoo#94045
2022-06-20 16:51:14 +02:00
Thibault Delavallée deb66c90d8 [FIX] sales_team: ensure determinism when finding sales team
Current sales team ordering is based on sequence. However several sales teams
with same sequence may exist. This leads to a not deterministic behavior as
we are unsure how database will choose the ordering.

This is fixed with this commit: when having teams with same sequence we take
the newest one first.

Task-2852947

X-original-commit: 34da99f6bec92553febfae7bc9c80ccebb38f70f
Part-of: odoo/odoo#94045
2022-06-20 16:51:14 +02:00
Thibault Delavallée 741a7e376e [IMP] sales_team: improve default team fetch tests
Purpose of this commit is to improve a bit tests about default team computation.
Coverage is improved, notably about default context value usage that is about
to be updated.

Task-2852947

X-original-commit: 8e18a27352d2fd9e68cd2b54e49dfca6fb658eaa
Part-of: odoo/odoo#94045
2022-06-20 16:51:13 +02:00
Rahul Prajapati 71a68c5923 [IMP] *: remove support for empty create with pyenv
* hr, im_livechat, mail, sms, snailmail, test_mail_full, website_livechat,
  website_slides

PURPOSE:

Creating a record with no values has no sense but is sometimes useful during
tests.
The support should be dropped for `default` parameter in `create`.

SPECIFICATION:

All the occurrences of `create()` have been replaced by `create({})`.

Task-2869394

closes odoo/odoo#93917

Related: odoo/enterprise#28538
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
2022-06-20 15:31:51 +02:00
Touati Djamel (otd) c7ba64ebbf [FIX] stock: allow “apply all” with grouped list
Steps to reproduce the bug:
- Go to inventory > reporting > inventory report
- Add any “group by”, for example: ‘product’
- Click on the “Apply All”  button

Problem:
A Missing record error is triggered.

When we click on the button, the `active_ids` key is added in the
context, but it does not represent the ids of the `stock.quant`
but rather the ids of the grouped records, "product" in our case:
https://github.com/odoo/odoo/blob/bec3c58df303df6ac508bdfbb9b317d5019b858a/addons/stock/static/src/js/inventory_singleton_list_controller.js#L127

Then, They are added in the context of the wizard with the key:
`default_quant_ids`: https://github.com/odoo/odoo/blob/262b49d85a95bc445e954741224305ebaa7f545b/addons/stock/wizard/stock_inventory_adjustment_name.xml#L27-L28

So when we get the `stock.quant` records, we do a search with the ids
of the products instead of the `stock.quant`
https://github.com/odoo/odoo/blob/8f12dbc00fdc96732fd2ec9104ed6bf057327ef4/addons/stock/wizard/stock_inventory_adjustment_name.py#L14

Therefore, if there is no `stock.quant` with the same id
as the products, an error will be thrown

opw-2879590

closes odoo/odoo#93870

X-original-commit: 8ec3d1484ddcb1dbca14df850dfe1490309c461e
Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
Signed-off-by: Djamel Touati (otd) <otd@odoo.com>
2022-06-20 15:31:43 +02:00
momegahed 28caa8fccc [FIX] sale_project_account: Analytic account is overridden
Steps to reproduce:

1- install sales ,accounting, project, timesheets
2- create a new service product p1 that triggers a project and a task
3- create a new sales order so with p1 and validate 1 hour in the task
4- create an invoice from so, an anayltic account is added
5- edit any field of product_id, account_id, partner_id, date
6- the analytic default rule is applied (in this case none) so the
anayltic account is removed

Bug:

the `compute_analytic_account_id` method forces the analytic default
rule even if the field is already set before the changes

Fix:
apply analytic default rule only if the analytic acount is not set and
if it is not a project generated move

OPW-2833912

closes odoo/odoo#94034

X-original-commit: 7f69d623265a53be854eca474876bde2a0b14df6
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-20 13:26:56 +02:00
Arnaud Joset f57ca6f07d [FIX] sale: adds id in portal template to ease overriding
Before this commit, some element did not had id in the portal sale order
template. This commit intruduces them to allow easy override.

closes odoo/odoo#93859

Taskid: 2855699
X-original-commit: e829e4353574a1226163ba22b02d3080a8f75c69
Related: odoo/enterprise#28509
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Signed-off-by: Arnaud Joset <arj@odoo.com>
2022-06-20 12:16:16 +02:00
Arnaud Joset d5a7d156d6 [FIX] sale_management: allow to edit quotation template in sale view
Before this commit, it was not possible to open the template for the so.

Taskid: 2855699
X-original-commit: 9ddb0fa53639205cffaaa81cecbb376071f7787a
Part-of: odoo/odoo#93859
2022-06-20 12:16:15 +02:00
Adesh Jolhe (adjo) 8f192a9b57 [IMP] project(_sms),hr_timesheet: generic improvements for project
Purpose of this PR to improve generic UI of project app.

So, in this PR done following changes:
  - Added group by assigned to under reporting -> customer ratings
  - In quick search, changed "rated rated" operator to "assigned to" under
    project.project search view
  - Removed rating_status field from project > configuration > settings > customer
    ratings
  - Switched the 'timesheets' and 'planning' features from place from
    project > configuration > settings
  - In project.task  extra info notebook:
     - Added the 'parent task' field above the 'analytic account' field
     - Added the 'company' field above the 'sequence' field
  - Added send mail and sms action in project.project and project.task
    list view.

task-2806292

closes odoo/odoo#88446

Related: odoo/upgrade#3459
Related: odoo/enterprise#26207
Signed-off-by: Laurent Stukkens (ltu) <ltu@odoo.com>
2022-06-20 12:16:04 +02:00
Tiffany Chang (tic) f533e40f0e [IMP] purchase_requisition{_stock}: add new alternative POs option
Previously the "call to tender" flow involved creating a
`purchase.requisition` record, creating each RFQ via that record, and
then manually going through each RFQ to compare the prices/dates/etc.
By linking the "call to tender" POs within the POs, we remove an
unnecessary `purchase.requestion` record and makes it easier to track
which RFQs are related to each other as an Alternative RFQ.

On top of this, we add some comparision features to make it easier to
determine the best RFQ, specificially the ability to compare PO lines in
the same view with some visual aids (best price/date colored green +
buttons to check these lines to make them easier to view). We also add
an extra feature to set the qty of selected/non-chosen PO lines to 0 to
aid in the RFQ selection process (only applies to non-confirmed/done/
cancelled POs).

Some other features included with this:
- option to cancel alternative POs when confirming one, which purposely
  does not cancel ones that have already been confirmed/completed.
- new wizard for creating alternative POs so user can select whether or
  not they want to copy the products/qtys from the original PO.

Important Notes:
- JS Customizations:
  - custom many2many widget added so user:
    - can click between alternative POs in same window + keep breadcrumb.
      This is because all alt POs are interconnected and long breadcrumb
      chain is possible (+ we want to avoid windows within windows.) It
      is expected that user will be aware that unsaved changes will
      auto-save when alt PO is clicked on.
    - cannot unlink a PO from itself (this is automagically done during
      the write) since this will remove all of its linked POs and might
      confuse users.
  - custom view js for Comparing Order Lines to help highlight best
    options, including ensuring that the best options are still
    highlighted after clicking on Choose/Clear buttons (since the best
    option can change afterwards, we recalc + update via RPC)
- General implementation warnings:
  - Anytime any button/alternative PO is clicked on within a PO, the
    form will auto-save. This is due to how the current action service
    handles changing views.
  - POs created via "Create Alternative" button purposely:
     - require a vendor to ensure correct lead times/prices
     - show all vendor/product warnings in wizard because we cannot
       reproduce the pop-up warning that would occur in the PO when
       they are selected. We also purposely block the PO creation when a
       blocking warning is set since we cannot remove the values
       (especially in the case of a blocking vendor message) from a
       newly created PO.
  - Technical purchase.order.group model created to help with difficult
    management of complicated behaviors:
     - unlink from self if a PO is no longer linked to any other POs
     - linkages must be symmetric (i.e. linkage PO1 => PO2 must
       reflect PO2 => PO1 in their form views)
     - don't lose existing linkages (i.e. PO1 => PO2 and PO2 => PO3
       should auto-link PO1 => PO3)
    These last two behaviors are difficult to do without grouping due to
    possibility of remove and adding linkages at the same time. To avoid
    complex code to ensure these complexities hold when when creating a
    new PO, linkaging to alternatives is not allowed when PO is not yet
    saved as a record.

Task: 2695116
Upgrade PR: odoo/upgrade#3586

closes odoo/odoo#87656

Signed-off-by: Arnold Moyaux (arm) <arm@odoo.com>
2022-06-20 12:15:59 +02:00
Tiffany Chang (tic) 863c5090f0 [REF] purchase{_various}: make onchange_quantity computed
Instead of having to repeatedly manually call `onchange_quantity` at
different points in the code, it is better to have it be computed
instead.
- Logic is left unchanged,
- onchange calls from other methods are removed, and
- tests are adjusted to properly handle compute. I.e. remove
'date_planned': datetime.today().strftime(DEFAULT_SERVER_DATETIME_FORMAT)
  from when PO lines are created since this sometimes resulted in
  inconsistent date_planned values for PO line and the PO date_order
  (by 1 sec), which could lead to inconsistently created 'date_deadline'
  values for stock_moves' created by PO line qty changes. Issue
  previously didn't exist because onchange was not always called.

Part of Task: 2695116 (to avoid adding more onchange calls for new
feature)

Part-of: odoo/odoo#87656
2022-06-20 12:15:59 +02:00