Steps to reproduce the bug:
- Log as admin user in company C
- Go to Leaves module and click on Managers > Allocations
- Create a leave.allocation with type = Compensatory Days, duration = 7 days
mode = By Company and Company = C
- Approve the allocation
- Create a leave request LR for all the company C and approve it
- Log as demo user (only user access right for Leaves)
- Go to Leaves > My Leaves and click on "Leaves requests"
Bug:
A traceback was raised
opw:2005813
closesodoo/odoo#33899
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Create a journal J1 of a given type T with no currency.
Create a journal J2 of type T with a currency Y, default currency of company C.
Invoices of type T are created with journal J1 by default.
However, if the currency Y is explicitly set in the context, it will be created
with journal J2, even in company C. In that case J2 will be selected,
because the currency is explicitly set in context.
Now suppose we have a journal J3 of type T with a currency Y', different from
the currency of company C.
Give a lower sequence index to J3 than to J1.
Create an invoice with no currency in context.
Then J3 will be selected despite not being on the correct currency, because
no currency condition has been put in the domain.
We solve these two bugs by always adding the clause in the domain,
and adding that the currency can not be set in the case of the company currency.
opw 2002748
closesodoo/odoo#33795
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Before this commit, aboutus contactus and homepage would be flag as noupdate.
If not modified, those view would not get modification on module update, which
is not logic.
Now, those view will benefit from any update. It makes even more sense since
multi-website, as those views will never get modified directly (it will COW).
closesodoo/odoo#33919
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Create two pickings, add them to a batch.
Set a quantity less than the order to done on each.
Confirm and set to done. A wizard asks if a backorder should be created.
If confirmed, the first picking is done with a backorder but not the second.
Since the method is in api.multi, we can simply get all pickings.
opw 2004727
closesodoo/odoo#33902
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
- Create 2 products A & B set as:
Service Invoicing Policy: Milestones (manually set quantities on order)
Service Tracking: Create a new project but no task
- Create a SO with A & B, validate
- Set a delivered quantity for both products
- Go to the project overview
Only the delivered quantity of a single SO line is retrieved in the 'To
invoice'.
It occurs because only a single SO line is linked to the project, while
both are expected to be linked to it.
opw-2003097
closesodoo/odoo#33815
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
In Odoo 11.0, fb5015d5fc fixed some flows related to prices. By doing that,
the `t-options` dict was set on a variable to avoid code duplication.
But starting from Odoo 12.0, setting a variable on `t-options` attribute seems
to do nothing and is ignored.
This commit fix it by setting the price rather than the options on a variable.
Fixes#33451closesodoo/odoo#33900
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
- Have two crm teams with the same team leader, and without team members
(team1, team2 as instance).
- Create a new lead, add as Salesperson the team leader, and as Sales
team the second previously created team (team2).
- Save the new lead.
Before this commit, when we save the lead, the sales team will change,
to set the default sales team for the chosen Salesperson, in this case
team1.
opw-2005924
closesodoo/odoo#33898
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Steps to reproduce the bug:
- Create a new Bank Account A available in the POS
- Set A as a payment method in the pos.config
- Create a new session and sell a product P for 100€
- Make the payment with A
- Close the session and validate the entries
- Check that a new statement in A has been created with a starting
balance = 0€ and an ending balance = 100€
- Create a new session and close the session
Bug:
A new statement for A had been created with a starting balance = 0€
instead of 100€ (the ending balance of the previous session)
opw:1981984
closesodoo/odoo#33868
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Group by invoice, products: the untaxed total is correct,
while the (taxed) total is the sum of the lines divided by the number of lines.
On account.invoice.line, there is a price_subtotal_signed, which is the
price_subtotal (untaxed) in the company currency.
Unfortunately price_total_signed does not exist for price_total (untaxed).
As a result, we need to use the price_total on the invoice line,
and divide by the currency rate.
Unfortunately we cannot do it in the subquery because of the scope of the rate.
opw 2003185
closesodoo/odoo#33802
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
On a eCommerce page were there was no SEO optimization change:
- Customize > Activate "eCommerce categories"
- Customize > Activate "Colapsible category list"
- Promote > Optimize SEO > Change description > Save
Nothing happens.
Actually, an SQL error is raised because of the `ondelete='restrict'`
set at:
https://github.com/odoo/odoo/blob/897feb553e6ef75af9434cb77436b26abde3a761/odoo/addons/base/models/ir_ui_view.py#L212
In this case, we have the following structure:
```
View 1
|
---> View 2 (Website-specific)
|
---> View 3 (Website-specific)
```
For example:
```
Products
|
---> eCommerce Categories (Website-specific)
|
---> Collapsible Category List (Website-specific)
```
Since the inherited view (View 2) is website-specific, we duplicate it
and try to unlink it. However, this view has children, which raises the
error.
To solve the issue, we re-attach the children of the inherited view to
its copy. In a realistic situation, the children of a website-specific
view should also be website-specific, so there is no need to apply the
'copy or re-attach' logic recursively.
We end up with:
```
View 1 (Website-specific, duplicated)
|
---> View 2 (Website-specific, duplicated)
|
---> View 3 (Website-specific)
```
opw-1997946
closesodoo/odoo#33787
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The bottom of event is shared between all event page and all events.
This is especially misleading when "website menu" with
website_event_track is activated on the event, then we will have several
pages such as "Introduction" / "Location" and depending on if we drop a
widget some pixel too high or two low, it will be only on the current
page or on all events.
With this changeset, when editing there is an information block saying
what part is on all page.
opw-2002163
closes#33857
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Before this commit, the param contact_address was not sent to the service. However, the service need it to correctly send the letter if the format is wrong.
OPW-1981168
closesodoo/odoo#33855
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
Have the group analytic tags ON
Have the order.line o2m list non editable
Make a SO, make a line with a tag
Confirm the SO
Click on the line
in the modal, click on the analytic tag
Before this commit, there was a traceback because the color was never fetched
This was because the o2m list view did not fetch the color_field
After this commit, there is no traceback, and displaying
as well as changing the color works as expected
OPW 2002456
closesodoo/odoo#33846
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Steps to reproduce the bug:
- Create a product P with price=100€
- Configure payment aquier Paypal with fees_int_fixed = 1€ and fees_int_var = 1%
- Set Paypal to be available in the website
- Go to the web shop and add P in the cart
- Choose to pay with Paypal
Bug:
The amout to pay was 102.02€ instead of 102.01€
Before the fix, the fees was computed as followed:
fees = (percentage / 100.0 * amount + fixed) / (1 - percentage / 100.0)
Where fees_dom_fixed = fixed and fees_int_var = percentage
With this computation, the percentage was applied twice.
If for example, we had fixed = 0 then
fees = (percentage / 100.0 * amount) / (1 - percentage / 100.0)
In this case, it's easy to see that the percentage is applied twice.
opw:1981784
closesodoo/odoo#33830
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
- Create a MO for '[FURN_8855] Drawer'
- Consume 1 unit of '[FURN_2100] Drawer Black', but DO NOT consume
anything for '[FURN_5623] Drawer Case Black'.
- Complete the MO, then Unlock it
- Edit the '[FURN_5623] Drawer Case Black' line
It is not possible to add a line.
This is expected from 9e77ce2edc, but we still want to be able
to consume some quantity.
Instead of canceling the move lines without any quantity consumed, we
set it to done.
opw-1986919
closesodoo/odoo#33820
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
In the kanban views, cards have a fixed size (here it is overriden as 450px).
All internal elements use col-x Bootstrap classes, with have flex 0 0 x/12.
Note that 0 0 correspond to flex-grow and flex-shrink, so the sizes are fixed.
It follows that any long translation or number will overflow badly.
Hover this overflow is, in terms of usability, less worse hiding the overflow
or even scrollbars.
So nothing is flexy, but too avoid this issue as much as possible,
we give more space to the right side, since the left side only shows a button.
opw 2001951
closesodoo/odoo#33818
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
When the `purchase.order` is added as an embedded tree view on a model
without a `state` field, a crash occurs.
The existing condition doesn't make sense on a PO (while it would make
sense on a PO line), so we simply remove it. Since the condition implied
that the field `invoice_status` was always hidden, we keep it that way.
opw-2005768
closesodoo/odoo#33827
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This commit adds a tour for the condition where the delivery charges,
even though that was not added to the total charges, it was shown in the
delivery charges aside (even if the payment was over the amount where free
delivery was available). This adds a test that it should be "0.0" instead.
This was tested before the fix and after the fix.
- Activate multi-company
- Create a company B
- Switch to company B
- Create an allocation request
An access error is raised.
Commit 7f775f0677 added a `sudo` call in order to prevent an access
error. However, it implies that the fallback value `self.env.user`
refers to the SUPERUSER, not the current user anymore. If the current
user is not in the same company than the SUPERUSER, the multi-company
record rules will be triggered.
The fallback is changed to an empty recordset, and selecting the current
user is done out of the method called with `sudo`.
opw-2003137
closesodoo/odoo#33804
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Create a MO for '[FURN_8855] Drawer'
- Consume 1 unit of '[FURN_2100] Drawer Black', but DO NOT consume
anything for '[FURN_5623] Drawer Case Black'.
- Complete the MO, then Unlock it
- Edit the '[FURN_5623] Drawer Case Black' line to add one unit
consumed, save
The new stock move line is created as canceled.
It is created canceled since the corresponding stock move is canceled.
We should not be able to add a stock move line on a canceled stock move.
opw-1986919
closesodoo/odoo#33794
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Before this commit, when sending multiples invoices by email in batch,
if one of these invoices was for a customer without an email address,
these wasn't sent and the user didn't have any feedback about this.
Now, before the user send the emails a warning is shown with the list of
invoices that can't be sent by email.
opw-2002350
closesodoo/odoo#33753
Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
When you open the image modal of the website editor the selected image
is the current image.
But if the image is not an attachment with an `url` field set (eg. it
has been uploaded and is not a file in a /static/ folder) the match
between image modal and current did not work and to close it we need to:
- actively select the current image then click "Save"
- use the X button to close the modal without saving
With this changeset, the match of current image with image list is done
on the attachment `url` and if unavailable with /web/image/ID/name.jpg
path which cover both possibilities.
opw-2004073
closes#33799
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
- When validating a payment an "expected singleton" exception is
raised due to the fact that we are using a recordset with multiple
record instead of a recordset with a single record.
OPW-1981632
closesodoo/odoo#33767
Signed-off-by: Christophe Simonis <chs@odoo.com>
If the company is not set on the SO, the creation of a SO line crashes
because `currency` is empty.
opw-2005143
closesodoo/odoo#33783
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Create an Analytic Distribution for:
Product A
Current user (e.g. Mitchell Admin)
- Sell the product in the POS, request an invoice
The analytic account defined is not used.
This is due to the invoice created as SUPERUSER.
We should first take into account the user on the invoice, then the
current user.
opw-2003935
closesodoo/odoo#33758
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Before this commit, the payment memo was copied during the duplication
of a voucher. The issue is that the payment memo is not always shown in
the view, and it's mostly unique by voucher.
Now, the payment memo it's not copied anymore.
opw-1986544
closesodoo/odoo#33708
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The stable behaviour of the mail composer is the following:
- if a template adds new attachments, the composer only has this list
- if a template doesn't add attachments, the list is unchanged
- if no template is set, the list is cleared up
In the case of templates, we also check that both static and dynamic attachments
are added to the list.
We clean up after c6d718f211 and subsequently 516f22c398 which failed to take
into account the fact that the attachement list could be a blend of commands
and ids.
Transforming that is taken care of by _convert_to_write, which semantics was
changed by c6d718f211.
To keep the second behaviour, we thus need to add a (5,) command.
opw 2003197
closesodoo/odoo#33706
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
In `_compute_qty_delivered` function
Python `all` function returns `True` if list is empty; thast why check
if `moves` is not empty to set `qty_delivered` to `product_uom_qty`.
Before the fix, if you had multiple accounts for a specific service, the
settings page was crashing.
(eg: for a service, you have one account specific to a company and
another account with no company set).
We now prefer accounts specific to the current company and tie-break on
the most recently created one
opw-2003744
closesodoo/odoo#33736
Signed-off-by: Pierre Rousseau (pro) <pro@odoo.com>
The stable behaviour of the mail composer is the following:
- if a template adds new attachments, the composer only has this list
- if a template doesn't add attachments, the list is unchanged
- if no template is set, the list is cleared up
In the case of templates, we also check that both static and dynamic attachments
are added to the list.
We clean up after c6d718f211 and subsequently 516f22c398 which failed to take
into account the fact that the attachement list could be a blend of commands
and ids.
Transforming that is taken care of by _convert_to_write, which semantics was
changed by c6d718f211.
To keep the second behaviour, we thus need to add a (5,) command.
opw 2003197
closesodoo/odoo#33707
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
If a field is inherited from another model, the attribute context_dependent
was not propagated correctly.
Example of bug:
>>> product = self.env['product.product'].search([], limit=1)
>>> product.name
'Whiteboard Pen'
>>> product.with_context(lang='fr_FR').name
'Whiteboard Pen' # cache used
>>> template = product.product_tmpl_id
>>> template.name
'Whiteboard Pen'
>>> template.with_context(lang='fr_FR').name
'Marqueur pour Tableau Blanc'
>>> product._fields['name'].context_dependent
False
>>> template._fields['name'].context_dependent
True
Fixesodoo/odoo#33641Closesodoo/odoo#33722
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Since JS refactoring of ActionManager at 32b8cec536, the /apps/<app> controller
was not working anymore as the refactoring dropped the support of `sa` as URL
state.
closesodoo/odoo#33679
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
There was no way to inherit properly action_move_create method.
opw:1974069
closesodoo/odoo#33488
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
If an error is raised when saving a calendar event, the transaction is
correctly rolled back. However, the view is not refreshed and the
incorrect information is displayed.
We simply reload in all cases.
opw-2002186
closesodoo/odoo#33028
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>