Issue
- Remove ~/.odoorc
- Launch a server
- Try to dump the db in db manager
Ok
- Restart the server
- Retry
pg_dump not found
Cause
When the .odoorc file is not there,
the pg_path option is not present so
the normalize method set it to None
When the server is restarted, it re-checks
the options (which are strings) and in the
normalize method we check "if not pg_path"
but 'None' is truthy so it thinks this is
a real path.
Solution
Check if not pg_path or if pg_path string
is None
OPW-2189789
closesodoo/odoo#45369
X-original-commit: f080964694c01a79c52e05c0ceb42c18d4c77df5
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Since wizards shall not be unlinked by anyone, but as we want to get rid
of this specific one immediately to get rid of eventual credentials,
do it with elevated privileges.
Before this commit, the behavior was an authorization error when trying
to applying the payment method, in a fresh invoicing configuration.
closesodoo/odoo#45363
X-original-commit: c8ee9c73d4ac9989d05843a32abc535b20d761b4
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
We cannot assume reading the value of a monetary field has the
decimals specified by the currency in decimal_places.
Right after creating a record with a monetary field it may have a
different amount of decimals.
To reproduce this:
>>> tx = env['payment.transaction'].create({
'amount': 10.87,
'acquirer_id': env['payment.acquirer'].search([], limit=1).id,
'currency_id': env.ref('base.USD').id,
'reference': 'test'
})
>>> tx.id
130
>>> tx.amount
10.870000000000001
<Restart odoo>
>>> env['payment.transaction'].browse(130).amount
10.87
Authorize requires us to send a correctly rounded amount. The
following response is returned when sending 10.870000000000001:
{'messages': {'message': [{'code': 'E00027',
'text': 'The transaction was unsuccessful.'}],
'resultCode': 'Error'},
'transactionResponse': {'SupplementalDataQualificationIndicator': 0,
'accountNumber': '',
'accountType': '',
'authCode': '',
'avsResultCode': 'P',
'cavvResultCode': '',
'cvvResultCode': '',
'errors': [{'errorCode': '5',
'errorText': 'A valid amount is '
'required.'}],
'refTransID': '',
'responseCode': '3',
'testRequest': '0',
'transHash': '',
'transHashSha2': '',
'transId': '0'}}
To work around the issue always round when we read amount.
Lower level solutions were considered in #45248 but for now we'll
stick with this higher level and lower risk patch.
opw-2188889
closesodoo/odoo#45362
X-original-commit: 7485927f0eb152086efcaaf4a30260e503267c41
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Stock introduces the option 'product' for the field `type` of the
`product.template` model.
If there exists records for this model with the aforementioned option
selected when the stock module is uninstalled, the records will remain
in the database for an indefinite amount of time, all while pointing to
an option that does no longer exist (except if the record was created by
the stock module itself), making the registry inconsistent and
eventually leading to a crash.
This is a known limitation of the ORM regarding Selection fields and
more specifically the `selection_add` mechanism, no "generic" solution
has been chosen thus far because it is not always clear which approach
should be taken:
1) Delete the record?
2) Set the option to a fallback, base option?
3) Something else handled by the module itself?
...
In this case the second approach has been chosen and whenever the module
stock is uninstalled, all remaining product.template records of `type`
'product' will be reset to the default option defined by the field,
which as of this commit is 'consu'.
See opw#2193814
closesodoo/odoo#45341
X-original-commit: a84b2829c5fac9e2b0d8cb49a4e7aa73f7e0e2b2
Signed-off-by: Adrian Torres (adt) <adt@odoo.com>
We recently transitioned to async option methods, this allows us to have
better control on the order of execution in the edition workflow, and
among other things, keep the editor's UI in sync with the current state
of the DOM.
However, some snippet options (such as the number of columns option)
need to remove or clone portions of the DOM, and as such, trigger the
onClone or onRemove methods of the snippets contained in that portion if
applicable. Because these methods are defined on other options, we first
need to make sure all the snippetEditors for this portion are created,
which is asynchronous.
This commit adds support for an onSuccess callback to the
'clone_snippet' and 'remove_snippet' event handlers, such that options
can choose to be notified when the work has been done, allowing them to
wait for it before proceeding.
This commit also adapts the layout_column snippet option to make use of
that new feature, and remove code that was used as a workaround before,
ie: precomputing the expected number of columns after the clone/remove,
and using that number to adjust the width of the columns and update the
UI. We can now just wait for the clone/remove, and use the real number
of columns currently in the DOM.
closesodoo/odoo#45343
X-original-commit: c159d58ce9cfca4a44f159b18eb10d1138977e23
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Steps to reproduce:
- install accounting
- go to the accounting main view and hover some of the graphs
Previous behavior:
rounding was inconsistent and would lead to weird js floats
like 65.00000000000001
Current behavior:
floats are rounded to 2 digits after
opw-2172686
closesodoo/odoo#45336
X-original-commit: c00f4962eb790787fffef99595ac14dbef026055
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Since 94a3919, the report_location_barcode.scss asset is never loaded.
The report_stock_rule has the same template id than the report_location_barcode
one. This later is so always overridden.
This commit delete the barcode location css as it was not really usefull
closesodoo/odoo#45340
X-original-commit: 9b610d066d25007561ac469f7caf5919c0aa4092
Signed-off-by: William Henrotin <Whenrow@users.noreply.github.com>
The many2one_reference is not a field that makes sense with the
form builder.
part of: https://github.com/odoo/odoo/pull/45280
task-2196797
closesodoo/odoo#45339
X-original-commit: 3e61ca5008e19c36aacedf57836dbd4369607e45
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The original existing fields could be altered once retrieved from the
database. Now we make a copy once we use them to prevent any alteration.
part of: https://github.com/odoo/odoo/pull/45280
task-2196797
X-original-commit: 2951c288ff839ccdf1740cac84dece96823eed8f
UniqueId was not set correctly on multipleInputs
part of: https://github.com/odoo/odoo/pull/45280
task-2196797
X-original-commit: 387b8d698ffd599693fe9feaa9be87e19e3549ab
When some existing taxes are defined with amount_type = "code",
the module uninstallation will leave the current data inconsistent.
Add an uninstall hook archiving the given taxes, logging the problematic records ids.
Fixes#45240closesodoo/odoo#45338
X-original-commit: 16e000b5dcc93a3c90a7d1b6d9d9a6097d5a9849
Signed-off-by: Victor Feyens (vfe) <vfe@odoo.com>
`action_explode` unlinks the kit move and create the stock moves for the components.
As the `create_multi` is not used, it results in lots of delays. Use the `create_multi`.
closesodoo/odoo#45326
X-original-commit: 4818ee61b4f23ab7b388acd2bdd452c27e25fc0d
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
`action_explode` is called when confirming the moves of a picking. It
calls unlink() when the move contains a kit. As this method is not
multi, when confirming 50 kit moves, unlink is called 50 times resulting in
a lot of cache invalidation, prefetching and so on.
We make `action_explode` multi in order to call one time `unlink` per
kit levels.
X-original-commit: 096c682e748f7e581e48f0070ec8a3284d8a2fe7
The purpose is to force developers to explicitly manage the removal of
field via migration scripts.
closesodoo/odoo#45269
Related: odoo/upgrade#777
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
- Simplify the DOM
- Add option to move rows in timeline snippet
- Add data-name to timeline snippet
Part of https://github.com/odoo/odoo/pull/44980
task-2182907
PURPOSE
This refactoring commit removes the crm.partner.binding mixin. Indeed it
defines a mixin for unnecessary fields, generally either redefined in
inheriting models, either not used at all. It also holds an utility method
we moved directly on crm.lead model.
SPECIFICATIONS
Code move
* move _find_matching_partner to crm.lead model;
* move action field into inheriting models, except crm.lead.convert2ticket
that does not use it;
* move partner_id to inheriting models;
* remove crm.partner.binding model and inheritance;
Improve behavior
* correctly store lead and partner many2one fields on all inheriting
models. It allows to support a default_lead_id instead of always
relying on active_model / active_id, making the wizards more generic;
* update default_get accordingly in various inheriting models in order to
correctly compute lead / partner values;
LINKS
Part of Task ID 2056759 (remove crm.partner.binding mixin)
Part of Task ID 2088565 (crm onchange -> compute)
Community PR odoo/odoo#44970
Enterprise PR odoo/enterprise#8307
Upgrade PR odoo/upgrade#750
Related: odoo/enterprise#8307
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Co-authored-by: David Beguin <dbe@odoo.com>
Co-authored-by: Thibault Delavallée <tde@odoo.com>
Hiding fields when they are void is not really helpful.
Spotted when working on task ID 2056759 (remove crm.partner.binding mixin)
Community PR odoo/odoo#44970
Enterprise PR odoo/enterprise#8307
Purpose of this commit is to clean mail and SMS composer calls in website_crm
and website_crm_sms by separating composer preparation (context, values) from
customer preparation (check valid data exists, creating partner).
Indeed most of message composer code is based on records having a partner_id
correctly set, unless some templates are used that dynamically creates the
partner. SMS composer is more tolerant and check for phone / mobile numbers to
use.
By the way we make the action name translatable, because why not.
LINKS
Spotted when working on task ID 2056759 (remove crm.partner.binding mixin)
Community PR odoo/odoo#44970
Enterprise PR odoo/enterprise#8307
Usecase to reproduce:
- Create a product MTO manufacture with a BoM
- Set produce delay as 1 day.
- Create a SO for the product and validate
The production order is created but with a duration of 1h.
It's due to commit 8944674d6d
It will use the moves finished date in order to determine the MO
finished date. However before this commit during _run_manufacture
the MO was created with a fix finished date and the move finished
date_expected was created with this date as date_expected.
Now the MO is created with the finished date, the inverse does
nothing since the finished moves do not exist yet.
In order to fix it, generate move_finished_ids use the product/company
manufacture delay. A first patch tried to rewrite date_planned_finished
after action_confirm. However it triggers the propagate date on
following moves.
closesodoo/odoo#44532
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
Usecase to reproduce:
- Create a product with 10 days manufacture lead time
- Create a procurement in order to fullfill a need the 01/15
The MO start date is the 01/05 that's the expected values
The MO finished date is the 01/05, 1 h later than the start date
It happens due to commit 92aeaa47ff
This commit modified the wrong start date in order to take the
procurement date - manufacturing lead time. However it also
modified the finished date to 'the start date + 1h'. That returns
the problem to the opposite direction. Now the finished moves have
a wrong planning.
Fix it by using the production + company lead days when it's set
instead of 1h.
opw-2181962
X-original-commit: 6a5ce8de91d3ab2cb7f73127a6ee1c11578ccef9
since it is now implemented by 020e2a5e85closesodoo/odoo#45309
X-original-commit: d8c916112aa943712bbb93f1aa1ac59da2aa9524
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Some functions defined in this file use another function present in the
same file through "this" keyword even if it's not needed.
This cause problems when these function are required in another file
using object destructuring.
This commit fix this issue by calling the function only by its name.
closesodoo/odoo#45299
Signed-off-by: Sébastien Theys (seb) <seb@odoo.com>
Due to the infamous web_editor revert, summernote assets filesa are once
again created and stored in DB, but because they do not contain
'assets_' in their name, they would show up in the media dialog. This
commit fixes that by prefixing the created summernote assets file with
'assets_'
closesodoo/odoo#45298
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
The `unit_amount` is a `Float` field with `digits='Product Price'`.
Therefore, keep the number of digits of the field, not of the currency.
opw-2188646
closesodoo/odoo#45293
X-original-commit: 88f162ec5c87e50a3ba0f7a050ebf3778bc0c157
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Works correctly on virtual records during onchanges, notably. Since the
data was obtained from a read_group using the ids of self, virtual
records never could find any of their data.
closesodoo/odoo#45264
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Before this commit, the behavior of the phone widget was tested in web
as if it was always altered with module SMS
Giving wrong test results when sms module was not installed
After this commit, the separation is clearer, and the phone widget's
behavior is tested according to the modules it is altered by
closesodoo/odoo#45271
X-original-commit: 2e337516468797dd898c79c9669b5a90c83b56a7
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Update demo data on leads to make more senses
with the utm fields, tags and the lead itself.
task-2189667
closesodoo/odoo#44832
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The purpose is to allow the user to choose if he want to display or not
information about the campaign, the source and the medium. This field
are now available as optional field for the tree views of opportunity
and leads.
task-2189667
Purpose
=======
Improve the state creation flow.
Some users created states by mistake, we want to avoid this situation.
Specifications
==============
Do not allow to create country from the partner form view.
Disable the quick create of the state in the partner form view.
When we create a state from the partner form view, set by default the
country of the state to the country of the partner.
Task 2178289
closesodoo/odoo#44291
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Issue
- Install Time Off & Studio
- Set up your language to English with format date
to %d/%m/%y instead of %m/%d/%y
- Enable Kanban view in Time Off dashboard with Studio
- Compare Kanban and List view
The list view dates is correctly formatted but not
the kanban view dates
Cause
We use momentjs which doesn't take the user date format
in account, only the locale.
Solution
Use a field with datetime widget which handle this case.
OPW-2195584
closesodoo/odoo#45272
X-original-commit: 69b3578b3d00c8b6284c40f91ffb117a8bd3eec4
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The t-if condition using "online_sync" couldn't be there...
"online_sync" condition must be present in
account_online_sync module and not account module.
closesodoo/odoo#45263
Related: odoo/enterprise#8404
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
Delete the uom 'kg'(kilos, kilograms), open a product form view
Traceback will popup because the hardcoded xmlid cannot find the value
in the database since has been deleted. Adding a fallback fix the issue
opw-2194659
closesodoo/odoo#45265
X-original-commit: 62baf8ba12cdf4521c6d0d0fea61ff1aa2e3f4d8
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Steps to reproduce the bug:
- Let's consider two companies C1 and C2
- Let's consider a sales team ST in C1
- Let's consider that the partner of your current user is in ST
- Log your user in C2
- Go to CRM > Sales > My pipeline
- Create a lead
Bug:
An access error was raised.
opw:2191517
closesodoo/odoo#45234
X-original-commit: 42cdf368bdec41918b9f4b131b838cb1c76928b4
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Improve the default configuration on CRM for predictive lead
in order to ease the onboarding.
Modify text and install crm_iap_lead(_enrich) automatically if
CRM and IAP are installed.
task-2131056
closesodoo/odoo#44262
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Makes debugging possible without having to run the db locally and
manually adding _loggers everywhere.
Parts of the error are logged already, leading to messages like:
...payment_authorize.models.payment: The transaction was unsuccessful
Unfortunately they don't show the reason. The entire response is
something like:
{'messages': {'message': [{'code': 'E00027',
'text': 'The transaction was unsuccessful.'}],
'resultCode': 'Error'},
'transactionResponse': {'SupplementalDataQualificationIndicator': 0,
'accountNumber': '',
'accountType': '',
'authCode': '',
'avsResultCode': 'P',
'cavvResultCode': '',
'cvvResultCode': '',
'errors': [{'errorCode': '5',
'errorText': 'A valid amount is '
'required.'}],
'refTransID': '',
'responseCode': '3',
'testRequest': '0',
'transHash': '',
'transHashSha2': '',
'transId': '0'}}
Since we log the full request above, let's also log the full response.
PS. this was present before but was lost with 26f3d8465d.
opw-2188889
closesodoo/odoo#45259
X-original-commit: d269bba3b9f4f4fa567a2a7084396bdf08422fa4
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Remove the domain that was limiting the reporting view. The goal
of this reporting view is to allow managers to check what all
salespersons are doing.
task-2192589
closesodoo/odoo#45239
X-original-commit: 4901fb037510cdabb7404f335872732797331b05
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
opw-2152644
Do not set the field writeoff_account_id as required if the
payment_difference is zero because there is no writeoff in that case and
the field is invisible.
closesodoo/odoo#45257
X-original-commit: b0939529de5cd4273e64cfe729f1b5f532bbd859
Signed-off-by: wan <william-andre@users.noreply.github.com>
- Activate Developer mode
- Go to Settings / Technical / Actions / User-defined Defaults
- Create the following:
Field: To Refund (update SO/PO) (stock.return.picking.line)
Default Value (JSON format): true
- Create a SO with a product invoiced based on delivered quantity
- Validate the SO, validate the picking
- Return the picking
The field 'To Refund (update SO/PO)' is is not, while it should be.
This is because we don't explicitly call the `default_get`, therefore
only rely on the default value of the field.
opw-2172513
closesodoo/odoo#45235
X-original-commit: 70d6f25b83f962d91243edaa0ff8e9a78b2e18ac
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>