Commit Graph
128520 Commits
Author SHA1 Message Date
Raphael Collet 6230f72d2b [FIX] mail: avoid crashing for users without email address 2019-07-04 11:32:22 +00:00
Raphael Collet 3520eee8eb [FIX] website_form: avoid default_get() to crash by using superuser 2019-07-04 11:32:22 +00:00
Raphael Collet 3b592ef5a2 [FIX] base: create asset attachments with superuser
Stick with this convention, as it prevents regular users from manually
creating attachments that match the expected url, and screw up websites.
2019-07-04 11:32:22 +00:00
Raphael Collet bd8c760e92 [FIX] test_mail: query count 2019-07-04 11:32:22 +00:00
Raphael Collet da5021f704 [FIX] mail, hr: bypass user_has_groups() in superuser mode 2019-07-04 11:32:22 +00:00
Raphael Collet 368e9530f4 [REF] *: record.env.user._is_XXX() -> record.env.is_XXX()
Superuser mode implies `record.env.is_XXX()`.
2019-07-04 11:32:22 +00:00
Raphael Collet b7fd679a6c [FIX] *: sudo() -> with_user() 2019-07-04 11:32:22 +00:00
Raphael Collet 1e6c3bec2c [ADD] api: flag su on environments
The flag defines a "superuser mode" on environments, which allows to
bypass access rights without changing the current user id.
2019-07-04 09:24:23 +00:00
rhe 541012c9ea [FIX] point_of_sale: No payment methods after validating bank statement.
Before the fix, it was possible to validate a bank statement of a POS without validating the entire POS session.
After the fix it's impossible to validate the bank statement of an opened POS session. We now have an error message if we try to do it from accounting app and can't see the validate button anymore from the POS app.
TASK-ID: 2001551

closes odoo/odoo#33986

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-07-03 12:03:37 +00:00
Yannick Tivisse 7b9bf47d2e [REM] website_hr: Remove module
Useless module is useless.

closes odoo/odoo#34579

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-04 09:43:52 +00:00
Gert Pellin 1345a4f47e [FIX] point_of_sale: recover unpaid orders
Steps to reproduce:

Open a POS session and add an order with a few items on it, but
don't submit a payment for that order.
Exit, close and validate/post the POS session
Open another POS session

Current behavior:

The unpaid order vanished into Never Never Land, never to be
found again.

Expected behavior:

Either an error should be displayed when trying to close a
session with outstanding orders, or any open orders should
be automatically moved to the next open session. If I had
the choice, I would much prefer the second option, plus a
warning message when closing the session.

Closes https://github.com/odoo/odoo/issues/16151

TAK-ID: 1918354

closes odoo/odoo#33395

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-07-04 09:27:42 +00:00
Pierre Masereel 637d9e734d [FIX] point_of_sale: Decimal Precision access rights
Since changes made on decimal precision access rights in rev: a1eb000c93
the pos user doesn't have access anymore to decimal precision model in
read access.

So we've added the read right on this model for the pos user.
2019-07-04 07:30:28 +00:00
jem-odoo 86f5b6a926 [IMP] tools: get_timedelta helper
This commit introduces a small helper to return
a timedelta given a quantity and a time unit (day, hour,
month, ...)

Task-2024216

closes odoo/odoo#34576

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-07-04 08:19:08 +00:00
jem-odoo 01c279ced1 [IMP] tools: introduces format_time
In some module, we gonna need to display time part in name_get. So,
it is interesting to have a helper doing that for us. Time part label
depends on the language, format, and timezone.

This commit introduces this tool, based on `babel` lib like the
other helpers. Tests are provided.

Task-2024216
2019-07-04 08:16:08 +00:00
Rishabh Jadia 967040e62e [IMP] account: zip fields are now char
In fiscal position, fields from 'ZIP range' were not supporting the ZIP range with 'char' field and only support 'integer'. It was a problem in some countries like Canada.

task 1948120

closes odoo/odoo#31910

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-07-03 19:12:05 +00:00
Thibault Delavallée 3fc57893fb [IMP] test_mail: update test_mail performance counters according to current state
Also make a base performance class for some context and users in order
to lessen a big file size.

closes odoo/odoo#34547

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-03 11:38:49 +00:00
Jérémy Hennecart 3cc217e5a8 [IMP] website_sale_slides: improve course purchase flow and buttons
Before this task, when a customer bought a course, he was directly
redirect to the checkout process.

After this task, the customer can either Add to Cart or Buy Now
(if the Buy Now option is activated)

This commit also updated the redirection regex in website_sale_product_
configurator. When a product has an optional product, you have the possibility
to add in your cart the optional product thanks to a modal. Before, the button
"Add to Cart" was only available in the shop (/shop/), but now it is also
available on a course (/slides/). So to be redirected on the cart when we
click on the button "Proceed to Checkout" for a course, we needed to apply the
redirection also for the course.

Linked to task 1974929
Related to PR #34224

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-03 09:02:19 +00:00
Jérémy Hennecart 2010de60e7 [IMP] website_sale_slides: do not automatically install module
Now we can have eCommerce and eLearning without automatically willing to
sell courses. The auto_install in the manifest was also blocking the
possibility to uninstall the module. When we tried to uncheck the option for
selling course, it reinstalled it just after we had saved the change in the
settings.

Linked to task 1974929
Related to PR #34224
2019-07-03 08:51:44 +00:00
Parth Choksi 2bdff6783d [IMP] base: do not stretch partner image to a square
Before this commit when you set a partner image whose height was greater
than it's width, it used to get squeezed into a square. After this commit
we prevented partner image from being squeezed into a square.

Task ID: #1982082

closes odoo/odoo#33134

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-03 09:04:07 +00:00
Robot Odoo 1e69bacd46 [MERGE] integrate decimal_precision feature to base
The decimal precision feature makes sense to be an ORM feature, no need to be
in a specific module.
The limitation was also that models like res.currency were not able to use a
decimal precision as this was raised at #19668

Keep a backward-compatible signature with a warning.

Task id: 48198
Closes odoo/odoo#25467

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-03 15:11:53 +02:00
Martin Trigaux 573ccf098f [FIX] fields: implement _description_digits
Otherwise, fields_get returns the string, not the digits
Add test
2019-07-03 11:16:24 +00:00
Martin Trigaux e2bd3e328a [IMP] odoo: remove LazyCursor
Was specifically created for decimal.precision at f0646cb51b
Should no longer be needed
2019-07-03 11:16:24 +00:00
Martin Trigaux dd2fae2ead [IMP] base: remove decimal.precision.test model
It should not be a standard model but a test model
2019-07-03 11:16:24 +00:00
Martin Trigaux a1eb000c93 [IMP] base: remove read access to decimal.precision
There is no reason to interact directly with it.
The method precision_get is done in SQL and ormcached, it is better to use it
2019-07-03 11:16:24 +00:00
Mitali Patel 9d710df076 [REF] *: use the new decimal precision syntax
Since previous commit moved decimal_precision module's feature into base,
use the new syntax for fields declaration
Remove the imports to the removed module
Remove the module from dependency in manifest

sed -i "s|digits=dp.get_precision('\([A-Z a-z]*\)')|digits='\1'|" **.py
sed -i "/from odoo.tools import decimal_precision as dp/d" **py
2019-07-03 11:16:24 +00:00
Martin TrigauxandOlivier Dony 82be146954 [IMP] base: keep backward compatibility for decimal_precision
As the decimal_precision module was removed, allow code like

    from odoo.addons import decimal_precision as dp
    fields.Float(digits=dp.get_precision('Foo')

to keep working

Co-authored-by: Olivier Dony <odo@odoo.com>
2019-07-03 11:15:48 +00:00
Mitali Patel e453af0a8f [REM] decimal_precision: remove module
Remove leftover files, everything is now in base
2019-07-03 11:15:48 +00:00
Mitali Patel 0c5121a979 [IMP] decimal_precision: integrate into base
The decimal precision feature makes sense to be an ORM feature, no need to be
in a specific module

Previous syntax was
    from odoo.addons import decimal_precision as dp
    fields.Float(digits=dp.get_precision('Foo'))

and now is:
    fields.Float(digits='Foo')

Remove the possibility to have a callable method on the digits attribute (it
was only used for precision anyway) and directly retrieve the digits on the
decimal.precision model

Rename the method digits to get_digits to avoid confusion between the field
attribute when declaring a field and the method to retrieve the precision

Task id: 48198
2019-07-03 11:15:48 +00:00
Martin Trigaux 93b370c1f1 [REN] formatLang: remove ununsed special case
The formatLang method used to accept a value that has a _field parameter
This was introduced in 2010, at 6b19c64976 and is no longer used
Removed it to make the decimal_precision migration easier
2019-07-03 11:15:48 +00:00
lejeune quentin f5676fabea [IMP] hw_driver: inform the odoo instance of connected and disconnected devices
Before this commit, we only sent the list of connected devices to
the odoo instance (thanks to `self.send_alldevices`) when a device
is newly connected. Now, we also send this list when a device is
disconnected. We also try to call this method once if multiple devices
are connected/disconnected during an iteration.

task-id 1939338

closes odoo/odoo#32678

Signed-off-by: Quentin Lejeune (qle) <qle@odoo.com>
2019-07-03 08:14:28 +00:00
Aaron BohyandMohammed Shekha 69ca6bd0a4 [IMP] web: resize textarea on notebook tab show
Before this commit: when textarea is on second tab of notebook and it has long
value then autoresize can not compute actual height of the textarea as it is in
second tab and has display: none property, it is not resized until focus comes
on it

After this commit: call DOM_updated event on notebook tab change, DOM_updated
event will call resize method again, so when tab changes resize is called and as
textarea is visible now, proper height is calculated and assigned to textarea.

task-2007558

closes odoo/odoo#34503

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>


Co-authored-by: Mohammed Shekha <msh@odoo.com>
2019-07-05 09:41:30 +00:00
Shreya Modi 06c78c8dc2 [IMP] account, utm, website_customer, base: add sheet tag to the view
Added sheet tags to following form views:

-account.account_tax_report_line_form
-base.view_partner_bank_form
-utm.utm_campaign_view_form
-website_customer.view_partner_tag_form

task-2026283

closes odoo/odoo#34442

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-03 05:10:48 +00:00
lbs-odoo 981907fd43 [ADD] hr_work_entry: Move work entries mechanism into its own module
Purpose
=======

We would like to re-use the work entries in the attendance module.

As hr_attendance is not dependant on hr_payroll, we move the whole
mechanism into its own module.

This could be reused too into others modules, like forecasting or whatever.

TaskID: 1904850

closes odoo/odoo#34434

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-05 07:40:06 +00:00
Aaron Bohy a798daa4e7 [DOC] qweb: t-foreach: deprecate x_(all|parity|even|odd)
These variables aren't used in Odoo and can be easily computed
anyway.

Also deprecate the support of integer values for t-foreach, for the
same reason.

closes odoo/odoo#33981

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-06-26 10:50:26 +00:00
Florent de Labarre 02e6a8bdb8 [REF] stock: unlink of inventory adjustment allow deletion of draft and cancelled inventory adjustment
closes odoo/odoo#34469

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-07-01 07:54:48 +00:00
Sébastien Theys b540040ba2 [IMP] product: create product.template.attribute.line in batch
For 3000 lines (3 for 1000 products):
- 35s before this commit
- 22s after this commit

Gain around 30%

closes odoo/odoo#34295

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-06-24 09:19:59 +00:00
Priyanka Kakadiya 7194168457 [FIX] web: fixed default order issue
In a list/kanban view when applying a default_order on the view, it does not
work with favourite filter

Before this commit,
1) The default_order was not applied to the view when favourite filter is
applied
2) when default_order applied, Click on an element of the list/kanban and
then go back to the list/kanban with the breadcrumbs, default_order has been
changed.

This is because the ```_getOrderedBy ``` returns [] when favourite filter is
applied and it does not have sort value, added check if favourite has orderedBy
and has length then and only then pass orderedBy else pass undefined

After this commit,
1) default_order will be applied to the view
2) default_order will not be changed when going back through breadcrumbs

task-1922576

closes odoo/odoo#34001

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-07-02 06:55:34 +00:00
svs-odoo 1993488831 [IMP] stock: onchange on inv. line serial number
On Inventory Adjustment lines view, when you set serial number for a
tracked product, its quantity is automatically set on 1.

Task #2025397

closes odoo/odoo#34301

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-07-02 11:55:03 +00:00
svs-odoo d33b4a9a1d [IMP] stock: onchange on quant serial number
On quant view, when you set serial number for a tracked product, its
quantity is automatically set on 1.

Task #2025397
2019-07-02 11:15:18 +00:00
Romain Derie 1419b21aec [FIX] website_sale_comparison: tests should be in correct folder
Since d6847bacb1, test-tours should be in a specific folder and asset.

Closes #33961

Signed-off-by: Romain Derie (rde) <rde@odoo.com>
2019-06-10 21:42:26 +00:00
Romain Derie 873fd422be [FIX] web, web_editor: use isDebug rather than debug on config
Since 72f7139f52, config.debug does not exist anymore, config.isDebug()
should be used.

Two commits merged at the same time were still using config.debug, 87a35d4263
and 88a26235ca

Closes #33961
2019-06-10 20:13:23 +00:00
Robot Odoo 1cc92e1de2 [MERGE] stock_account, related addons: stock valuation layer
task-1875873

closes odoo/odoo#33935

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-06-11 11:37:38 +02:00
Thomas Werland 515fb62fc4 [IMP] base_geolocalize,web_editor,doc: create map_view
In order for the map view to work properly:
- I moved scss property to a  file only scoped to website module.
- moved the definiton of "partner_latitude" and "partner_longitude" from
base_geolocalise to base/res.partner

closes odoo/odoo#32487

Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
2019-06-11 07:36:53 +00:00
Pierre Masereel 3a7b4b424a [FIX] point_of_sale: currency based on company set on the config
Since recent changes in multi company of odoo, the self.env.company is
only the preffered company and not the only selected anymore. So the
currency of a pos config is based on the pos config one and has nothing
to do with the one choosen by the current user.

closes odoo/odoo#33947

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-06-11 07:20:39 +00:00
Pierre Masereel 2cb0ec1cad [FIX] pos_restaurant: shop doesn't exist anymore in pos
The variable 'shop' that was set for POS receipt, was actually the stock
location and has been removed. But we forgot to remove its use in
pos_retaurant.

related commit: 8e30349fd1
2019-06-11 07:20:39 +00:00
Simon Lejeune 74a7291242 [FIX] purchase_stock: fix tests
Sale adds valued products in the default category, some tests change the
valuation of the default category and input_aml is hence wrong since it
contains aml of other products. Create a new product and category to
avoid side efffects.

Also, copying a product template and accessing its variant doesn't seem
to work anymore, i don't know why yet.

task-1875873
2019-06-11 05:18:50 +00:00
Simon Lejeune b058f1bd18 [FIX] purchase_stock: key <built-in function id> is not a string
stems from 3936d655c4
why the urnbot isn't red before this branch is beyond me at the moment.

task-1875873
2019-06-10 20:43:30 +00:00
Simon Lejeune 8b965ba294 [REF] stock_landed_costs: add a cost method change test
task-1875873
2019-06-10 20:43:30 +00:00
Simon Lejeune ad911da1ff [REF] stock_account: more fifo tests
task-1875873
2019-06-10 20:43:30 +00:00
Simon Lejeune f12a616c29 [REF] stock_account: cost method change with valuation layers
The examples are implemented at TestStockValuationChangeCostMethod.

The idea is that we want to keep some trace of cost method change and
keep the consistency of the data (eg what about a fifo stack when
changing to standard, that sort of things). We thus implement a simple
logic: when changing the cost method, empty the current valued stock
with the old cost method and refill the stock with the new one.

Some cost method changes are neutral accounting wise, others not.

The rationale is that cost method changes are a hard configuration changes
and databases where users changed cost method are undebuggable because
it is not possible to understand the resulting accounting entries.

The change of valuation (auto to manual and conversely) is not well
defined at the moment.

task-1875873
2019-06-10 20:43:27 +00:00