Commit Graph
136120 Commits
Author SHA1 Message Date
Rémy Voet (ryv) 82ca6b92c8 [IMP] stock_barcode_picking_batch: improve barcode usuability
Add the name in a barcode form into the printed
batch transfer to use the enterprise feature. The
barcode is now in the printed batch transfer and
there is a new print action in the batch transfer model.

task-2196687
2020-05-25 08:48:15 +00:00
Rémy Voet (ryv) 54cbedeaf7 [IMP] mrp: convert note field of operation into text work instruction.
The field note of mrp.routing.workcenter was not very usefull, and not
appear in the workorder related to this operation. Sometime, we need to
have a small description of the work to do for a opeartion in the WO,
instead of a complet pdf or google slide.
-> Convert the note field as a description of the job to do and add a
"text" worksheet_type to select it, in the mrp.routing.workcenter and
add the related field in the WO. Update the view of accordingly.
-> (migration): The 'note' content remain the same, then migration is
not needed. If the user change the worksheet_type into text, the
"note" will be the previous "description".

task-2196687
2020-05-25 08:48:11 +00:00
Rémy Voet (ryv) 4890a9fdab [IMP] stock,mrp(_account): do small usuability change
- Rename "Master Data" menu into "Products" in both stock and mrp.
And move not producte reclated menu to configuration menu.
- In the stock setting move all shipping connector in a dedicated
section.
- Improve helper of MO
- Merge filter "Late" and Planning Issue
- Remove badge of duration field in WO.

task-2196687
2020-05-25 08:47:23 +00:00
qsm-odoo e3693c4b9c [REM] theme_bootswatch: remove the theme entirely
Since 12.0, the theme was still supported but did not receive any of the
new features, like choosing its own colors.

This commit removes the theme entirely so that all users use the new
shiny features and also because it will become impossible to support
with the new color system.

task-2207192

closes odoo/odoo#51508

Related: odoo/design-themes#279
Related: odoo/upgrade#1225
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-05-27 17:05:29 +00:00
Nasreddin (bon) 2de51f899f [FIX] mrp: duplicate bom lines in mobile
Issue

	Step to do on mobile or chrome debugger in mobile mode
	- Install "Manufacturing" app
	- Go to "Manufacturing"
	- Click on "Create"
	- Select a product with already default bom lines
	- Alter quantity

	BOM lines are duplicated.

Cause

	Missing "bom_line_id" field in kanban view,
	who is required for onchange "_onchange_move_raw".

Solution

	Create inherited kanban view with "bom_line_id" in
	mrp module.

opw-2257732

closes odoo/odoo#52002

X-original-commit: 2905d05fc3d30562c5e7510217a6e97e26e87a37
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-05-27 14:28:27 +00:00
Yannick Tivisse f1e2fde734 [IMP] hr: Improve settings layout
closes odoo/odoo#51334

Taskid: 2241726
Related: odoo/upgrade#1202
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-05-26 07:13:59 +00:00
Odoo's Mergebot 41bf013e04 [MERGE] base: make ir.property private
Only system users can access ir.property records.

This PR is part of the long-term task id 8203 that plans to remove all access to
 ir.* models

"Official" methods to interact with `ir.property`:
- `_set_default(name, model, value, company=False)`
- `_set_multi(name, model, values, default_value=None)`
- `_get(name, model, res_id=False)`
- `_get_multi(name, model, ids)`

Done in this PR:
- remove ACL on ir.property (only system users can access directly)
- make all getter/setters private with sudo
- use these methods everywhere instead of CRUD calls
- add sudo where needed

closes odoo/odoo#51658

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2020-05-28 07:13:56 +02:00
Denis Ledoux 7b8d12e6dc "[REVERT] website_theme_install: do not mark theme views as arch_updated when loaded from data files"
This reverts commit fdd4a143f2148ec5f4aeea80fecd3138fea95dc6.

See discussion in #51969

closes odoo/odoo#52028

X-original-commit: 0e602cc0ac295621864b50509f78bd5de1e61718
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2020-05-27 19:59:30 +00:00
Anh Thao Pham (pta) aca52baee3 [FIX] web_editor: fix focus for some tools in Summernote
- Go to Project
- Open a project to display Tasks
- Switch to list view
- Click on create button
- On task form page, click nowhere. (It is important to not click on anything)
- On the taskbar of the WYSIWYG editor used for Description, click on one of the following actions:
    * Unordered list
    * Ordered list
    * Checklist
    * Table
    * Style
- The action will be applied to the "name" field (Task Title) and
  an error will prompt for Unordered list, Ordered list and Checklist actions
- If not, discard the form and retry by opening the form with create button

In this case, the WYSIWYG editor does not have the focus and try to execute
the tool action on the current focused element.

opw-2256835

closes odoo/odoo#52023

X-original-commit: eaa55ce3e806ad0d9609394309ff9d48b32bb73f
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-05-27 18:13:00 +00:00
Nicolas Lempereur 9d40ec7d15 [FIX] web: resquencing stop at first controller
When a resequencing is done inside an object hierarchy of two
controllers, since 9b90d8727d we would call resquencing code one time
per controller.

So if for example we are in a list view inside a form view (eg. a
"Search More" modal in a form view) the resequencing would work for the
list view, but then cause traceback when it is handled by form view.

With this changeset, the first controller that get the event
`resequence_records` even gobbles it up.

Without change, added test fails because of original traceback:

  Cannot read property 'res_id' of undefined@ 202 ms
  Source:
   TypeError: Cannot read property 'res_id' of undefined
    at /web/static/src/js/views/basic/basic_controller.js:744:67
   ...

opw-2256818
closes #51827

closes odoo/odoo#52018

X-original-commit: eef4b99fdb9469c040af80d055933eda367b7b3d
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
2020-05-27 16:56:19 +00:00
SEINLET Nicolas ba20e42cc3 [FIX] sale_timesheet: ensure proper view inheritance
inherit the view which contains the items you're relying on.

closes odoo/odoo#52017

X-original-commit: 03dacc25ef46718a00fa7a1e0440813132600bfe
Signed-off-by: Christophe Simonis <chs@odoo.com>
2020-05-27 16:32:17 +00:00
Yannick Tivisse edad9aacd6 [FIX] calendar: Fix traceback when calling change_attendee_status
Coming from the calendar refactoring at
https://github.com/odoo/odoo/commit/39aef65f37a8ae969527b31a680eb27fddbc5710

closes odoo/odoo#52005

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-05-27 14:34:55 +00:00
qsm-odoo b76af0758e [FIX] website: remove footer top border
The footer of Odoo is composed of 3 main elements: a <footer/> with a
.oe_structure and the footer copyright inside. The footer had a
transparent top border which was there for technical reason: making sure
the .oe_structure content was "1px" below the end-of-page content so
that dropping a snippet at the end of page but also in the footer was
possible (otherwise the dropzones would be at the exact same position).

This border which was invisible at the time may now become visible in
more cases so we have to remove it. Another hacky solution is made to
replace the old one, while remembering the footer usability is being
reviewed anyway.

Related to task-2197038

closes odoo/odoo#51997

Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
2020-05-27 14:07:06 +00:00
Olivier Dony 9a0d951ccc [ADD] server: allow env variable to control HTTP socket timeout
As indicated in the comment, it's much preferred to perform response
buffering at the reverse proxy level than to increase the socket
timeout. It will free up HTTP workers for other requests faster, while
the proxy does the work of buffering the stream on disk as needed.

/!\ The timeout is also used to protect from accidental DoS effects
in situations of low worker availability, due to idle connections
caused e.g. by wkhtmltopdf's connection pooling.
Setting a high timeout will make the protection less effective, so
ensuring you have enough free HTTP workers at all times becomes critical.

In our tests with nginx's defaut buffering on a typical hardware with
SSD storage, buffering up to 1GB responses did not require any change
of the socket timeout on the Odoo side, though your mileage may vary.
See also nginx's `proxy_buffering` and `proxy_max_temp_file_size` config
directives.

OPW-2247730
See also: #20158

closes odoo/odoo#51982

X-original-commit: d78ea126b8d2a72ae626880b0ec64bb7a39a07ac
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2020-05-27 12:38:43 +00:00
Odoo's Mergebot c90a1ae353 [MERGE][IMP] mail_bot: improve OdooBot workflow
PURPOSE

This merge attempts to improve the workflow of the OdooBot onboarding
tutorial, as well as the answer given by the bot while idle.

SPECIFICATIONS

These changes come from watching how users interact with OdooBot. To
improve the user's experience, the following changes have been made:

1. Move the attachment to the end of the tour, as it is where most
   people just close the bot.
2. Remove the quotation marks around commands that OdooBot tells the
   user to type, like "/" or ":)", as some users try to actually type
   the quotation marks too. Instead, use a light grey background around
   the command that the user should type.
3. Some users ask OdooBot questions, but the responses they get are
   useless. To solve this, use a message linking to the documentation or the
   videos when:
    - The user gives wrong answers twice for the same stage of the tour
    - The user talks again when the tour is completed
    - There's a question mark in the answer

Other issues have been attended to:
1. The first message from OdooBot when starting the onboarding tour will now only appear as a notification instead of opening a new chat window. The user can open the chat window from the notification when they actually want to start the tour, as it can be otherwise distracting for the user to have the chat window pop up all of a sudden.
2. A bug has been corrected where OdooBot would open a new channel every time the admin user logged in, to remind them about changing the default password. Now, it will use an existing channel if it exists.

Task ID: 2233014
Upgrade PR odoo/upgrade#1251

closes odoo/odoo#49661

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-05-27 16:55:00 +02:00
Thibault Delavallée 2598061be8 [IMP] mail_bot: remove required on odoobot_state
Purpose is to avoid having strong requirements on fields where it is not
really necessary. In this commit we consider now that a void odoobot_state
is the same as ``not_initialized`` key. It allows to remove both the default
and required parameters on the field.

Task ID 2233014
PR #49661
2020-05-27 12:48:21 +00:00
dmonzonis 936d206559 [IMP] mail_bot: improve OdooBot workflow
This commit attempts to improve the workflow of the OdooBot onboarding
tutorial, as well as the answer given by the bot while idle.

These changes come from watching how users interact with OdooBot. To
improve the user's experience, the following changes have been made:

1. Move the attachment to the end of the tour, as it is where most
   people just close the bot.
2. Remove the quotation marks around commands that OdooBot tells the
   user to type, like "/" or ":)", as some users try to actually type
   the quotation marks too. Instead, use a light grey background around
   the command that the user should type.
3. Some users ask OdooBot questions, but the responses they get are
   useless. To solve this, use a message linking to the documentation or the
   videos when:
    - The user gives wrong answers twice for the same stage of the tour
    - The user talks again when the tour is completed
    - There's a question mark in the answer

To achieve this a "failed" state field is added on user model, allowing to
distinguish state in the bot workflow from state of answers (failed / not
failed).

Task ID: 2233014
PR #49661
2020-05-27 12:47:16 +00:00
dmonzonis 5b20117495 [FIX] mail: channel_get not finding channels correctly
The channel_get method from mail.channel was not retrieving existing
channels between partners correctly in some cases, which caused some
annoyances, like OdooBot creating a new channel/thread each time the
admin user logs in to remind them about changing the default password,
instead of using an existing conversation.

This was caused because because the SQL query was filtering the channels
by comparing the partner ids to the result of the ARRAY_AGG function,
which sometimes contains duplicates.

Task ID: 2233014
PR #49661
2020-05-27 12:47:16 +00:00
Michael Mattiello (mcm) b110bd4cbe [FIX] web: fix httpRequest GET + add in test_env
This commit fixes the method GET in httpRequest and
adds it in test_env.

Before this commit, the GET method crashed because
of the forced body param.

closes odoo/odoo#51980

X-original-commit: 7c4fba660a13c38048020faf595bd348d1bca225
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-05-27 12:26:05 +00:00
Michael Mattiello (mcm) cf90b56c3c [FIX] web: mount owl renderer once
Before this commit, owl renderers were mounted twice.
This commit makes owl renderers mounted just once as it should be

X-original-commit: 9234aa5c5c7de2f7af23071a3ff76adf93e9cee7
2020-05-27 12:26:04 +00:00
Goffin Simon bb4b07df3f [FIX] account: Payment matching with cash basis
Steps to reproduce the bug:

- Let's consider the current company CY in €
- Let's consider a cash basis tax T of 20%
- Let's consider that 1€ = 2$
- Create a customer invoice I on journal J in € for customer C
- Create a line on J with 100€ and set T on it
- Post I
- Create a payment P of 240$ for C on bank journal in €
- Confirm P and click on payment matching
- Try to reconcile P with I

Bug:

A traceback was raised.

Fine tuning of https://github.com/odoo/odoo/commit/0497c311e790454deb9ded2ed4fb206f5fd929ef

opw:2256207

closes odoo/odoo#51952

X-original-commit: 633fc71c14e8258d2a6cb2b8ee4bcc6b41a1124f
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-05-27 11:58:54 +00:00
Denis Ledoux 4fc0f2c042 [FIX] website_theme_install: do not mark theme views as arch_updated when loaded from data files
A view is marked as `arch_updated` if `arch` is being written on it
and `install_filename` is not in the context:
https://github.com/odoo/odoo/blob/7b1a6c00663239fbbab3d8ea5028e0825f4eb0dd/odoo/addons/base/models/ir_ui_view.py#L460-L461

When a view is being updated from a `theme.ir.ui.view` through `_update_records`
https://github.com/odoo/odoo/blob/7b1a6c00663239fbbab3d8ea5028e0825f4eb0dd/addons/website_theme_install/models/ir_module_module.py#L29
https://github.com/odoo/odoo/blob/7b1a6c00663239fbbab3d8ea5028e0825f4eb0dd/addons/website_theme_install/models/ir_module_module.py#L92
https://github.com/odoo/odoo/blob/7b1a6c00663239fbbab3d8ea5028e0825f4eb0dd/addons/website_theme_install/models/ir_module_module.py#L208
https://github.com/odoo/odoo/blob/7b1a6c00663239fbbab3d8ea5028e0825f4eb0dd/addons/website_theme_install/models/ir_module_module.py#L168

we can basically consider it comes from a data file,
the template is updated, and its copies as well if the copies are "unchanged"
and therefore the `arch_updated` should not be set to `True` in such as case,
as the goal of this flag is to mark the view as `arch_updated` if it was updated by the user,
not from a data file loading.

Because the views are marked as `arch_updated`,
in 13.0, when updating the theme view "templates" (`theme.ir.ui.view`),
the copies are not being updated even if they have been left untouched:
https://github.com/odoo/odoo/blob/23511dffb9e3f597a7df9bb834d008f74abb07b8/addons/website_theme_install/models/ir_module_module.py#L165-L166

This is really problematic for upgrades, as the "copies" (the themes views) are not updated
according to the latest changes in the xml files, even if the views have been left untouched by the user.

For instance, this change in the common theme:
odoo/design-themes@29da153784
is never updated in databases, resulting in the below traceback
```
ValueError: Element '<xpath expr="//div[@data-js='content']">' cannot be located in parent view

Fout context:
Weergave`s_badge_options`
[view_id: 2103, xml_id: n/b, model: n/b, parent_id: 901]

load could not load template
ValueError: Element '<xpath expr="//div[@data-js='content']">' cannot be located in parent view
```

opw-2255753

closes odoo/odoo#51969

X-original-commit: 614214a08b7e19605228c96fbdef1a60752ba575
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
2020-05-27 10:42:06 +00:00
Sébastien Mottet (oms) fd87ff4843 [IMP] mass_mailing(_sms): "Click" stat button now redirects to link trackers
PURPOSE

Clarify the use case in which a specified email address is set as replies may
not be traceable. Make the %Click KPIs visible for Emails as well. Allow users
to report on the links that have (or not) been clicked from their
mailing.

SPECIFICATIONS

Display list of link trackers linked to the mailing on 'click' stat button
click.

Task ID: 2202495
PR #48339

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-05-27 11:00:29 +00:00
Sébastien Mottet (oms) 60e4e9912a [IMP] mass_mailing: improve displayed info text and KPIs
PURPOSE

Clarify the use case in which a specified email address is set as replies may
not be traceable. Make the %Click KPIs visible for Emails as well. Allow users
to report on the links that have (or not) been clicked from their
mailing.

SPECIFICATIONS

Add an info text for the "specified email address" option in the "reply to"
field. If target model does not accept incoming emails warn the user it is
likely to fail.

Number of emails/sms sent is now display as clickable text instead of stat
button and clicked stat button is now also visible in mass_mailing.

Task ID: 2202495
PR #48339
2020-05-27 11:00:27 +00:00
Nicolas Martinelli 9d1c3de480 [FIX] account: incorrect forwardport
Previous fixes on invoice analysis report were incorrectly
forward-ported.

closes odoo/odoo#51961

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-05-27 09:27:45 +00:00
jerome hanke (jhk) 69c7303b71 [FIX] website_sale: default website team is set trough onchange
Steps to reproduce:
- Install eCommerce
- Check in website setting that the sales team is website
- Logout
- Without being logged, buy a product (all the cart flow, until the end)
- Once the flow is finished, connect with the admin
- Go to website > Orders > Unpaid Orders (since only wired is set when you create the db)
- Go to the tab "Other Info" of the SO you just created when buying the product

Previous behavior:
the sales team set in website settings is overriden during the
"/shop/address" endpoint

Current behavior:
the team set in website settings is used for sale orders coming from website

opw-2231654

closes odoo/odoo#51959

X-original-commit: 919077638bc9e8a5ad1c800b629aa0eaa079f571
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: mightyjol <jhk-odoo@users.noreply.github.com>
2020-05-27 09:25:16 +00:00
std-odoo 4e1399dc0d [IMP] web: customize the save/close button of a FormViewDialog
Purpose
=======
In Social, we want to be able to change the "Save" button into a "Add"
button when we add a new stream. For that purpose, we need to be able to
customize the text of the `FormViewDialog` buttons.

Task-2234580
See odoo/enterprise/pull/9933

closes odoo/odoo#49622

Related: odoo/enterprise#9933
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-05-27 08:56:35 +00:00
Goffin Simon 0d569c8117 [FIX] auth_signup: 403 when sending message on task with portal
Steps to reproduce the bug:

- Let's consider a product P (invocing policy based on timesheet and creating new task)
- Create a quotation with the product P
- Confirm it (A new task T is created)
- Go to T and add a follower (who is a portal user PU) in the task
  but uncheck the box to send him an email
- Connect to the portal with PU
- Go to T and send a message

Bug:

A 403 error was raised

opw:2239844

closes odoo/odoo#51953

X-original-commit: c7e864e039dd2c948a5c61df29052313c6a659ce
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2020-05-27 08:44:58 +00:00
yhu-odoo 181c7d82e3 [IMP] purchase: send reminder mail to vendor
1. automatically send a reminder mail to vendor to confirm the receipt
date. If confirmed, (confirmed by vendor) will be added next to the
receipt date. If not, vendor can update the date on the portal website.
An warning activity will be set for the purchase representative for this
update.

2. Vendor can also comfirm recieption of the PO when we 'send PO by mail'.
If confirm, (confirmed by vendor) will be added next to the confirmation
date. An filter is added in the PO search view to show all unconfirmed
PO.

Task 2230811
PR #49921

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-05-27 08:20:17 +00:00
yhu-odoo d83334ef8e [IMP] purchase_stock: add vendor on-time delivery rate
Add on-time delivery rate to vendor. When editing a PO, user can see
the overall on-time delivery rate during the last 365 days next to the
vendor. When click it, user will be redirect to a graph view showing
the detail of the on-time delivery rate of this vendor. Also add a stat
button to show the on-time delivery rate on partner form.

Task: 2230811
PR: #49921
2020-05-27 07:41:43 +00:00
yhu-odoo eb6ddb6e9f [FIX] purchase_stock: old PO not update qty_received after install purchase_stock
Before this commit, after install purchase_stock, old pol records won't
update their qty_received when receive products. This is because their
qty_received_method are not updated during the installation.

Task 2230811
PR #49921
2020-05-27 07:41:43 +00:00
Aurélien (avd) 647247e3ff [IMP] hr_recruitment: Improve global UX (back2basics)
Multiple small changes/fixes to the hr_recruitment module to provide
a better base for later improvements.

The linkedin recruitment source is only added by default to new records,
existing records remain unchanged.

For the google map in the email template, since it requires an API_Key and
only a minority of companies will get this key, it was decided that
it is better to remove it from the template.

Now that linkedin is added to job positions by default, deleting a
job position currently does not delete the related linkedin source.
So after removing 10 job positions, there are still 10 linked in
source in the database. This commit fixes that.

Add three additionnal utm_sources.

Add linkedin as a source job to demo job position to be consistent with no-demo
data db.

closes odoo/odoo#50076

Taskid: 2196767
Related: odoo/enterprise#10778
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-05-27 07:18:08 +00:00
Aymane (ayt)andThibault Delavallée e02137c485 [REF] sms: move composer from onchange / default_get to editable computed fields
PURPOSE

Try to move from onchange / default_get to stored editable computed fields.
Behavior should be the same (computed or set by user), with support of
create / write / onchange field update without additional code.

SPECIFICATIONS

Update classic fields updated in some cases by onchange and/or default methods
by fields with store=True, readonly=False. It means their value comes either
from manual user input, either from trigger based computation.

Remove onchange and default_get when possible, leading to an unique computation
method and clearing fields definition.

Also clean some fields definition inconsistencies, notably required fields
that should instead be correctly computed or default that have no real meaning.

LINKS

Task ID 2229050
PR #51159

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: Aymane Taibi <ayt@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
2020-05-27 07:22:28 +00:00
jvm-odoo 28655ac9c3 [FIX] hr_attendance: fix last month worked hours
Issue

	- Attendances > Manager > Attendances
	- Create a line for any employee
		check-in 30/04/2020 12PM
		check out 01/05/2020 12PM
	- Go to Employees > the employee

	Last month worked hours = 0
	but it should be 12

Cause

	We only take into account records
	checked_out the previous month

Solution

	Rethink the whole method to
	take into account records
	checked_in last month and
	checked_out this month

	And adding timezone handling

OPW-2259533

closes odoo/odoo#51919

X-original-commit: 7918cccf0c6e28c25e909b1355eb7fda5373edb2
Signed-off-by: Jason Van Malder (jvm) <jvm@odoo.com>
2020-05-26 15:21:35 +00:00
std-odoo 635519ae29 [FIX] mail: fix tracked field with groups
Bug
===
Since 0bd14547a7,
When editing a record which has a tracked field with a group, and if
the current user is not in the group, an error is raised.

Technical
=========
When we get the tracked fields, we must care about the group of the
current user and keep only the tracked fields the user have access to.

To do that, we use `fields_get`, which will return only fields accessible
by the current user group.

The method `_get_tracked_fields` is cached, but it need to depend on
the current user (and also if we are in sudo mode or not), because the
function will return different results, depending on the group of the
user.

Task-2250070

closes odoo/odoo#51915

X-original-commit: c7010058a93ca2fd3b65ac978d8333b273f04fac
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2020-05-27 05:53:13 +00:00
Jorge Pinna Puissant c25f435994 [FIX] purchase_stock: vendor choice in multi-company
- Set two companies (A and B);
- Set intercompany flows enabled between company A and B with
  synchronization of PO/SO;
- create a product X is configured as follows in company B:
  -  Storable product;
  - Routes “Buy” and “Dropship”;
  - Vendors price list set with vendor = company A.
- Product X is configured as follows in company A:
  - Storable product;
  - Reordering rule Min 0 / Max 0;
  - Route “Buy”;
  - Vendors price list set with vendor = 'External Vendor'.
- Create and validate a sale order for product X to final customer
  within company B; Odoo will automatically create a purchase order for
  product X to company A within company B;
- Validate the purchase order in company B; Odoo will automatically
  create a sale order for product X to company B within company A;
- If there is no available stock in warehouse A; Odoo will automatically
  create a purchase order for product X within company A.

Before this commit, the purchase order is created with vendor as
'Company A'. As '_select_seller' is run in sudo mode (see:
https://github.com/odoo/odoo/blob/a16c4a0dabe58ab2cfade353c113387ae5bcd572/addons/stock/models/stock_rule.py#L458),
so is not company-aware, therefore the first matching supplier is
chosen.

Now, the purchase order will be created with vendor as 'External Vendor'.

opw-2255989

closes odoo/odoo#51596

closes odoo/odoo#51908

X-original-commit: e2dd8ea7544fba659810ba829433fce7099c1d40
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-05-27 06:22:15 +00:00
Xavier Morel 148f3dabc9 [IMP] base: make ir.model.data use access fields
Apparently some "core objects" used to have a pair of
fields (date_init, date_update) which predate the current access
fields (hopefully anyway, the genesis of both is lost to time so we
can only speculate).

odoo/odoo#34988 removed them on constrains & relations and left them
on ir.model.data, but they do seem redundant with the regular access
fields which *are* enabled on ir.model.data.

* removes the date_init/date_update fields
* converts the one bit of code which did set those to set
  create_date/write_date
* add a default value on the columns, to ensure create_date is
  properly set even from SQL queries
* use create_date/write_date in the view
* adds setting those columns to a bunch of raw SQL queries which were
  missing them (also updates the queries some to merge the literal
  values into the queries as it seems unnecessary to interpolate
  e.g. a boolean literal)

Builds on and closes odoo/odoo#50516 as that's why I started looking
into it, and that fix is in this branch as well.

closes odoo/odoo#50661

Related: odoo/upgrade#1213
Related: odoo/enterprise#10772
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2020-05-27 06:16:01 +00:00
dmonzonis 2a0638079e [IMP] project: Improve onboarding tour
The onboarding tour of the project app has been improved by changing
some messages and changing the flow to show users how to use the chatter
features within tasks.

Task ID: 2238624

closes odoo/odoo#49760

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-05-27 06:46:54 +00:00
Martin Trigaux 6db2a81ea2 [IMP] *: use specific ir.property methods
Do not make direct CRUD to ir.property records, use appropriate
methods for that
2020-05-26 15:50:11 +02:00
Martin Trigaux 2f26eee981 [IMP] base: do not verify ACL on ir.property
Users have no longer access to unlink if not system. Property are
accessed via sudo so ACL check is no longer relevant.
2020-05-26 15:50:11 +02:00
Martin Trigaux a4472b104b [FIX] *: use sudo when accessing ir.property
Add sudo in base to allow a unpriviledged user to interact with
ir.property in a safe way usingsetters and getters.
By making them callable without sudo, we encourage to use these
methods instead of making CRUD requests on ir.property directly

For other specific search where no native method exists, add sudo
2020-05-26 15:50:11 +02:00
Martin Trigaux 4afa747fa1 [IMP] *: make ir.property methods private
Should only interact with them via python code in a controlled
environment, no direct call with RPC
2020-05-26 15:50:11 +02:00
Martin Trigaux 8f57863707 [IMP] *: remove access to ir.property
Only administrators can access properties and configure them.
ir.property may contain sensitive information and should only be
accessed via code call to specific methods
2020-05-26 15:50:11 +02:00
Martin Trigaux 1835d5a6a3 [IMP] base: allow integer res_id
Before this commit, when retrieving a property, the res_id had to be
in the format <model>,<id>. This was redudant with the model already
present in the arguments of the method.
This way a property can be retrieved with the more concise form
`Property._get("ref", "res.partner", 42)`
2020-05-26 15:50:11 +02:00
Julien Mougenot 709d2e8a7a [IMP] account,web: SearchPanel: improve folding behaviour
1) Clicks on a section value are now bound to the entire header, meaning
that the sole purpose of the carets is purely esthetic.
2) Search panel categories will now only be folded if they are being
clicked on while already selected.

Classes that were no longer useful have been removed and tests have been
updated accordingly.

Task 2264700

closes odoo/odoo#51555

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2020-05-26 13:09:00 +00:00
Julien Mougenot 22167aac57 [IMP] account,web: SearchPanel: move carets to the left
In this commit, hierarchy carets in the search panel have been moved to
the left side of the labels. To achieve a consistent and correct
alignment, some DOM elements have been added/moved and the related SCSS
sheets have been adapted.

Carets on filter sections of the search panel have also been removed.

Task 2258508
2020-05-26 13:09:00 +00:00
Swapnesh Shah 41e409cff8 [FIX] account: apply correct filters
Before this commit, Clicking on "Unpaid Invoices" or  "Bills to Pay" will open records which includes Unposted moves as well while the count was only counting Posted + Unpaid moves only.

With this commit, We apply the default 'posted' filter, and include the partially paid invoices to make the filter behavior consistent with the count.

closes odoo/odoo#51763

X-original-commit: b4a08879de7109b91834fdcde4eafb2ac8c002a4
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-05-26 12:26:57 +00:00
Raphael Collet b768cf7e8b [FIX] core: normalize domain from field.search()
When search is implemented on a given field, the domain returned by
`field.search()` must be normalized, otherwise its processing just
crashes (because of missing logic operators).

closes odoo/odoo#51927

X-original-commit: c83974ac5d797d38760a46c97468a74214218575
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2020-05-26 16:37:15 +00:00
Jorge Pinna Puissant 8deac894f8 [FIX] product: error when automatic selecting PO vendor
The business case is the following:
1) The Child company can order the product to the Parent company;
2) The Parent company order the product to a 3rd party supplier.

Settings:
- Enable ‘Inter-Company Transactions’ transactions with the option
  ‘Synchronize sales/purchase orders’ checked;
- Enable 'dropshipping'.

Set 2 companies:
- Parent company;
- Child company: which belongs to the Parent company.

Set a product 'my purchased product':
- Can be Purchased;
- Product Type: Storable Product.
- ‘Purchase’ tab:
  - Set a Vendor price list line 1: which is your Parent company + set
    your Child company who can buy the product;
  - Set a Vendor price list line 2: which is your 3rd party Supplier +
    set your Parent company who can buy the product.
- Log in as the Child company (disable the login in the Parent company,
  select only the Child one);
- Place a Purchase Order for ‘my purchased product’ to vendor 'Parent
  company';
- Confirm the PO.

Before this commit, an error message appears. The issue arises because
seller_ids is retrieved from the cache and not re-read as superuser.
Therefore, records are missing from the list and the correct seller is
not found.

Now, the correct vendor for the purchase order of the parent company is
selected.

opw-2261971

closes odoo/odoo#51887

X-original-commit: 0a9f0c5d2c85e80dd5dceaeacf3f04bfc8aa0be1
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2020-05-26 11:37:55 +00:00
Arnold Moyaux e26b94405c [IMP] mrp: performance on move
With a database that contains a lot of production with kits or
BoM with a lot of bom.line. The database could become slow.

Index on stock.move <-> mrp.production could improve it.

closes odoo/odoo#51870

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2020-05-26 11:33:50 +00:00