In case two modules are using the same local name for their external identifier,
a conflict may occure.
e.g. the templates
- l10n_generic_coa.a_salary_expense
- l10n_be.a_salary_expense
will generate
- l10n_generic_coa.1_a_salary_expense
- l10n_be.2_a_salary_expense
As the previous search for in_xml_ids was using a domain
('name', '=', 'a_salary_expense')
both records were returned, making in_ids to have one more record than out_ids
Followup of review made at odoo/odoo#31510closesodoo/odoo#31604
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
When creating a record from a calendar view,
the default form view is always used when using the popup mode,
ignoring the `form_view_id` attribute of the <calendar/> tag.
After this commit, the `form_view_id` is no longer ignored.
closesodoo/odoo#32379
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
- Set your fiscal year end date to 28th February
- Run the P&L a year before a leap year, e.g. anytime between March 1st
and December 31st 2019.
- Select 'Last Financial Year'
The dates are set from 2019-03-01 to 2019-02-28.
There are actually 2 bugs. The one solved here is the following
inconsistency:
```
current_date = type(date)(2019, 4, 3)
date_utils.get_fiscal_year(current_date, day=28, month=2)
'date_from': datetime.date(2019, 3, 1), 'date_to': datetime.date(2020, 2, 28)
current_date = type(date)(2020, 2, 28)
date_utils.get_fiscal_year(current_date, day=28, month=2)
{'date_from': datetime.date(2019, 3, 1), 'date_to': datetime.date(2020, 2, 29)}
```
Both should return `'date_to': datetime.date(2020, 2, 29)`. This implies
that the period is recognized as `custom`, which is affected by the bug
solved in PR https://github.com/odoo/enterprise/pull/4006
opw-1949628
closesodoo/odoo#32366
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Steps to reproduce:
- Create a storable product P with a vendor V and a purchase price = 100€
- Set the category of the prodcut to automated and AVCO and set a price diff account on it
- Create PO for V with 10 P with a price_unit = 110€
- Confirm the PO and deliver 7 P with no backorder
- Change the ordered quantity of P to 9 on PO (and the unit_price will be set to 100€)
- Go on the delivery order and deliver 2 remainig P
- Create the invoice and validate it
Bug:
The amount due on the invoice was 900.02€ instead of 900.00€
PS: The debit and credit of an aml are computed with the price (defined in function
_anglo_saxon_purchase_move_lines) with the function _convert_prepared_anglosaxon_line
defined on model account.invoice. So rounding the price unit after the computation
of the price allows to keep the same total as the one computed for the PO.
opw:1951465
closesodoo/odoo#32345
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
When we go on a failed mail.mail and do "Retry" -> "Send Now", if there
is an existing notification that is not to the current user, we may get
an error or get the email in error.
This is because on a notification only:
- the superuser
- the targetted user of the notification
have write permission by default in Odoo.
So with existing notifications resending (by the mail.mail views, the
alternative mail.resend.message wizard works as expected) only worked
if they were current user's notifications or if user is superuser.
opw-1957730
closes#32346
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Test was relying on qty_to_consume getting saved when the produce form
is saved, a behaviour of the SSF which diverged from the actual
client.
After fixing the SSF to behave more in-line with the actual
client (don't save o2m sub-fields unless they're flagged as
force_save) the test is now visibly broken.
Fix it so qty_done is properly updated during wizard configuration /
edition instead of updating the in-database object directly.
closesodoo/odoo#32047
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
The SSF would correctly filter out readonly fields when saving a
toplevel form, however it could not remove readonly values when saving
o2m pseudo-records to the parent form (as these would be expected to
remain available for reading upon the next edition and whatnot), so
these values would get sent in 0/1 commands.
Filter out these fields during the parent / toplevel save call.
Complexity notes:
* evaluating readonly modifiers requires the entire record, so
unchanged fields still have to be written back to the parent form
and be filtered out when *it* is set up for save, an alternative
would be to store the `changed` and `readonly` flags alongside the
record dict, and have the post-process only override the
pre-computed readonly flag using force_save
* had to fix a test to match the new behaviour, the post-edition
states turns out to be in line with the client's behaviour (or how
it looks anyway)
Fixes#32019
The extra setup probably affects any o2m whose edition view itself
contains an o2m, but most likely to blow up entirely on models with
some sort of tree structure (parent/child relationship): the SSF
eagerly loads and setups the o2m's view, and the o2m's o2m's, ... ad
infinitam.
A better / cleaner fix would be to set up the subview on-demand (and
possibly cache it), but the rest of the o2m stuff is unlikely to work
correctly recursively so just don't recurse the o2m view setup at all
for now.
fixes#31458
Deprecated accounts are available in the reconciliation widget, while
they shouldn't be.
opw-1949667
opw-1945585
closesodoo/odoo#32304
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
OPW 1961781
The related field user_type_id on account.move.line was slowing down the ORW when whanging the type of an account. This field was almost never used except in account_reports.
closesodoo/odoo#32303
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Changed the error message when the user hasn't enough karma.
Add link to the FAQ to understand how to get more karma.
Task-ID: 1952473
Closes: #32161
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Rating Improvements on product page:
1) Now we display ratings filter in descending order which
is common behavior for eCommerce/Appstore sites
2) Stop scrolling to top while removing selected rating filter
3) UI improvements for mobile/tablet view
4) Percentage is rounded up to two decimal points so that
it does not look ugly
task-1850446
closesodoo/odoo#28245
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Currently, when we open the website on iPad, the navbar is not displayed
properly (systray items are overlapping on the website menu). This
commit fixes the issue by using '+' icon on the navbar top menus if
there is not ample space. This commit also converts multi company
selector with 'fa-building' and multi website selector with 'fa-globe'
icons on smaller screens.
task-1945020
closesodoo/odoo#32321
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
website_sale adds a call to sale_get_order to ~every website page (in
order to validate & display the shopping cart).
Before this change, this calls get_pricelist_available() and triggers
two different computations of property_product_pricelist on every page
even for a public user with no cart / SO. This, in turn, generates ~20
queries and adds 20ms (total) / 10ms (sql) to ~every page load.
Fix: early return if the user doesn't have an SO (either in session or
in DB) and we're not in a case where we want to force one.
Loading "/" with just website_sale installed on a new DB,
- before: 53 queries, 31ms ±5 (sql), 75ms ±5 (all)
- after: 32 queries, 21ms ±1 (sql), 53ms ±3 (all)
closesodoo/odoo#32492
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Purpose of this task is,
Default payment ref for wire transfer is confusing and not really helpful as it will induce encoding errors customer side
So, I removed modulo part in payment reference
Task Id : 1946656
Closes : #31853
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
currently, if the user selects Multiple prices per product
in Multiple Product Prices, the user cannot set product
directly from product.pricelist formview.
purpose of this commit is to make multiple prices par product
fromview quick editable and reflect that to the product.product formview.
Task-ID: 1904777
Closes: #30540
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Purpose of the task is when extra fee is activated on the payment acquirer,
the customer is no warned about extra cost when choosing the payment acquirer.
so display the extra fees on payment acquirer when doing the payment.
Related Task ID : 1845815
Closes : #31730
`res.partner.bank` is ordered by sequence, but:
- there is no default value
- there is no widget handle to set it
Therefore, methods such as `_get_partner_bank_id` might retrieve an
unexpected value.
To avoid this:
- we fallback to sort by ID
- we add a default value
- we add the widget handle
opw-1948964
closesodoo/odoo#32300
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Set a company on the inventory location
- Create a stockable product, FIFO, real-time, with a cost
- Receive a unit
The product stock value remains zero.
The fact that the inventory location has a company set should not impact
the product cost. This is useful when a scrap location as a company set.
The domain of move selection is incomplete. It should be, for the 'in'
moves:
- coming from a location without company, or an inventory location
within the same company
- going to a location within the same company
For the 'out' moves:
- coming from to a location within the same company
- going to a location without company, or an inventory location within
the same company
opw-1943384
closesodoo/odoo#31485
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
PRs #28645 and #31494 were not applied to 12.0, but there's no reason
not to, they should only fix things (make behaviours more in-line with
the regular client), and since o2m is an area where more fixes are
needed and it would be nice to have them in 12.0...
To be able to override the initialisation of the work orders states,
we put that in a function.
opw 1943674
closesodoo/odoo#31774
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
On user form view, when no employee is linked to the user, we want
to display a message to the HR Officer (only) with the possibility
to create the employee profile with prefilled information.
Task-1916925
closesodoo/odoo#29659
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
Since d77ce4c2a9, the feature of editing own employee profile was
added. It was complicated with the access rights point of view because the
hr.employee fields are protected (groups="hr.group_hr_user"). To allow editing
its own hr.employee, it was required to `sudo` the field_view_get of res.users
(as the profile form view is a res.users form view, with related field from the
employee).
- Bug
The problem is that calling `fields_view_get` as `sudo` each time breaks the `groups`
mecanism on res.users views (not only form view). For instance, adding a field
on the form view with a group will always make it visible as the `groups`check
is done in sudo mode.
- Solution
This commit tries to fix this matter but reducing the `sudo` usage to
- only form view (we don't want this to applied to every res.users view type)
- only for internal user
- only in the flow of the "self editing profile", by checking the current action
- only for the current user (avoid to get the profile of other res.users by
using the same action)
- Side effect
The `groups` mecanism is still breaking on the "my profile" form view, as the
`sudo` is still applied in that case. We might tolerate this as the view should
only be accessible for the current user.
This is not perfect at all, but cleaning that properly might involve to redevelop
this sensitive feature.
Task-1916925
Task #1949652
Some fields were renamed/moved around to improve the survey.survey
form usability.
closesodoo/odoo#31775
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is not needed (and not wanted) in saas~12.1 due to
07bef887af that convert field
`move_ids_without_package` to a computed field with an invert method.
The invert method writes on `move_lines`, which will recompute the value
of `weight` field correctly.
This reverts commit b2b395467f.
- Create 2 identical SO: one with a quotation template set, the other
without
- Validate them
- Go to the portal at `/my/orders`, access both orders
The order without template redirects to `/my/orders/<ID>`, while the
order with template redirects to `/quote/<ID>`.
Once the SO is validated, there is no reason to show a different page.
The redirection should only apply to non-validated SO.
opw-1925131
closesodoo/odoo#32262
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Since 2d970942ba it is possible among other improvments to have a
pricelist on all website if it has a "code" or is "selectable" and has
no specified website.
Following this, the default "Public Pricelist" is not associated to a
website but since it is not selectable and has no code, we would get no
pricelist on the website on default installation without demo data.
With this changeset, the "Public Priclist" is set to selectable when
website_sale is installed.
opw-1961069
closes#32254
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: Romain Derie <rdedoo@users.noreply.github.com>
After 5df4746c9a the error handling has
been changed inaccurately. This fix sets the error handling correctly.
closesodoo/odoo#32247
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
This branch brings several improvements related to the list view:
- grouped list views are now editable
- 'expand' attribute can be used to open by default the first level groups
- if there are a lot of groups, a pager is displayed (instead of having all
groups in the same page)
- when grouped on a many2one field, custom buttons (on the many2one
comodel) can be inserted in each group's header
- we can edit several records in a row in editable list views
- editable lists do not flicker anymore when switching a row to edit mode
- we can navigate through the cells in list views with the arrows (in
readonly)
Co-authored-by: Aaron Bohy aab@odoo.com
Co-authored-by: David Monjoie dmo@odoo.com
Co-authored-by: Martin Geubelle mge@odoo.com
Co-authored-by: Ravi Gadhia rga@odoo.com
Task 1915702
closesodoo/odoo#31756
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
With this rev., it is now possible to navigate with arrows in list
views (except when editing, as in this case hitting the arrows moves
the cursor in the input/textarea), and to expand/collapse groups
with keyboard navigation.
Part of task 1915702
This rev. adds params to the 'web_read_group' method, allowing to
search_read records inside each groups in a single RPC, instead of
doing a 'web_read_group' RPC followed by n 'search_read' RPCs,
where n is the number of opened groups.
Part of task 1915702
Before this rev., widgets were absolutely positioned in table
cells. This cause an undesired effect with text fields, as their
textarea overflowed and overlapped the next lines.
With this rev., wigdets are now statically positioned, and the cells
height and width don't change when switching a row to edit mode.
Part of task 1915702
This rev. changes the layout of *editable* list views to a fixed
layout. This means that we are now responsible of the width of
each column. To do that, we associate with each field type a
factor, and the higher the factor is, the larger the column will
be (w.r.t. the others). This default value can be overriden in the
arch.
The fixed layout allows to remove the absolute positionning of
widgets inside editable lists (done in the next commit).
Part of task 1915702
Co-authored-by: Martin Geubelle <mge@odoo.com>
From an editable list view, if you select several lines then change
a field, you are now asked if you want to apply the same change on
all selected lines. If you accept, a write is directly performed
(without applying onchange, as the records are reloaded and the view
re-rendered). If you decline, the classic behavior still occurs.
Part of task 1915702
It is now possible to put buttons in the list view group headers.
When the view is grouped by a many2one field, those buttons
appear next to the header title when the group is opened.
The buttons are specified in the views in a <groupby> tag in the
list arch, with the following structure:
<groupby name="groupedField"> <!-- must be a many2one -->
<button type="object" name="my_method" string="Button1"/>
</groupby>
It is also possible to add `field`, inside the `groupby` which can
be used for modifiers. These fields thus belong on the many2one
comodel, like:
<groupby name="partner_id">
<field name="name"/> <!-- name of partner_id -->
<button type="object" name="my_method" string="Button1"
attrs="{'invisible': [('name', '=', 'Georges')]}"/>
</groupby>
These extra fields are fetched in batch when grouping on the field.
Part of task 1915702