Assume that model A has a computed field G that depends on both fields
F1 and F2. Assume that model B inherits from A (_inherits). When G is
computed during an onchange, it must use the form values for all its
dependencies F1 and F2. Before this commit, only the field triggering
the onchange was assigned on the parent record (see (*) below.)
record parent
--- ------------+-------------+------------
initial state | F1=0, F2=0 | F1=0, F2=0
assign F1=1 | F1=1, F2=0 | F1=1, F2=0
assign F2=2 | F1=1, F2=1 | F1=0, F2=1 (*)
The commit also includes another patch: when assigning the parent
record, the ORM determines the dependent records (in this case, the main
record in the onchange). If the delegate field (many2one from B to A)
has an inverse one2many field, the ORM uses that field to determine
dependent records. However, in the case of a new record, that field is
not in cache, and its value is determined to be... empty! The patch
consists in "fixing" the value of that field when we determine the
parent record (when the delegate field is accessed.)
Part-of: odoo/odoo#76042
Co-authored-by: William André <wan@odoo.com>
Commit [1] introduced a "hack" to transform `'NULL'` values into `null`
values in some maps as normally-defined `null` values are automatically
removed (replaced by a fallback). This hack did not need to be general
and in web_editor but can rather be confined to website only for the
user palette maps (especially since the fix made by the parent of this
commit here).
[1]: https://github.com/odoo/odoo/commit/a48a30f954afcb6ff3a59c4f32b05fd0c2cfcd2bclosesodoo/odoo#76033
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When [1] was introduced, we prevented to define a 'null' value for a
parameter P in a palette and forced a fallback to a default value X
defined in a "base" palette (value X which could be null). That allowed
to ensure that all final palette values were consistent as always
fallbacking to a "safe" value. However, since then, we introduced [2]
which makes it so a parameter P in the "base" palette is defined to X
(not null) while null is a valid value for P. We could keep the old
system and define that paramater P to a 'null' value in the "base"
palette and add the default X value in all palettes explicitely... but
with this commit we are choosing to be less tolerant (but in fact more
tolerant to custo) and rely on the fact palettes are well defined with
valid values (e.g. not defining a value to null while only X or Y are
allowed for example). Indeed, an exception for the "null" value did not
make much sense: if only X or Y are allowed as value for a parameter P,
setting a random Z value was not prevented, only null was.
[1]: https://github.com/odoo/odoo/commit/05d17089c4a604cb49f1a263b68f39aeffecccda
[2]: https://github.com/odoo/odoo/commit/a48a30f954afcb6ff3a59c4f32b05fd0c2cfcd2b
Part-of: odoo/odoo#76033
Currently, when we try to shorten the links from content with help of
`_shorten_links_text` method, it throws traceback if the body(content)
we pass is `False`(might happen when we directly pass a model field of
textual type but the field doesn't have a value yet). It's because
the `re` expects the content to be string / bytestring.
This commit fixes the issue by adding a check in this method, which
will simply return `False` if there's no body.
Task-2628586
closesodoo/odoo#76041
X-original-commit: 3cc5217f1196108d5c7a52202054263a480963b2
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose is to add some tests for newly added feature logging portal access
granting. Some code is also cleaned to avoid unnecessary computation when
groups are not modified on user model.
closesodoo/odoo#76040
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Bad debt accounts should be of expenses type like the ones in the l10n_de_skr03 addon
opw-2512526
closesodoo/odoo#76039
X-original-commit: 5780e50c0baf7c4b0c2799c38fd532a6772f6a1d
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Hubert Van De Walle <hubvd@users.noreply.github.com>
When using module `account_invoice_extract`, it would happen that a
bank account of another company was set on the `account.move`.
This happened when the extract update was done in background via the
cron.
A check on the company of the bank account fixes the issue.
opw-2631833
closesodoo/odoo#76024
X-original-commit: 12559929a551c7f837facb8242333e9b0285950b
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Signed-off-by: Louis Baudoux <lobaudoux@users.noreply.github.com>
Since 29db699e9b, auth_top depends of mail module, which lead to delay auth_totp
installation - not during DB creation anymore. As mail module is not installed
during DB creation, once an app that depends on mail is installed after DB
creation, auth_top module is finally installed and the session token now depends
auth_top module. As a result, the user is automatically logged out.
This commit moves the invite mail (and the dependance to 'mail' module) to a
new bridge module. Auth_totp module will now be reinstalled during DB creation
automatically.
Task-2638538
Parent Task-2487630
COM PR: odoo/odoo#76022
UPG PR: odoo/upgrade#2808
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this commit, it was assumed that the call was still active when
the video permission was granted, this assumption was false and this
commit fixes this issue.
closesodoo/odoo#75999
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Here is the idea: when creating a view V that inherits another view, and
V only adds elements in the parent view, only the elements added by V
must be validated. The other elements are not modified, and thus do not
need to be validated again. However partial validation cannot be done
when modifying an existing view, or when the view replaces elements in
the parent view. In such cases, the method _check_xml() validates the
whole combined architecture.
The time spent in method _check_xml() to install a database from scratch
with module sale_management went from 2.730s to 2.243s (-18%), and the
number of queries made in the method went from 2283 to 1614 (-29%).
closesodoo/odoo#75796
Related: odoo/enterprise#20633
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Also speed up view validation by not calling fields_get when possible.
This avoids a call that is usually not necessary for validating a view.
Most of the time, fields can be found on the model itself. Only
overridden fields_get() with fake fields are actually useful, like the
one of model 'res.users'.
The time spent in method _check_xml() to install a database from scratch with
module sale_management went from 3.510s to 2.730s (-22%), and the number
of queries made in the method went from 2995 to 2283 (-24%).
Part-of: odoo/odoo#75796
Besides simple code improvements, remove node_info['attr_model'], and
check domain on specific elements. Also refactor _validate_attrs. The
changes have no impact on performance.
Part-of: odoo/odoo#75796
This makes it easier to optimize the algorithms for both cases:
postprocessing without validation, and validation without
postprocessing. Also factor out some common bits like the editability
of nodes.
The net result is a speedup in performance. The time spent in method
_check_xml() to install a database from scratch with module
sale_management went from 4.955s to 3.578s (-28%), and the number of
queries made in the method went from 3779 to 2995 (-21%).
Part-of: odoo/odoo#75796
This generalizes an existing optimization and saves a few time to
validate a view. The time spent in method _check_xml() to install a
database from scratch with module sale_management went from 5.145s to
5.044s (-2%).
Part-of: odoo/odoo#75796
Adjust the height of the HTML field for the email body
On the survey sharing email.
Regression introduced in 607c5ea4 (#75863)
task-2586137
closesodoo/odoo#76016
Signed-off-by: David Monjoie (dmo) <dmo@odoo.com>
*: extensions of `adyen_platforms`, namely:
- pos_adyen: remove related code, records, views, ...
- payment_odoo: remove the module
- sale_payment_odoo: remove the module
Modules related to Odoo Payments are already all merged since 14.0 and
14.4 (depending on the module). As the plan is to merge the final
version of Odoo Payments in 15.0 soon after the release, we want to
avoid all the complications that inevitably come with huge diffs, model
changes, XMLID collisions, etc. when merging in a stable version. Even
though it is possible to install these modules since 14.0, no
information could be lost during the upgrade since the entry point of
the application has never been activated.
task-2637770
closesodoo/odoo#75852
Related: odoo/upgrade#2804
Signed-off-by: Antoine Vandevenne (anv) <anv@odoo.com>
Co-authored-by: Antoine Vandevenne (anv)
The project overview is a significant technical debt
as it is a custom qweb view. It is quite limited:
- It is not possible to group the data, to filter on dates,
SOs or Field Service projects.
- Improving this is very difficult and would require weeks
of development that are not worth it.
In any case, all the information provided by the project overview
can be found elsewhere. The stat buttons of the report are basically
duplicates of the ones from the project form view.
Therefore, we are removing this report and its twin,
the Project Costs and Revenues.
In addition, analytic items lack context for the user to understand
what generated a certain cost or revenue:
- there is no link to the source document;
- the entries are not categorized (e.g. it is not easy to understand
if a cost comes from a timesheet cost, a purchase order or an expense);
- the billable type group by works fine for timesheets but then all
the other entries are flagged as Undefined, which is not very helpful;
- there is no option to easily isolate costs from revenues.
task-2545084
See odoo/enterprise#19250
See odoo/upgrade#2706closesodoo/odoo#72736
Signed-off-by: LTU-Odoo <IT-Ideas@users.noreply.github.com>
+ Added the 'Trusted Devices' feature
+ Added 'Remember this Device' checkbox on /web/login/totp
+ Added trusted device's OS / browser on Profile > Account Security
Added '2FA Trusted Devices' feature to allow users to remember their
device to bypass the 2FA for the next connections. The trusted devices
are displayed in a 'Trusted Devices' One2Many under the 'Developer API
Keys'. It is possible to revoke all the trusted devices at once with a
special button. It is also possible to revoke one at a time on the
desired one.
Task-id 2523092
closesodoo/odoo#75535
Related: odoo/upgrade#2800
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Co-authored-by: Martin Trigaux <mat@odoo.com>
On payment creation, when changing twice the payment's journal, if the
first journal already has some lines and the second one doesn't have any
lines, the payment name will be incorrect.
To reproduce the error:
1. (If present, delete all payments)
2. Create and save a payment P01:
- Journal: Bank
3. Create a second payment P02 (do not save it):
- Journal: Bank
4. Change P02's payment: Cash
5. Change P02's payment: Bank
6. Save P02
Error: The name of P02 is "CSH1/2021/08/0001", which would be correct if
it was a Cash payment. This error has a consequence: suppose the user
creates a third payment (journal: Bank) and confirms it, its name will
be "CSH1/2021/08/0002" (again, name linked to the incorrect journal)
On step 4, when changing the journal to Cash, since the latter hasn't
any payment, the server returns a new name ("CSH1/2021/08/0001"). Then,
on step 5, when changing back the journal to "Bank", since the latter
already has a payment (P01) and since the current record already has a
name ("CSH1/2021/08/0001"), the server doesn't change it and the
`onchange` response doesn't contain anything. As a result, when saving
the payment from the client side, the wrong name is included in the data
("CSH1/2021/08/0001"). Regarding the consequence: later, when creating
and confirming a third payment, the server will take the name of the
previous one in the same journal and will increment it
("CSH1/2021/08/0002").
OPW-2601668
closesodoo/odoo#75986
X-original-commit: 2024ff2b344d841cf775dbb14da9cc9e1e4c05e9
Signed-off-by: William André (wan) <wan@odoo.com>
Signed-off-by: Adrien Widart <adwid@users.noreply.github.com>
Steps to follow
- Install web_dashboard,website_sale
- Go to the eCommerce Dashboard
- Click on Favorites
- Click on Add to my dashboard
- Go to the Dashboard app
- Click on orders
-> A traceback occurs
Cause of the issue
`this.subscriptions.update` is undefined
opw-2630849
closesodoo/odoo#75984
X-original-commit: 8ab700fc8e51631663443b6c8e81db9669375d82
Signed-off-by: Hubert Van De Walle <hubvd@users.noreply.github.com>
Right after some module operation (install, uninstall), the framework
looks for some ir.actions.todo to execute. Currently those actions
cannot be found, because the cursor seems to see the database in the
state it was just before the operation. Simply add the commit() which
was removed by revision 1595c0ee27.
closesodoo/odoo#75980
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
The XML-RPC interface has a compatibility shim for binaries as
historically Odoo has returned "binary" data as base64 strings. To
avoid breakages during the Python 3 transition, the shim was
introduced to decode the output binary data (under the assumption that
it'd be ASCII-compatible).
In the case where the data is *not* ascii-compatible, however, it can
generate invalid XML documents: "C0" control codes (with the exception
of tab, LF, and CR) are not valid in XML 1.0 (which XML-RPC is an
application of), however they're perfectly valid string characters and
the standard library's marshaller does not check for them, embedding
them directly in the output document and breaking the client's
decoding.
Work around the issue by replacing such binary data with an empty
string.
While at it, move the bytes shim to the customized marshaller, this
way everything's at the same place and it's not necessary to waste
time trying to understand why the marshaller is just not calling what
it's supposed to call.
Fixes#61919closesodoo/odoo#75973
Forward-port-of: #75952
Forward-port-of: #74699
X-original-commit: 1a0b3f7
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
When using profiling on a fresh test database, it can be tedious to
access settings to enable the feature. This commit adds a wizard to help
enabling profiling without accessing the settings when trying to
activate profiling on a administrator session.
closesodoo/odoo#75967
Signed-off-by: Xavier Dollé (xdo) <xdo@odoo.com>
Improve the wizard 'import your first bill': usability + look & feel
- Removed the PDF viewer interface which was ugly + useless in this context
- Display an HTML preview instead which is dynamic
- Current date
- Company address depending on the Company
- bill sequence depending on the date
In the modal of upload, detect if there is no hosting domain @false > then remove this third option
PR #75815
Task: 2581377
Related: odoo/upgrade#2806
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
This commit enables tracking on vat, parent_id for the contact, because the
impact of changes of these fields are very important.
We also manually track portal status change. To avoid a costly computed
field, this is done through manually logging portal access change as a note
on the user partner's chatter.
VAT field naming is also updated to match view naming used in inherited
views.
TaskID-2586195
closesodoo/odoo#74692
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When generating some sale order/invoices pdf automatically (via cron for example), the format of the
invoice is not correct (missing style, background image, etc). The html used to generate these pdf's
misses the asset lines (link to css and js files).
The asset lines are not generated because the manifest cache (http.addons_manifest) is empty if we
render a pdf from a cron.
This commit will generate http.addons_manifest if it's not yet done before.
opw-2581621
opw-2597990
opw-2542242
closesodoo/odoo#75092
X-original-commit: 3ae4db7fc8dbc404984e34ac532426d6bf2c6a0f
Signed-off-by: Julien Castiaux <Julien00859@users.noreply.github.com>
Signed-off-by: ThomasBeckers <ThomasBeckers@users.noreply.github.com>
Prior to this commit, the case where the update status was not set is
not handled in the STATUS COLOR mapping.
This commit associate a lighten dark color to the unset update status.
See PR : #68899
See task-2393768
PR : #70527
task-2458135
Prior to this commit, the count distinct on move_id called in the read
group was not used correctly.
This commit uses the move_id:count_distinct result of the read_group,
which represents the number of distinct invoices.
See task-2469742
PR : #70527
task-2458135
This commit removes the sale_timesheet_purchase module which was meant
to extend project overview feature.
Since this feature is removed in previous commit, this bridge is now
useless.
PR : #72736
See odoo/upgrade#2706
task-2545084
This commit removes the project overview feature and views.
This commit improves the project updates right panel informations and
adds the buttons added in the project form view of this module.
/!\ This commit also improves the timesheet_invoice_type granularity
and precision.
The project overview view lacks of genericity and lacks of clarity
regarding the information to report.
PR : #72736
See odoo/upgrade#2706
task-2545084
This commit extends project form and panel in order to add buttons
which allow user to view documents linked to the project analytic
account.
This commit removes the computed field related to project overview
feature which is removed in the following commits.
This commit adds bridge modules in order to handle those extensions.
PR : #72736
See odoo/upgrade#2706
task-2545084
This commit extends project form and panel in order to add buttons
which allow user to view documents linked to the project analytic
account.
This commit adds bridge modules in order to handle those extensions.
PR : #72736
See odoo/upgrade#2706
task-2545084
This commit moves the Track cost setting from account to analytic in
order to use it in modules depending on analytic.
This setting is based on a group defined in analytic
(analytic.group_analytic_accounting), this group is not moved.
PR : #72736
See odoo/upgrade#2706
task-2545084
This commit removes the activities from the project update default
description.
This commit prepares the removal of the project overview feature and is
a part of the global project update description improvement.
PR : #72736
See odoo/upgrade#2706
task-2545084
This commit improves the project updates panel and the data reported
in the update description.
This commit prepares the removal of the project overview feature.
PR : #72736
See odoo/upgrade#2706
task-2545084
revert part of #4467734b77f19e3c4f4623e878d74c529a135bad
compute_qty_to_order is triggered manualy but not commited,
later in the scheduler task action_assign is call. However
product_id.stock_move_ids.state is a trigger of compute_qty_to_order
so it will be trigger a second time and deadlock itself
Also replace the cursor before procure_orderpoint_confirm,
so the procurement could have access to the data commited
by _compute_qty_to_order
closesodoo/odoo#75972
Signed-off-by: Rémy Voet <ryv-odoo@users.noreply.github.com>
Currently, if a test fails there's very high chances the DOM will not
be clean, because qunit doesn't have good cleanup APIs. This means a
test failure will always be prefixed by a dump of the page DOM which
is just confusing and makes it hard to find the actual error.
This change updates the OdooAfterTestHook handler to:
* Receive the `Test` itself, instead of adding more information to the
synthetic object it currently receives.
* Only show the leftover DOM if the test otherwise succeeded.
* Do the entire reporting via `pushFailure`, rather than having
duplication between an explicit `console.error` and a test failure.
* Update the QUnit.log handler to
- not show `undefined`
- try to improve readability by removing the bracketing and quoting
closes odoo/odoo#75951
Forward-port-of: #75939
X-original-commit: 8bceac8032f48ae77e8a2c0c038f3bc26489e0ac
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
- Add a new stand-alone page "WelcomeView"
- Redirect people who join using an invitation link to the WelcomeView
- Add microphone/camera preview
- Allow guests to choose a name from the WelcomeView
- Add "Start a meeting" button to the discuss sidebar
- Create a new channel on click on the "Start a meeting" button
- Display ChannelInvitationForm on click on the "Start a meeting"
button
- Add a new field to `mail.channel` in order to define the display
mode to use for videos (e.g full screen) when joining a meeting
Task 2494829
closesodoo/odoo#75899
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Before this commit, calling read_group on a model and grouping by a
selection field would return the groups in alphabetical order, meaning
that if your selection field's options were declared as:
('z', 'Z'), ('a', 'A')
read_group would return first group 'a' and then group 'z', instead of
groups 'z' and then 'a' which some might expect.
With this commit, it is now possible to set a fields.Selection
group_expand attribute to `True` when declaring it, which will use a
default group_expand implementation specific to Selection fields, this
means that when grouping by a Selection field with `group_expand=True`
it will always return the groups in the definition order of the
selection options.
We achieve this by leveraging the group_expand field attribute which was
designed for changing the groups returned by read_group.
Since this attribute was thought only to be implemented on a
Model-by-Model basis and here we need to use it as a generic function
for all Selection fields (explicit group_expand declarations have higher
precedence), the generic method has been implemented inside
fields.Selection and takes an extra records parameter which holds a
reference to the recordset/model on which read_group was called. This
extra parameter only applies to field implementations of group_expand
and in this case is what allows this specific feature to work with
dynamic Selection fields (function as options).
A side-effect of this implementation is that a read_group call that
groups by a Selection field with `group_expand=True` that uses the
default group_expand will always return all possible groups, even
empty ones.
Task-ID 2635052
closesodoo/odoo#75856
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
PURPOSE
Walk around in the CRM to improve some UI.
SPECIFICATIONS
- In Visit to Leads changing the icon from fa-handshake
to fa-star, Handshake is for the app, stars are for the leads
- CRM>Configuration>Tags
Updating the action helper to:
Create CRM Tags
Use Tags to manage and track your Opportunities (product structure,
sales type, etc.)
- CRM > Sales > Customers
Updating the action helper to:
Create a Contact in your address book
Odoo helps you track all activities related to a contact.
- CRM > Sales > Teams
- The grey bottom border in the Teams kanban card should appear only
when they have a invoice target.
- Increase the size of the alias in Teams kanban card a bit because it's hard
to read.
- The Teams kanban card is very meh if you have no data. So add some dummy
data.
- CRM > Configuration > Sales Teams
In Sales Teams list view add alias and avatar on the team leader.
- If you go CRM>Team>Pipeline, you get a strange action helper
Instead, display the normal Pipeline action helper one except the gateway
address is always the alias of the team.
- Sections should be the same for all columns in team kanban view.
if leads are activated, they should be in View, New & Reporting
Activities should be at the bottom of the Reporting list since it has no
counterpart.
- CRM > Sales > Teams (Select invoice from Kanban view)
added new action helper in Teams/Invoice.
- CRM > Reporting > Activities
Rename Action to "Activities" (no "Pipeline" because it's confusing).
LINKS
PR #73530
Task 2582208
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Usually, the actions are defined before the menu items. So with this
commit, we load the 'crm_menu_views.xml' file at the last.
TaskID-2582208
Part-of: odoo/odoo#73530