With some escpos printers the cash drawer did still not open after
previous fixes. One of the problemetic printers is the Epson TM-m30.
This fix will check the status of the drawer and try to open it up to 5
times. The fix is successfully tested with the TM-m30.
closesodoo/odoo#33328
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
When website_customer is not installed, some endpoints are not handled
by the router, causing the following tests to fail:
- test_10_crawl_public
- test_20_crawl_demo
- test_30_crawl_admin
Those tests were failing due to /customers responding with 404.
Indeed, the route /customers is defined in website_customer, but had
some usage within website_crm_partner_assign, causing tests to fail when
the former module is not installed.
The new behavior can be explained as follows:
- module website_crm_partner_assign on its own will lose the hyperlink.
- module website_customer will now inherit the view definition in order
to wrap the targeted HTML text elements with an anchor tag.
Closes#33344
Signed-off-by: Christophe Simonis <chs@odoo.com>
before fix negative values will be added after -0.00 resulting in a
value like for instance -0.008543 while is should be -8543.00.
Also when removing the value there will be a traceback for '-' not being
a number.
added extra checks for negative values on input.
resolves https://github.com/odoo/odoo/issues/29910
resolves https://github.com/odoo/odoo/issues/29909closesodoo/odoo#30035
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Usecase to reproduce:
- Archive a stockable product with quantity on hand
- Start an inventory with all products.
-> Archived product is displayed
It happens because the search is an SQL request that is build
and it thus does not benefits from the automatic search on active
objects.
This commit add an active search on quant for inventory lines.
closesodoo/odoo#33077
backport odoo/odoo#27384 from 11.0
closesodoo/odoo#33098
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
This is a performance patch.
Writing on the field `users` of `res.groups` had the side effect
to recompute the field `share` of `res.users`.
This is because the trigger of this field is
`@api.depends('groups_id')`.
The more users you had, the more time it took to
add or remove the second company of a user.
This also slowed down the creation of employee users
when the multi-company group was added
to the inherited groups of the employee group
(basically when checking "Multi-Company" in the General Settings)
as then all new employee matched the condition
`if len(user.company_ids) <= 1 and user.id in group_multi_company.users.ids:`
(Multi-Company group checked, but only one company set, by default).
closesodoo/odoo#33305
Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
- Create a SO
- Add a product service that will generate a task to the confirmation.
Its UOM must be Hour(s)
- Confirm the so an go into the task
- Add a timesheet line with "00h20min" and save it
Quantity saved into the delivery qty of the SO is 0.34 instead of 0.33.
The default rounding method is `UP`, so we use `HALF-UP` instead.
opw-1975014
closesodoo/odoo#33276
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Putting *args and **kwargs confuses the function `odoo.api.split_context`.
This causes that a call to `search` via XMLRPC gets the wrong argument: takes
the first argument of ``args`` as the context.
Example which ignores the `count=True`::
```
api.call_kw(self.env['product.product'], 'search', (
[], False, False, None, True, {'lang': 'en_US'}
), {})
```
would ignore the `count=True` and use the wrong argument for context.
Issue introduced in commit 15ea753a.
Since:
`def search(self, model=None, *args, **kwargs)`
is equivalent to:
`def search(self, args, offset=0, limit=None, order=None, count=False):`
because the call to the super will anyway call the parent method, we can
change the method arguments.
note: this is only for [10.0,saas-14] where 15ea753a is.
closes#33147
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Co-authored-by: Nicolas Lempereur <nle-odoo@users.noreply.github.com>
Following the fix in 4c35983d0, it appears that the excludes and
packages options are conflicting. py2exe seems smart enough to include
jinja2 package without the explicit include via the 'package' options.
closesodoo/odoo#32991
Signed-off-by: Christophe Monniez (moc) <moc@odoo.com>
Prefetching it triggers its translation, which quickly becomes most of
the overhead of /jobs despite the field not being displayed on that
page: an empty /jobs takes ~150ms, a /jobs with 99 jobs takes ~2000ms,
>70% of which are spent in html_translate and ultimately
translate.py:process (14600 calls, 60% of runtime, 40% own).
Removing prefetching lowers the runtime to ~700ms.
closesodoo/odoo#32985
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Make a PO then an invoice with a product that will create an asset
cancel the invoice
Open the Assets Analysis report
Before this commit, the asset lines corresponding to the invoice
are shown
After this commit, they are not shown (only non archived assets are by default)
OPW 1974344
closesodoo/odoo#32955
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Since 78ba90d5, when building the windows package, py2exe fails to
compiles jinja2 asyncsupport module. Even tough jinja detects the
environement, py2exe tries to compile the async part. The problem comes
from the fact that async keyword was introduced in python 3 and we use
py2exe with python 2.7.
With this commit the async part of jinja is execluded from py2exe.
closesodoo/odoo#32913
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
Have a SO with a quotation template and some optional products set
Display it on the portal
On an optional product, click on the cart icon
to add it to the SO
Modify the quantity of the optional product
Before this commit, the feature was barely working:
- the total price of the optional product did not change
- negative quantities were allowed
- there was no reaction when directly putting a number in the input
- when decrementing the quantity, it crashed
- untaxed and tax amounts were not dynamic
After this commit:
- the total price of the optional product changes as a function of the quantity input
- negative quantities are not allowed
- it is not possible to manually input the quantity with a keyboard
only +/- buttons are used to change the quantity
- decrementing the quantity works
- untaxed and tax amounts are dynamic
OPW 1947769
closesodoo/odoo#32715
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
If the zipfile contains some garbage directories (e.g. leftover empty
directories from git, `__MACOSX` metadata folder, …) it seems
unnecessary to log an error, just skip the directory and don't mark it
as a proper / successful module.
closesodoo/odoo#31639
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
The default PoS picking sequence should not be reset.
Losing custom configuration can lead to errors.
For instance:
- A customer initially uses the default sequence until POS09999
- he changes it to another one of his own taste starting the
sequence over, like: WH/POS/00001
- In a module update, the sequence is reset and then we get the POS
prefix again.
- In the next picking, we could have a duplicated name, and an error
would raise in the Point of Sale.
opw 1962302
closes#32299closesodoo/odoo#32842
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Have a partner which is only a company
Print "Due Payments" report
Before this commit, the name of the company was shown in double
this was because both `name` and `contact_address` are shown in that report
but in the case of a company, or child of a company, the company's name
is included in contact_address
After this commit, the name appears only once
OPW 1970581
closesodoo/odoo#32838
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Have a SO with a partner in another language
Apply a quote template to a SO
Customize the portal view to show website_description of a product on the template
Translate it
Show the SO on the portal
Before this commit, the description of the product was not translated
This was because the field was not included in the onchange of template_id
causing that field to never have changed, that is, it kept the description
done injected with the first write
After this commit, the description is changed according to the partner's lang
OPW 1960977
closesodoo/odoo#32825
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
To reproduce:
0. Start an odoo v10 instance with --load=saas_worker,web
1. Install ecommerce.
2. Enable "Allow external users to sign up" and "Enable password
reset from Login page" from General Settings.
3. Open different session then signup a new user.
4. After successfull signup, the new user will be redirected
to the backend (/web).
Facts to consider:
1. odoo.addons.auth_signup.controllers.main.AuthSignupHome and
odoo.addons.website.controllers.main.Website both inherit
odoo.addons.web.controllers.main.Home
2. When instantiating an odoo instance *without* saas_worker,web,
the mro is the following:
( <class 'odoo.http.Home (extended by Website, AuthSignupHome)'>
, <class 'odoo.addons.auth_signup.controllers.main.AuthSignupHome'>
, <class 'odoo.addons.website.controllers.main.Website'>
, <class 'odoo.addons.web.controllers.main.Home'>
, <class 'odoo.http.Controller'>
, <type 'object'>
)
while the mro *with* saas_worker,web loaded is:
( <class 'odoo.http.Home (extended by AuthSignupHome, Website)'>
, <class 'odoo.addons.website.controllers.main.Website'>
, <class 'odoo.addons.auth_signup.controllers.main.AuthSignupHome'>
, <class 'odoo.addons.web.controllers.main.Home'>
, <class 'odoo.http.Controller'>
, <type 'object'>
)
You can notice that depending on how the instance is instantiated,
the order of inheritance is different.
The problem occurs when saas_worker is loaded, so this bug can be
experienced by saas clients.
Explanation of the fix:
Notice that the original code calls web_login of its super in its
web_auth_signup method. This is technique is used normally during
optimization (according to RCO). If website is installed, the
portal user should be redirected to '/' instead of '/web' and this
is defined in web_login of website. However, the web_login of
"website" is not called after signup because "website" is not super
of "auth_signup" when saas_worker is loaded (see the mro above).
Calling self.web_login will make sure that web_login is called from
top to bottom, and regardless of the order of website and auth_signup,
web_login of "website" will be called and makes sure that the
new portal user is redirected to the '/' and not to '/web'.
opw-1956980
closesodoo/odoo#32741
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The computation of hash integrity depends on the field
`tax_ids_after_fiscal_position`. However, this field is computed, but
not stored.
It means that if one modifies a fiscal position used in the POS, the
computation of `tax_ids_after_fiscal_position` will change.
Consequently, the hash computation of the order will be modified, and
the hash integrity of the journal will be corrupted.
We prevent the modification of the taxes implied in a fiscal position if
any POS order use it.
Closes#32665
opw-1969009
closesodoo/odoo#32701
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Recommended by GitHub's repository alerts.
We normally stick as close as possible to the version we depend
on in the official DEB packages. This in turn depends on the version of
Debian stable at the time of release - for 10.0 that would be Debian 8
(jessie) and thus Jinja 2.7.3 (albeit with security backports).
However Jinja2 before 2.10.1 suffers from a few issues that could lead
to crashes of Odoo processes.
It seems it's worth an exception to our rule for pip users, similarly to
previous bump up at d2605bccdb.
closesodoo/odoo#32602
Signed-off-by: Christophe Simonis <chs@odoo.com>
This revision is similar to
605b94e64c
except that instead of an OperationalError
(e.g. a conccurent update),
this is an IntegrityError which is raised,
an sql constraint which is not met,
e.g. a unique or required constraint.
In the case of this opw,
this is the picking name unique constraint
which was not met,
the picking sequence number has somehow been re-used.
Both
`psycopg2.OperationalError`
and
`psycopg2.IntegrityError`
inherits from
`psycopg2.DatabaseError`
We therefore choose to use this Exception class,
to include all kind of psycopg2 exceptions that prevent
the transaction to be committed.
opw-1965679
closesodoo/odoo#32577
Signed-off-by: Denis Ledoux <beledouxdenis@users.noreply.github.com>
Before this fix there was no check if there was already a decimal point
in the value when using the onscreen keypad.
Fixes#32034
Steps to reproduce:
* Open up POS interface
* Add an item
* Press the decimal point button multiple times (2 or more)
* Note that pressing additional number keys do not display
* Backspace must be pressed for the number of digits entered,
plus the multiple decimal points, to clear
all the hidden characters in the value buffer
* Same behavior occurs with the Discount and Price
values
Current behavior:
Multiple decimal point characters can be
"entered" and are inserted into value buffer
(Qty, Disc, or Price), but do not display on
screen.
Additional digits entered after multiple decimal
point presses are inserted into buffer, but do
not display on screen.
Additional digits entered after the last valid
digit on the screen are also inserted into the
buffer.
Backspace must be used to remove the invisible
characters from the value buffer.
Expected behavior:
The value buffer for Qty, Disc, or Price should
more closely match what is displayed on the
screen.
Characters which are invalid and aren't
displayed on the screen, should not be inserted
into the value buffer, including the decimal
point button.
closesodoo/odoo#32089
Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
_compute_website_url can only be called on singletons
It should not be called with self but the record we are iterating on
closesodoo/odoo#32369
Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
For existing installations, creating indices might not always be
possible, e.g. if you have a Text/Char field that has an index=True
set on it in a field override and pre-existing rows longer than
the pg supported size , the index creation will fail.
Instead of failing miserably during the schema modification, simply
log the problem instead and keep going.
closesodoo/odoo#32442
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
When a asset is confirmed, it's not allowed to link it to an invoice.
Side effect, it recomputed the depreciation lines of the confirmed asset.
opw:1961468
closesodoo/odoo#32388
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Since 79af654fc61 if we had unexpected configuration of usage such as
being in HTTPS, having a POS hardware in HTTPS but an error is received
(eg. the device is closed) => the POS interface can't be opened being
blocked on an error:
Https connection to IoT Box failed
Make sure you are using IoT Box v18.10 or higher.
Navigate to {proxy_ip} to accept the certificate of your IoT Box.
With this changeset, we have a popup that does not prevent to open the
point of sale interface (and the red disconnected status in the top
left allow to retry connection as before) on first load.
opw-1934413
closes#32306
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
- Create 2 companies A & B
- For a product P, create a supplier info for each company using the
same partner, with a different price and delay.
- Order the supplier so that the one for A has a higher priority than
the one for B.
- Create a reordering rule for P in company B.
- Run the scheduler as admin (e.g. thanks to the cron).
The price taken is the price for company A instead of B.
`_select_seller` is not company-aware, therefore the first matching
supplier is chosen.
opw-1959263
closesodoo/odoo#32328
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Google maps used to be free, but became a paid API.
Technically, the usage could be part of the free offer,
but to benefit from it the account needs to have billing enabled.
Since it's a paid feature security had to be ramped up,
so now APIs have to be explicitly enabled (here geolocating/geocoding).
All this makes it so that the Google account has to be properly configured
before the calls to the Maps API can work.
As a result we add an explicit UserError if the request fails,
to help the user configure the Google account
(before the error was entirely hidden as to give the user no chance at all).
Also exports transaltions, including for commit e6ca846c65
which raised a similar error message if no API key was found.
opw 1946485
opw 1947292
opw 1947337
closesodoo/odoo#32162
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
If the database name contains one of the tested strings, it can render
the assertion of the test invalid or inconclusive. Ensure we strip it
away during the tests.
opw: 1957055
closesodoo/odoo#31987
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Before this patch, the ir.logging's write_uid field was a many2one which
could cause a module install/update to hang when the module is changing
the res.users model schema and when this module causes to orm to warn
through the logger. (eg: declaring two res.users fields with the same
string attribute)
In such situation the transaction cursor that is processing the
res_users table alteration will be granted an exclusive postgresql lock
hence causing the ir_logging insertion to block because of the write_uid
foreign key to res_users.
This issue has never been raised by runbot as it is using a remote
database with --log-db
Note: the write_uid conversion from m2o to int was left over in commit e6a5d82closesodoo/odoo#32015
Signed-off-by: Christophe Simonis <chs@odoo.com>
Avoid potential tracebacks from the FSWatcher's thread being killed.
Drawback: Server shut down can have an extra small delay
(only applies when the --dev=reload option is given)
closesodoo/odoo#31855
Signed-off-by: Christophe Simonis <chs@odoo.com>
Add the alternative of inotify instead of watchdog to watch the addons
paths the server was started with.
Reason: watchdog spawns 2 threads per path to watch. When there are a
lot of addons paths, this can become too costly. With inotify we watch
all the repositories in a single thread.
https://github.com/dsoprea/PyInotify
installation:
pip install inotify
We set the default rate to be 1.0 instead of 0.0, since a rate of 0.0
doesn't make sense.
Partial backport of 298491597c
opw-1949866
closesodoo/odoo#31866
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Before this commit iteration in a t-foreach containing null or
undefined values crashed because they have no attributes.
closesodoo/odoo#31828
Signed-off-by: Fabien Meghazi <amigrave@users.noreply.github.com>
- When creating a user from the "Grant Portal Access" wizard, the code
checks for duplicate users.
It does so by checking if there is a user with the same login as the
one we want to create.
The check is case sensitive which could lead to issues.
For example a mistyped email (with a uppercase somewhere) could fail
the duplicate user check.
Since emails are not case sensitive, we want the check to be case
insensitive too.
OPW-1932918
closesodoo/odoo#31818
Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>