Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ADD] l10n_id: Increase decimal accuracy for reconciliation model #41000

Closed
wants to merge 1,205 commits into from

Conversation

@tdi-odoo
Copy link
Contributor

tdi-odoo commented Nov 28, 2019

amounts in Indonesian currency are 6 or 7 digits. So, when creating a reconciliation model we might need an amount like 0.001% but we can have up to 2 decimal digits

Task ID: 2080222

Current behavior before PR:

Desired behavior after PR is merged:

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

std-odoo and others added 30 commits Nov 4, 2019
Bug
===
The file "public_root.js" try to load "/web/webclient/locale/en_US" with ajax.loadJS
we do not have the address to the Odoo server, so we try to load the file locally
but this file might not exist on the website which is using the widget

Fix
===
Overwrite ``ajax.loadJS`` and ignore ajax loading
(also printing a warning message in the JS console)

Task #2081146

closes #41177

X-original-commit: 50f8508
Signed-off-by: std-odoo <std-odoo@users.noreply.github.com>
On the registry, the set `loaded_xmlids` maintains the list
of the xml ids loaded during a module upgrade.
(The <record/> nodes in XML data file)

According to the `noupdate` attribute on the node in the XML file,
an XML ID is added to the listn either:
 - If noupdate is set on the <data/> node, through `_load_xmlid`:
   - https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/tools/convert.py#L505-L510
   - https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/addons/base/models/ir_model.py#L1802
 - If noupdate is not set on the <data/> node, through `_load_records` and `_update_xmlids`:
   - https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/tools/convert.py#L578
   - https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/models.py#L4048-L4050
   - https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/addons/base/models/ir_model.py#L1793
   For this second case, `_update_xmlids` was called only when the condition
   `to_create or to_update` was met.

For records not set as `noupdate="1" in the XML data file,
but set to noupdate in the database
(e.g. manually set by a user),
the code goes trough the second path explained above (noupdate not set on the <data/> node)
and the condition `to_create or to_update` was not met
(See https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/models.py#L4005-L4012)
and they were therefore not added in the set `loaded_xmlids`

Besides, the method in charge to validate standard views `_validate_module_views`,
only validates views that are in this list `loaded_xmlids`:
https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/addons/base/models/ir_ui_view.py#L1194-L1210

And the method in charge to validate custom views `_validate_custom_views`
only validates views with no XML ID or the module of the XML ID is not within the list of modules.

Therefore, standard views set to noupdate in database were not validated at all
(or indirectly, if they had a view inheriting on them that was not set to noupdate)

This is not a recent regression, this is the case even in Odoo 8.0.
Standard views set to `noupdate` in database but not in the XML files
were not validated (or indirectly, through one of their inherited views if they had any)

This revision just skips the test `to_create or to_update` so it goes through
`_update_xmlids` anyway and add the xml id to the `loaded_xmlids` set,
so standard views set to noupdate in database finally gets validated.
Besides, `_update_xmlids` won't do anything more than add the xml id to the set,
the SQL query executed in this method has a `WHERE` condition filtering out xml ids set to noupdate
https://github.com/odoo/odoo/blob/eb02e9b3e00243bcf8a41b0f42273e59875ab968/odoo/addons/base/models/ir_model.py#L1784

closes #40207

Signed-off-by: Denis Ledoux (dle) <dle@odoo.com>
Reproduce the issue:
- Install eCommerce app
- Publish a product to your website
- Add the product in your cart
- Unpublish/make unsellable/archive the product

The product is still in the cart and the checkout process can be done.

Cause: There is no check for invalid products before displaying the cart

This commit remove the invalid products while loading the cart.

OPW-2092541

closes #40241

X-original-commit: ab9290e
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
When creating sale order lines from the matrix (sale_product_matrix),
the purchase_price weren't computed

No cleaner change has been found to ensure the cost is computed.

Triggering all onchanges from the server side is quite tricky and dirty
to do...

closes #40986

X-original-commit: 5c15b13
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
This commit adds support for displaying 'VAT' field in a 'contact'
widget used in qweb views.

This commit also does the necessary changes needed for behavior
improvements of report editor in studio. For more information,
see odoo/enterprise#6543 or task pad.

task-1904639

closes #39722

Related: odoo/enterprise#6543
Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
Task 2085023
* Add a field that replaces the context to get the ids of the
entries/invoices
* Remove move_id, we can use move_ids instead
* Add text to explain invioces/bills will create refunds

closes #38857

Related: odoo/enterprise#6263
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
Conditional expressions were already parsed, but there was no support
for executing them (or stringifying them back though I'm not sure when
that's used).

closes #40502

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
closes #40805

X-original-commit: c0f261f
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
The field user_id was created twice in the model with the same values and options, only a different help message. This removes the duplicated one.

closes #40542

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
* No api model for methods using self
* Use new orm abilities to cleanup map_tax method
And adapt to get_fiscal_position changes

closes #40336

Related: odoo/enterprise#6840
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
closes #40592

X-original-commit: d8bc17d
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
When you create a pos order, it is possible that the request timeout or
the client loose the connection with the server, that will lead to not
have the server_id of the order sent to the server. So when the client
will try to synchronize the order again, it'll not send the server_id to
the server, and the server will create a new order which is a duplicate
of the one created when the client lost the connection.

To avoid this duplication, we are using the pos_reference to find if
there is an existing order like in 12.0 to avoid duplication.

closes #40837

Task-id: 2127656
X-original-commit: cddf29e
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
as we cannot do the test in product_matrix, add the purchase equivalent
in purchase_product_matrix to also test the matrix in this case.

X-original-commit: 9d7024a
In this commit set date field as a date and set it on the lower
right corner.

task-id:1970451

closes #32968

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Reproduce the issue

    - Install CRM & sale_crm
    - Create an opportunity
    - Create a quotation from the opportunity

    The name of the draft is the opportunity's name instead of "New"

    - Add a "Storage Box" to the quotation, for instance
    - Confirm the quotation
    - Check the delivery note

    The name of the delivery note is the opportunity's name instead of
    WH/OUT/...

Cause

    This issue is caused by 4c9c249. It seems that we pass an extra
    default_name in the context.

This commit removes the extra default_name from the context.

OPW-2122928

closes #40943

X-original-commit: e8d91e4
Signed-off-by: Jason Van Malder <jasonvanmalder@users.noreply.github.com>
Removed by mistake by ec603e2

closes #40676

Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
before this commit:
when creating a product from frontend and editing the product and
delete image, it doesn't get any url thus generating the traceback.

after this commit: if url is not defined then return None from
ir.qweb.field.image field converter

task-2063293

closes #40866

X-original-commit: 2efad75
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Purpose
=======

Currently, it is only possible to have 1 level of sub-tasks per task.
The user may want several levels of granurality.

Specifications
==============

Allow having multi levels of sub-tasks
- Move the parent_id field out of the debug mode and display it above the
  Deadline field
- Remove the 'parent task' stat button
- Add the parent_id field to the project.task optional list view
- Display the sub-tasks stat button on sub-tasks
- The 'sub-tasks' stat button should only count/display tasks from the
  first level of sub-tasks
- The name of the sub-task should be
  parent task: sub task level 1: sub task level 2: sub task level 3...
- The sub-task should be created in the sub-task project set on the
  parent task's project
- The subtask_planned_hours and the subtask_effective_hours fields should
  take into account the planned hours of all sub-level tasks

TaskID: 2107078
closes #40332

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
In case the Stripe API call fails, an Internal Server Error page is
displayed to the user, which is not user friendly.

opw-2126196

closes #40678

X-original-commit: 95a452f
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
No justification, commit message not linked to the diff.
If there is an issue in the line_number extraction it must be
investigated.
I suspect an outdated polib version.

closes #40684

X-original-commit: 0f92dae
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
Before this commit, calling gengo_authentication (executed from the
cron _send_translation_terms) returns an error when the python library
gengo is not found on the system.
If tried to request a synchronisation, got an error "NameError: name
'Gengo' is not defined"
Gengo variable was undefined as no imported.

closes #40686

X-original-commit: 675b355
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
closes #40683

X-original-commit: 5a70175
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
ryv-odoo and others added 8 commits Oct 11, 2019
PURPOSE

Improve mail template preview wizard by improve its views and displaying
more rendered fields. It helps users knowing what will be sent to customers.

SPECIFICATIONS

Rename template model to mail_template_preview to better match the mail
template namespace.

Remove _inherit on mail.template and instead choose fields to compute
and display. Indeed lot of fields are unnecessary or badly computed.
Instead just add fields on the wizard that depends on mail template
and will be computed based on mail_template_id field of wizard.

Improve error management.

LINKS

Task 2085912
PR #38708

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Purpose of this commit is to improve livechat demo mode by adding conversations
spanning on several months and with ratings and different operators. That way
we have beautiful data to show in demo mode.

Task ID 2075287
PR #37355

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Kpartx did not erase the mapping correctly
Now we delete the mapping directly in "/dev/loopx"

X-original-commit: a33482e
Renames the file created by the build,
from "posbox.img" to "iotbox.img"

closes #41190

X-original-commit: 3abe39e
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
- the oderpoint_id field on the purchase order line wasn't used to not
  merge the po lines
- if the orderpoint_id field is set, use the orderpoint location to
  create the move
- if multiple stock moves with different source locations go through
  `_merge_moves`, they should obviously NOT be merged
- `virtual_available` computed field was not being invalidated when the
  context keys "warehouse" and "location" changed

task-2001462

closes #40573

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Configuring the non-root logger based on --log-level had the
side-effect (unclear whether it was intended or not as none of the
relevant commits really documented the idea) that log-level could
override log handlers being set on the root logger e.g. if
`log_handler = :INFO` is set in the config file, `--log-level=warn` on
the CLI will override it.

This could be replicated by swapping `pseudo_config` and `logconfig`,
*however* it would also make the sub-loggers override
differently (currently on an exact logger match log-handler overrides
log-level).

The ideal fix would likely be to sequence log-level from the
configuration file, log-handler from the configuration file, log-level
from the CLI and log-handler from the CLI. However that doesn't really
work with the current structure.

closes #41180

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
closes #41186

Related: odoo/enterprise#6989
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
After commit odoo/enterprise@8a38a60
mobile tests didn't run correctly because of missing viewport META in HEAD.

This commit add the missing META. This META must be before all
JavaScript file to ensure that JavaScript also know that we work in
a viewport.

Note that "runbot" run tests in a chromium headless with a size screen
reduced and so it worked without this fix.

closes #41183

Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Dec 2, 2019
svs-odoo and others added 13 commits Nov 28, 2019
Move the method `_prepare_purchase_order_line` from 'stock.rule' to
'purchase.order.line'. The purpose is to reuse it in approvals_purchase.

task-2040710

closes #41046

Related: odoo/enterprise#6702
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
In the case of deletion with `ondelete="set null"`, return_path of
children of deleted record will not have return_path updated.

So remove the children recursively.

Another fix was done in 13.0 to avoid most issue in 6d5cd8b.

opw-2148046
closes #41075

closes #41178

X-original-commit: 6d5cd8b
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Previously, when grouped by state, user was able to drag
and drop kanban boxes to alter the state of an unbuild, a
purchase requistion or work order. However the state should
be readlonly and could only be modify via public methods on
those objects. Those methods do additional required stuff than
just modifying the state.

task-2087309

closes #40759

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Fine tunning of 07f70e3

closes #41194

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
… in mail

PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFCIATIONS

Move description from website_mail directly to mail. Anyway it is a
non stored computed field and therefore having it available directly
in mail does not cost anything.

LINKS

Task ID 2071556
PR #38692
…e to is_internal

PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFICATIONS

Website mail defines a website_published field allowing to publish / unpublish
comments on the frontend of some modules. This field has several drawbacks :

  * it is used only for front-end people (portal, public) and has no real
    effect in chatter / classic discussions;
  * it is used only in some advanced front-end module and is not available
    in portal by default;
  * its naming is not really correct as it is not linked to fields coming
    from the website_published mixin and its behavior is not really
    the same;
  * its use is a bit duplicated with internal flag coming from subtype
    allowing to hide messages related to an internal subtype;
  * there are overrides of standard mail.message methods just to handle
    this flag;

In this commit we change that field by an is_internal flag directly on
mail.message model itself. It tells if share people (customers, share users)
are allowed to read the message. This field can be given through posting
API or set manually using widgets. It is also used in access rights custom
methods and managed like the internal flag of subtypes.

Mailgateway was already using an internal flag for internal note replies. It
is renamed to is_internal and propagated as it is now a standard field. It
also eases code understanding.

Portal is updated to allow managing the flag directly. It means customer portal
now natively allows to moderate customer comments without any need of website
modules.

Rating is updated accordingly. An is_internal field is added, replacing the
related on website published.

LINKS

Task ID 2071556
PR #38692
…ype_xmlid

PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFICATIONS

In order to be more explicit subtype parameter is renamed to subtype_xmlid.
It therefore clearly indicates it should be a valid subtype Xml ID. Support
of ill formatted Xml IDs is removed because there is no reason to try to
add some random prefix. Give something that exists or go to hell, punk !

LINKS

Task ID 2071556
PR #38692
PURPOSE

Clean posting process and improve mail.message definition and comprehension.

SPECIFICATIONS

In this commit we use the is_internal flag to correctly propagate it from
mail gateway and clean some parent check. In this commit some code is cleaned.
No functional change should occur with this commit.

LINKS

Task ID 2071556
PR #38692
… groups for notification

Some override of ``_notify_classify_recipients`` may not check that groups
is None and expect a (maybe void) list.

Task ID 2071556
PR #38692
PURPOSE

Clean posting process and improve mail.message definition and comprehension.
Move as much possible content from website_* modules to portal_* modules
to ease their use in customer portal

SPECIFICATIONS

Now that publish feature is replaced by internal directly in mail and portal
rating portal inclusion can be done safely in a portal_ratign module instead
of website_rating. It allows to remove the dependency and give the rating
feature of customer chatter directly in portal applications.

LINKS

Task ID 2071556
PR #38692
PURPOSE

Clean posting process and improve mail.message definition and comprehension.
Move as much possible content from website_* modules to portal_* modules
to ease their use in customer portal

SPECIFICATIONS

Now that website_rating is now portal_rating, let us update translations
files accordingly.

LINKS

Task ID 2071556
PR #38692
Purpose of this commit is to add some missing fields in message view, notably
is_internal newly added flag and its ratings. Rating form view is also
updated to display is_internal flag, and form view is a bit reorganized.

Task ID 2071556
PR #38692
Currently discuss post (through mail or sms) does not allow the author
to be notified of its content, as

  * he posted it and is therefore already updated;
  * it could create email loops;

However with SMS one could easily try to send SMS to himself using the
sms composer that is different from the mail composer. In that case
just use the ``mail_notify_author`` context key allowing to bypass the
"no author notification" rule.

Task ID 2091685
PR #40650

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
@robodoo robodoo added CI 🤖 and removed CI 🤖 labels Dec 2, 2019
PURPOSE

Clean posting process and improve mail.message definition and comprehension.
Move as much possible content from website_* modules to portal_* modules
to ease their use in customer portal without having to depend on website.

SPECIFICATIONS: MAIL.MESSAGE DESCRIPTION

Move description from website_mail directly to mail. Anyway it is a
non stored computed field and therefore having it available directly
in mail does not cost anything.

SPECIFICATIONS: MAIL.MESSAGE WEBSITE PUBLISHED

Website mail defines a website_published field allowing to publish / unpublish
comments on the frontend of some modules. This field has several drawbacks :

  * it is used only for front-end people (portal, public) and has no real
    effect in chatter / classic discussions;
  * it is used only in some advanced front-end module and is not available
    in portal by default;
  * its naming is not really correct as it is not linked to fields coming
    from the website_published mixin and its behavior is not really
    the same;
  * its use is a bit duplicated with internal flag coming from subtype
    allowing to hide messages related to an internal subtype;
  * there are overrides of standard mail.message methods just to handle
    this flag;

In this merge we change that field by an is_internal flag directly on
mail.message model itself.It tells if share people (customers, share users)
are allowed to read the message. This field can be given through posting
API or set manually using widgets. It is also used in access rights custom
methods and managed like the internal flag of subtypes.

Mailgateway was already using an internal flag for internal note replies. It
is renamed to is_internal and propagated as it is now a standard field. It
also eases code understanding.

Portal is updated to allow managing the flag directly. It means customer portal
now natively allows to moderate customer comments without any need of website
modules.

Rating is updated accordingly. An is_internal field is added, replacing the
related on website published.

Also rename subtype parameter of message_post to subtype_xmlid. In
order to be more explicit subtype parameter is renamed to subtype_xmlid.
It therefore clearly indicates it should be a valid subtype Xml ID. Support
of ill formatted Xml IDs is removed because there is no reason to try to
add some random prefix. Give something that exists or go to hell, punk !

Finally mail.message and rating.rating form views are updated to include
is_internal flag and perform some view cleaning. An entry of ratings in
Technical/Discuss is added for debugging / management purpose.

SPECIFICATIONS: MOVE WEBSITE RATING TO PORTAL RATING

Now that publish feature is replaced by internal directly in mail and portal
rating portal inclusion can be done safely in a portal_rating module instead
of website_rating. It allows to remove the dependency and give the rating
feature of customer chatter directly in portal applications.

LINKS

Task ID 2071556
PR #38692

Related: odoo/enterprise#6410
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
@robodoo robodoo added the CI 🤖 label Dec 2, 2019
@tdi-odoo tdi-odoo closed this Dec 3, 2019
@robodoo robodoo added closed 💔 and removed CI 🤖 labels Dec 3, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
You can’t perform that action at this time.