- Create 2 companies A & B
- Create a sequence for PO in each company
- Set User A in Company A and Admin in Company B
- Create a MTO product with a 'Buy' route
- Create a SO with User A using the product, validate
The PO created uses the sequence for Company B instead of Company A.
The creation is done as `sudo`, and ultimately `next_by_code` will use
the company of the Admin.
opw-1839656
Before this commit:
1. If a menu was used as a container (dropdown) and had an unpublished page_id
(website.page), we would never show that menu (and so its submenus) even if
it has visible submenu.
Some users are stuck with this since they:
a) create a new page 'A' (unpublished by default) included in menu.
b) create a new page 'B' (unpublished by default) included in menu.
c) set 'B' as a submenu of 'A' in the menu manager
d) decide to publish the website.page linked to menu 'B'
Then, since menu 'A' is linked to an unpublished page, the menu 'A' and 'B'
are never visible.
2. If a menu is being created with an URL that match a website.page URL, the
m2o relation will automatically be set (website.menu.page_id).
Still, if the user type the URL without the leading slash, the m2o won't be
set.
This could be misleading since on the page property in the page manager the
URL is being shown without the leading slash even if it is stored in DB.
Now:
1. We always show menu container if they contains visible submenu, even if the
container menu is linked to an unpublished page
2. The page URL search is more clever and will match URL even if the only
difference is the leading slash.
This closes#24635
When ir.values was removed and the "action" ir.values were merged
directly into the actions themselves, "client_action_relate" was
discarded as unused (and possibly too similar to
client_action_multi?). *However*:
* it was actually used implicitly as "relate" was the default key2 of
the <act_window> XML tag
* and it had a crucial difference from client_action_multi:
client_action_multi is shown on both form and list views by default
and only on list if multi=True, whereas relate is shown on *either*
the form or list view (tree if multi else form)
This means without relate the actions which should be only visible on
the form view are now on both list and tree, which leads to
overpopulated `Action` menus and odd behaviours (e.g. actions relying
active_id on lists, which id do they get and why?)
=> reintroduce relate as "action_form_only" for the specific case of
multi=False and either no key2 or a key2 of client_action_relate. If
multi=True then binding_type=action.
Fixes#20124
Followup: Task 1843603 to remove #multi and redundancy
Swedish Postal Codes are 5-digit codes with the following format: XXX XX
Before the fix:
With VAT=SE556242088401
For [zip_code] [city] = [171 42] [SOLNA]
we got [zip_code] [city] = [171] [42 SOLNA] because 'zip_code' didn't allow whitespaces
opw:1841010
It was containing a bad translation "Inicaitiva / Oportunbidad" while the
correct one "Iniciativa / Oportunidad" was already done in Spanish.
Remove files to avoid getting the wrong translations.
Regional translations can be used for different terms, avoid to use the same
to make it easier to maintain.
Fixes#24613
Currently, if user does not have enough karma to perform specific action on
forum, alert-box with appropriate message is displayed to the user.
There are several issues with these alert-boxes, like :
- Click on same CTA multiple times, creates multiple alerts
- Click on another CTAs keeps previous alerts on the screen, and adds
further alerts, which sometimes overlaps adjacent CTA and looks ugly.
After this commit :
- Alerts are displayed below their related CTAs
- Only one alert appears at a time on the screen
Fixes : #23071
PR : #23800
Task# : 1829835
This commit closes#23071
This commit closes#23800
When creating a subtask (or a task), parent_id is passed in the create values.
Howver, when the task is not a subtask, we might want to set the SO line directly
and not erasing it with the one from the inexisting parent. So the values of
parent_id is required to force the so line value when creating a task.
Closes#24592Closes#22707
When manipulating domain, this is always better to
normalize them, otherwise we can have strange behavior
when handleing them with `expression.OR` and
`expression.AND`.
For instance:
domain = [('so_line', 'in', [91]), ('amount', '<=', 0.0)]
timesheet_domain = ['&', ('so_line', 'in', []), ('project_id', '!=', False)]
`expresion.OR(domain, timesheet_domain)` will give
['|', ('so_line', 'in', [91]), ('amount', '<=', 0.0), '&', ('so_line', 'in', []),
('project_id', '!=', False)]
And this is not what we attempt.
Closes#24038
Commit 6494f51171 introduces an access token to read images inside an
email. This avoids access errors when accessing the email through a
proxy (e.g. Gmail). That implies that all images are added as
attachments.
When going through the usual media dialog, the form is submitted to
action '/web_editor/attachment/add', creating the attachment. However,
the copy or the drag and drop of an image completely fails. Indeed,
the same method `_onImageUpload` is called, but with a completely
different argument type: `attachments` is a `FileList`, not a list of
attachments.
To solve this, we only call `_onImageUpload` on a the custom `onUpload`
callback, which is not triggered during a drag and drop or a copy. Any
image included thanks to these methods will be post-processed in the
`create` method of `mail.message` (`base64_to_boundary`).
Unfortunately, it's not possible to simulate an actual drag and drop or
a copy, so we cannot add a test.
opw-1840237
opw-1840411
Recently, rev. c0809dd41 removed a protection in the reload of
Kanban views with progressbars. This protection ensured that the
manual reload of the progressbars was only done when one of the
records of the Kanban view was updated (and not when a column, or
the whole view was).
However, removing it highlighted a bug linked to the manual reload
of progressbars, which messed up the list of ids in the
environment. As a consequence, for instance, if the user archived
the records of a column, and then opendc a record in form view,
it couldn't use the pager anymore.
Besides fixing this bug, this rev. re-introduces the protection,
and refines it to prevent 2 useless RPCs when the whole Kanban
view was reloaded.
opw~1841276
opw~1841342
New records (with a NewId) are not necessary in the cache, but should
not be prefetched.
This check has been omitted during optimisation in b0c08a6846.
opw-1843566
opw-1843636
opw-1843683
opw-1843548
opw-1843629
opw-1843657
Closes#24595
* Avoid to invalidate the cache if no actual deletion has been
made when recomputing the taxes
* Avoid to create analytic entries to delete them right away
few lines further in the same method:
- Analytic entries are created at line 903
- account_invoice.py:751 `move_line_dict['analytic_line_ids'] = [(0, 0, line._get_analytic_line())]`
- account_invoice.py:840 `iml = inv.invoice_line_move_line_get()`
- account_invoice.py:886 `line = inv.group_lines(iml, line)`
- account_invoice.py:894 `'line_ids': line,`
- account_invoice.py:903 `move = account_move.with_context(ctx_nolang).create(move_vals)`
- Then, at line 907, they are deleted and others are created again:
- account_invoice.py:907 `move.post()`
- account_move.py:130 `move.line_ids.create_analytic_lines()`
- account_move.py:1258 `self.mapped('analytic_line_ids').unlink()`
- account_move.py:1262 `self.env['account.analytic.line'].create(vals_line)`
Deleting these analytic entries indeed implies the invalidation of the cache.
Besides, generally speaking, we should avoid to waste resources
by creating/unlinking records without a good reason.
When the reception route of a warehouse company is deleted by the user
e.g. My company, Chicago Receipt in 1 step is deleted,
and then changing the given warehouse `Incoming Shipments`
multiple times
e.g. from `one_step` to `two_steps` multiple time,
the reception route is created again and again and again.
This is because the reception route which is created for the
warehouse is not being assigned to the warehouse
as the `reception_route_id` once newly created.
opw-1836544
Users will be more likely to look for a module named email marketing
than they would be searching for a module named mass mailing.
Task #1825294Closes#23634
The goal of this change is not to be able to search a location_id/warehouse_id
but to properly make these fields "dummy": only used to put some keys in context
from the search view in order to influence computed field.
Use case:
In function _compute_quantities_dict, the quantity available for a product is computed
according to the warehouse or the location. But to compute this quantity, the specific
warehouse or location must be in the context.
Steps to reproduce:
- In the tree view of product.product, write the name of a warehouse W
- Click on dropdown menu "Search warehouse"
- Click on W
Expected behavior: the quantities available for W are displayed.
NB: search=lambda operator, operand, vals: [] must be written to
ensure these fields to be searchable. Otherwise "Non-stored field
product.template.warehouse_id cannot be searched." was logged.
opw:1839961
Steps to reproduce the bug:
- Create a SO with 2 lines and confirm it
- Set a Customer reference on the SO with "This is, a ref"
- Deliver it
- Create an invoice from it with all the invoicable lines
Bug: The name of the invoice was: "This is, a ref, This is, a ref"
Expected behavior: The name of the invoice is: "This is, a ref"
opw:1840738
When a record is created in a different language than English, empty
translations are created using the _set_ids method for translatable fields.
l10n_multilang makes the account translatable, an empty translation is created
when the CoA data is processed.
After the CoA installation, l10n_multilang transfer the translations of the
account templates to the related accounts.
No need to create translation terms again, use _set_ids to update the existing
translations.
This will prevent a cause of translation duplication, forbidden in the future by
160d657704
opw-1832071
Closes#24158
When we change the the uom of a product, a user error is triggered if
there are already moves created for this product. But if the product is
archived, the call to mapped('product_variant_ids') doesn't return any
product ids, so no moves are found and you can change the uom.
To fix this behaviour that can lead to bad configurations, because
quants and moves won't be in the same unit than the product's one.
- Go on the partner form view
- Click on the stat button 'Invoiced'
- Create an invoice
The partner is not filled in.
Overlook of 1f277a3572
opw-1839867
Revision on dd8e95cb1a12603940cc32a3d840b6097515df85
The intent of the commit above was to fix the style of the composer,
which was broken when turning the textarea input into a contenteditable
div. While fixing the style for the composer in Discuss or in the Chatter,
it misplaced the initial position of the caret in a chat window.
This commit fixes the issue on chat windows, while also improving the
previous fix.
Known issues:
In a chat window with more messages than it could be displayed at once,
when at the bottom of the thread, the line separator of the composer
and the thread is off by 1 or 2 pixels (vertically).
> Fixing this issue breaks a lot the alignment of items in the composer
of Discuss and Chatter, so this small visual glitch is preferred.
Before this commit, we had the following issue with binary widget in a form:
Suppose we have a binary field with filename attribute set. When uploading a
new file 'temp.txt' with content 'Cg==', the displayed value is 'Cg=='. When
the changes are saved, the displayed value becomes 'temp.txt'.
It should always display 'temp.txt', which is what is fixed by this commit.
In addition to fixing this issue, we describe what is the expected displayed
value of a binary field. This is based on whether the attribute filename is
provided, and whether the record is in edit or read-only mode.
Fixes#21630Closes#24275
Co-authored-by: Nick Booker <nick.booker@opusvl.com>
When a move or move line is supposed to use the company currency, its currency_id field is empty. _compute_matched_percentage did not take this into account, causing the rounding method to sometimes be called with a precision equal to False, resulting in erronous and weird behavior (0 was considered different from 0, causing a division by zero in the following condition).
Use case to reproduce:
- Create a BOM with a byproduct tracked and a routing
- Mark the last workorder as done
- by products move line are not created
With the wizard produce (MO without routing) move lines
are created. Thus there is an inconsistency.
It happpens because workorders and produce button do not use
the same function. commit 1a09bcc622
already fix it for production wizard however it forgets workorders
process.
opw-1838707