- Steps :
Sales > New Quotation > Order Lines > in a new product line :
Write a price
Write a name, Create and Edit
In the form, change the price of it and Save.
- Issues :
When first getting in the form, the price is not correctly computed from
the sol.
When saving the form, the price is not saved.
- Cause :
`lst_price` is the product's price.
`list_price` is the template's price.
The sale/quotation view puts `default_lst_price` in the context with the
unit price of the sol.
Yet lst_price is not in the form, so its value remains zero as this context key is not taken into account.
However, list_price is in the form. After this has been changed
manually, when the form is saved, it takes the value of lst_price = zero.
- Fix :
Add an invisible field lst_price in the product form.
This way, the context key is taken into account, so lst_price is
changed, and list_price accordingly.
opw-2731620
closesodoo/odoo#83793
X-original-commit: d3ec94f1c79ecb76acb8de027bf47b0f0b7a3b0f
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Signed-off-by: Onockx Audric (auon) <auon@odoo.com>
Some html field are not in their ideal style.
As the style for html fields is now dependent of
where you are in the xml view ( in group or not),
we have to adapt some views and flags some fields
to ensure they have the correct look.
This change is only be a visual enhancement
and should not prevent the function of said html fields
even if the views are not updated.
task-2637488
# Conflicts:
# addons/mail/wizard/mail_compose_message_views.xml
# addons/website_slides/views/slide_channel_views.xml
# Conflicts:
# addons/sale/views/sale_views.xml
closesodoo/odoo#83792
Related: odoo/enterprise#23911
Signed-off-by: Antoine Guenet <age@odoo.com>
Signed-off-by: Geelen Sébastien (sge) <sge@odoo.com>
Allow wysiwyg field html to blend better in odoo view,
Remove the default resizer and make the field html's size
automatically fit its content
task-2637488
# Conflicts:
# addons/project/static/src/js/project_form.js
Part-of: odoo/odoo#83792
This commit brings the ability to use some feature detection
mechanism used in Odoo. The jquery.touchSwipe library
implementation requires the browser to get ontouch* events from
the window to be available to assert that the browser has touch.
The switch will make the mechanism to work as expected, and
allow tests to use touch events while being correctly executed
because the library expects such events.
closesodoo/odoo#83588
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
in version 14, if you have anglo-saxon accounting and are posting inventory at the end of the session, and create a PoS order without invoicing it, then leave the session without closing and validating,
and open said order and invoice it outside the session, picking for said order will not be created. So, once the session is closed and validated, there will be an invoiced order without any picking in it.
After this commit Odoo will check if order that is being invoiced already has picking order, and if not, will create one for it.
OPW-2725930
closesodoo/odoo#83787
X-original-commit: 894dfa892c92d55ce9897193b4016a5e1f40858d
Signed-off-by: Masereel Pierre <pim@odoo.com>
Before this commit, it was impossible to make a payment if the
transaction reference exclusively contained digits. This is because the
reference is extracted from the data-* attribute of the <form/> element
of the payment form and wrongly cast into an integer by jQuery before
being passed to the server. Indeed, as of jQuery 1.4.3, HTML5's
data-* attributes are automatically pulled into a jQuery's data object.
To reproduce the issue, remove the prefix from the sequence of the sales
orders and attempt to pay a quotation from a payment link.
This commit forces the reference to be cast into a string as it is the
variable type that the server expects, and it crashes if the reference
is an integer.
opw-2732448
closesodoo/odoo#83753
X-original-commit: 57d9997fa59c82e03c46b149daece5ce32395c5c
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
We are currently lacking an index with (author, failure) due to the information
being spread out in two different tables which are both rather big (there are a
lot of non-failure messages for the current user, as well as a lot of failure
messages for other users), so the fetch of failures for the current user can
become extremely slow (> 20s).
With this new index, the query takes less than 1ms.
task-2742946
closesodoo/odoo#83451
Related: odoo/upgrade#3204
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Following recent conversion of onchanges to computes in the sale scope,
it was observed that updating one line triggered price recomputation in other
lines (which isn't expected).
After investigation, it seems that the `product_packaging_id` field is considered
modified and sent on SO save for all the lines, which triggers the `product_uom_qty`
record computation, then the whole price computation is triggered, since it depends
on that quantity field.
This commit aims to fix this case by only considering a m2o field as modified
if its value was effectively changed.
closesodoo/odoo#83252
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
Split a manufacturing order in several parts
using the back order mechanism
Merge several manufacturing orders related to the same product/bom
by cancelling all of them and creating a new one
closesodoo/odoo#82427
Task: 2662566
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Add the possibility to force the two-factor authentication for all users,
using a two-factor authentication by email
when the 2FA using an Authenticator app is not configured for the user.
Two possibilities:
- Force the 2FA only for employee users using the system parameter `auth_totp.policy=employee_required`
- Force the 2FA for all users, employees and portals, using the system parameter `auth_totp.policy=all_required`
closesodoo/odoo#83750
Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Steps to reproduce:
- Create an invoice and confirm it
- In Accounting Dashboard, on the Customer Invoices card,
click on 'Unpaid Invoices'
- Select the invoice with the checkbox
- Click on button 'Register Payment'
Issue:
- The journal_id is not set by default
Before this commit, the default fields inherited 'journal_id',
if it's not the good one, we delete it in order to compute it..
opw-2729754
closesodoo/odoo#83770
X-original-commit: 9e2f96598f3d62b501e894eab7151af8390937e1
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Guillaume Vanleynseele <guva@odoo.com>
PURPOSE
Before this commit it's impossible to unlink a sale order line containing
a booth product (the ondelete parameter is unset thus default to restrict)
After this commit this bug is fixed.
Further explanation on the task implying a bug on the database setting
the on delete to cascade despite the default value...
LINKS
Task-2749521
PR : odoo/odoo#83685closesodoo/odoo#83767
X-original-commit: e8d96fb1cfd5016f12dc43b988a8a0450bf36a04
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose
=======
A field `use_google_gmail_service` has been used in stable to define
a mail server which use Gmail authentication.
But now that the fields `smtp_authentication` exists, we want to use it
to simplify the mail server form view. For the incoming mail server,
the field `server_type` will be used for the same purpose.
Add a new field to have the option to install `google_gmail` in the
main settings page.
Task-2170676
closesodoo/odoo#83413
Related: odoo/upgrade#3199
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to follow
- Select only one company in the company selector but not the default one
from the current user;
- Go the the CRM app;
- Create a lead;
-> A multi company error appears !
Solution
- The default team is now restricted to the companies in the context
- When computing a lead's company_id when the team has no company, keep only
the ones within the allowed_company_ids;
opw-2713757
closesodoo/odoo#83764
X-original-commit: 58b9b3e839c7725fdcd66376564ce6554a4b82ac
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose is to add some tests involving unsync of env.companies and current
user's company. Tests are added trying to mimic notably assignment cron
using sudo().
Next commit will fix some side issues.
opw-2713757
X-original-commit: 70b9f3aaa86acc6d32bee21fbd6114541115d310
Part-of: odoo/odoo#83764
The `_create` don't batch the SQL request to insert of data which it
isn't efficient we there is a several record to create.
Batch the SQL insertion and measure performance
depending of batch size to avoid any regression (see result in the
PR: https://github.com/odoo/odoo/pull/80961).
task-2299314
closesodoo/odoo#80961
Signed-off-by: Raphael Collet <rco@odoo.com>
Co-authored-by: rco-odoo <rco@odoo.com>
The `check` decorator in `sql_db.py` was on a lot of `Cursor` methods.
It checks if the cursor is close before be using a the method.
Remove it because:
- It is completly redundant because `psycopg2` do already the job
to check the cursor before usage.
- It complicated the call stack and lead to a small overhead of
highly use methods (can be more than 1% of the execute call)
- Also the nature of
the Error isn't correct: raise `OperationalError`
(https://www.psycopg.org/docs/module.html#psycopg2.OperationalError)
instead of `InterfaceError`
(https://www.psycopg.org/docs/module.html#psycopg2.InterfaceError).
Part-of: odoo/odoo#80961
Previously for `appointment`, now for `appointment_hr`, the computation of
users' availability for appointment slots can be dependent on that person's
work schedule if:
* The user is linked to an employee
* The user's employee has working hours defined (resource calendar)
This commit provides working hours to all employees and a user to some, within
a multi-company setup.
Task-2728093
See odoo/enterprise#22642closesodoo/odoo#80688
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Current behavior:
After creating a group chat in the discuss app you were not able to close it.
Steps to reproduce:
-Create a group chat with more than one user in the discuss app
- Try to leave it
- You get an access error
opw-2736464
closesodoo/odoo#83717
X-original-commit: cc1c132ee092368e77108f327ecdc5a6d2c490a6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
Activities and mailing trace models are linked to records through a model and
a many2one reference field. The latter one is required but is implemented like
an integer field, meaning writing 0 is actually a valid value for 'required'.
In this commit we add a constraint to ensure we never update activities with
a void res_id value. Same for mailing traces.
Source: internal feedback about activities with 0 as res_id
Task-2694133
closesodoo/odoo#81292
Related: odoo/upgrade#3106
Signed-off-by: Warnon Aurélien (awa) <awa@odoo.com>
Oversight of odoo/odoo@cd885ad2cd . On transient record (having newID) this
line leads to creating activities with res_id being 0.
Part-of: odoo/odoo#81292
Activities and mailing trace are linked to documents through a model and
a many2one reference field. The latter one is required but is implemented like
an integer field, meaning writing 0 is actually a valid value for 'required'.
In this commit we add a constraint to ensure we never update activities with
a void res_id value. Same for mailing traces. This allows to remove the
required attribute on fields to avoid having redundant sql constraints.
Source: internal feedback about activities with 0 as res_id
Task-2694133
Part-of: odoo/odoo#81292
Part of the overall v16 SCSS optimization/restyle, task-2704984.
task-2731819
closesodoo/odoo#83108
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Add new utility classes to handle basic opacity behaviors.
Once migrate to BTS5 these classes should be generated using the
upcoming utility classes API.
Part of the overall v16 SCSS optimization/restyle, task-2704984.
task-2731819
Part-of: odoo/odoo#83108
With a recent commit[1], we now gather the chatter related data with a
single controller ('/mail/thread/data') which was a bit scattered
previously. With this controller, instead of searching in dedicated
model, we now simply use the main document/record itself and it's
fields whenever possible. For example, previously for the followers,
we used to search data from 'mail.followers' model, but now we simply
use `message_follower_ids` field of the record itself.
The problem with this approach is, if the record is archived, we won't
be able to fetch the related data. That leads to empty follower list/
activities and a trackback while getting suggested recipients.
This commit fixes the issue by loading the record even if it's
archived, and thus fetching the data required by chatter.
commit[1] - https://github.com/odoo/odoo/commit/e0913197ac84b25b40e7599a6432362141d104c9
TaskID-2748030
closesodoo/odoo#83731
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
When archiving a Tax, you do not want that action to
invalidate Sales Orders and Invoices confirmed in the past
and that were using it.
The purpose of Archiving it is that it would not appear
or be proposed to new items created.
Until now, we had an inconsistency between Sales Orders and Invoices
when a Tax was archived.
The tax "disappeared" from old SOs,
but the amounts remained unchanged, which created an inconsitency.
The domain in the field definition no longer works
because a custom domain in the view is shadowing the current domain.
task-2745094
closesodoo/odoo#83712
X-original-commit: 09f6d682669e4e9d898f89706fece3fa9ce59da3
Signed-off-by: Laurent Smet <las@odoo.com>
When creating automatic entries for multiple moves on different dates with the automatic entry wizard, the wizard would reconcile all the lines on the accrual account of the destination move with the lines on the accrual account of each accrual move. As this would imply reconciling the same lines multiple times, it triggers a reconciliation error.
What must be done is, for each accrual move, reconcile it’s lines with only the related lines on the destination move.
closesodoo/odoo#83732
Task: 2717578
X-original-commit: 502003ac548d6620374dfbab4fb7be6dee3c1bf5
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Florian Gilbert <flg@odoo.com>
Signed-off-by: de Wouters de Bouchout Jean-Benoît (jbw) <jbw@odoo.com>
Sometimes _compute_percentage would return a percentage slightly over 100 due to a rounding error. This would then trigger the constraint asserting that percentage must be >= 0 and <= 100.
Task: 2717578
X-original-commit: 813d52ed7daff408819d8838c8c36fcee825905f
Part-of: odoo/odoo#83732
In case of a MRP subcontracting, it is not possible to process the
delivery with several backorders.
To reproduce the issue:
1. Create two products P_compo, P_finished
- Both storable
- P_compo must have the route "Resupply Subcontractor on Order"
2. Update P_compo's quantity: 5
3. Create a BoM:
- Product: P_finished
- BoM type: Subcontracting
- Subcontractors: a partner P
- Components: 1 x P_compo
4. In Inventory, create a planned transfer T:
- Operation Type: Receipt
- Receive From: P
- Operations: 5 x P_finished
5. Mark as Todo
6. Inventory > Resupply Subcontractor, find the delivery of P_compo for
P and process it
7. Back to T, set the done quantity to 1.25
8. Validate T (with backorder)
9. On the backorder BO1, set the done quantity to 1.0
10. Validate BO1 (with backorder)
11. Open the second backorder BO2 and validate it
Error: a Validation Error is displayed "You can not enter negative
quantities.", which doesn't make sense
The issue comes from the inner method `_get_available_move_lines` in
`_action_assign`. When validating a picking, at some point, we are here,
at the beginning of `/mrp_subcontracting._action_done`:
https://github.com/odoo/odoo/blob/6d6b2c41adfa842c82252373b3dbd1ed0a5ebc92/addons/mrp_subcontracting/models/stock_picking.py#L36-L37
To understand what happens next, we need to note that, in this method,
the associated MO will be marked as done later (on line 76). Back to the
current line (L37), we are calling `super` which leads to the
problematic `_get_available_move_lines`. Suppose we are on step 10 (we
are validating the first backorder), we have
https://github.com/odoo/odoo/blob/58a9f57c0827a51e46ef0f52a3d48ba343667fe0/addons/stock/models/stock_move.py#L1390-L1391
`move_orig_ids` contains two stock moves, each one associated to one MO.
However, as said above, the second MO is not yet marked as done, this
will be done later on in `/mrp_subcontracting._action_done`. Therefore,
`move_lines_in` is only defined with the first SM, from the first MO,
with a quantity of `1.25`
Further in `_get_available_move_lines`, we have:
https://github.com/odoo/odoo/blob/58a9f57c0827a51e46ef0f52a3d48ba343667fe0/addons/stock/models/stock_move.py#L1403-L1405
`move.move_orig_ids.mapped('move_dest_ids') - move` gives two SM, and
here is the issue: the second one is already processed, so both are kept
in `move_lines_out_done` and the sum of their quantity is equal to
`1.25 + 1 = 2.25`
Therefore, at the end of the method, when computing the difference, it
gives a negative difference. This negative value will be used to create
a SML and later on, it will trigger the validation error.
Once the above issue is fixed, there is another "invisible" issue that
need to be fixed: when generating several backorders on the deliveries,
only the first one will trigger the creation of a new MO. Suppose we are
back in `/mrp_subcontracting._action_done` (still on step 10 in the
above case), in the first for-loop:
https://github.com/odoo/odoo/blob/6d6b2c41adfa842c82252373b3dbd1ed0a5ebc92/addons/mrp_subcontracting/models/stock_picking.py#L39-L43
`move._get_subcontract_production()` returns the two MO (from the
initial picking and from the first backorder). However, since the first
one has already been processed, the if-condition is validated.
Therefore, this for-loop is done and the second MO is not processed (the
quantities are not recorded and its field
`subcontracting_has_been_recorded` is not defined to `True`). As a
result, still in `/mrp_subcontracting._action_done`, we are now in the
second for-loop:
https://github.com/odoo/odoo/blob/6d6b2c41adfa842c82252373b3dbd1ed0a5ebc92/addons/mrp_subcontracting/models/stock_picking.py#L71-L72
`_subcontracting_filter_to_done` removes the two MOs because the first
one is done and the second one has not its field
`subcontracting_has_been_recorded` set to `True`. The condition in the
first for-loop is not accurate enough.
OPW-2731658
closesodoo/odoo#83658
X-original-commit: 1b740ae148acfc832b124122763817b08ea110ab
Signed-off-by: Arnold Moyaux <arm@odoo.com>
Signed-off-by: Adrien Widart <awt@odoo.com>
Before this PR, the query from _channel_last_message_ids could take a
significant amount of time.
This add an index to speed up the query.
task-2746108
closesodoo/odoo#83476
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Expected Behaviour
When a user get a mail from the data cleaning about records to examine, the View button should be linked to the same url as the 'here' hyperlink or not be in the e-mail.
Observed behaviour
Clicking the link in the View button lead to an error page
Reproducibility
This bug can be reproduced following these steps:
1. Duplicate a contact
2. Wait for the scheduled task to launch
3. Click on the View button of the mail you'll get about te duplicate
Problem Root Cause
This issue is coming from the way we create the 'View' and 'View Task' button, and can't be changed easily. The easier way to fix this issue is then to hide these button
Related Issues/PR
opw-2674138
closesodoo/odoo#83284
X-original-commit: 3a61747b366a315488837e2e560b305e89217dbd
Signed-off-by: Hendrickx Anthony (anhe) <anhe@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
It was only used one time on a unused field.
We don't want to keep useless fields anymore,
the migration is done for that.
task-2735546
odoo/upgrade#3194closesodoo/odoo#82727
Signed-off-by: Raphael Collet <rco@odoo.com>
Issue:
`_write` checked that the number of modified row in DB was equal to the
number of ids in the RecordSet (raise `MissingError` if not).
This behavior was only used by the ORM to retry
(with exists() on the RecordSet before) if the Missing Error raised.
Then it makes the job a second time (for no reason).
Then:
- Remove the check of number of row (and simplify the call of `_write`)
- Remove the useless return value (always `True`)
- Remove the `set(` before the `split_for_in_conditions`, it adds
randomness for nothing because the `_write` should be call without
duplicate id (even if it is not the case, we don't care).
task-2735546
Part-of: odoo/odoo#82727
The `column_format` of the `Field` class was unused and create useless
noise in the ORM. Then remove it and simplify some flows.
task-2735546
Part-of: odoo/odoo#82727
The `_sequence` was only used for the insertion of data in the DB for
the `id` value. But in Odoo, the `id` is always a `SERIAL`, then the
PostgreSQL fill already the value by the right SQL sequence. Then,
avoid doing the job of the DB by ourselves.
Sadly, we need to manage the case when we create an empty record to
always get a valid query.
task-2735546
Part-of: odoo/odoo#82727
Note: fix not necessary since odoo/odoo@https://github.com/odoo/odoo/commit/a62927e7e2d7df4047f8606b41e70ef61ac29b73 landed in master. This
forward port contains only the test.
Step to reproduce:
- Go to a project with visibility set on 'Invited portal users and all internal users'
- Go a task
- Send an follow invitation to Marc Demo (an internal user)
Intended behavior:
The mail has a 'View task button'
Current behavior:
No view task button
This behaviour is due to the function _get_recipient_data which is supposed to return groups when given pids but doesn't.
See _get_recipient_data docstring.
opw-2727410
closesodoo/odoo#83594
X-original-commit: d113cb6398806a1a744085d041b73b827f9f4ada
Signed-off-by: Damhaut Florian (flda) <flda@odoo.com>
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Currently: "register payment" wizard allows selecting different bank accounts or even creating one when registering a payment on customer invoice/vendor refund.
Should be: the field should be set to partner_bank_id and be set as readonly. When cash journal is selected, "Recipient Bank Account" field should be hidden
Task ID: 2710936closesodoo/odoo#81319
Signed-off-by: Olivier Colson <oco@odoo.com>
As an overridable _neutralize model method was added in a previous
commit, the method is now implemented for various models.
closesodoo/odoo#67825
Related: odoo/enterprise#19042
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
An overridable model method was added in a previous commit in order to
neutralize a database.
This commit adds the implementation of this method on the `iap.account` model.
A _get_iap_config_paremeters method is also added on this model.
Each iap service must override this method to extend the list of
`ir.config_parameter` that need to be neutralized.
Part-of: odoo/odoo#67825