Commit Graph
122894 Commits
Author SHA1 Message Date
Fabien Pinckaers c50e82c127 [FIX] account: Undistributed Profits/Losses
If no Undistributed Profits/Losses account can be found, Odoo tries to
create one with number '999999'. However, such an account number might
have been created manually by a user. In this case, the account creation
fails.

opw-1932701

closes odoo/odoo#30719
2019-01-31 09:23:54 +00:00
Nicolas Lempereur c4d222677f [FIX] web: click/studio work in colored kanban tile
When a colored kanban tile is colored, and there is a color attribute on
the tile HTML element indicating a color field (eg. when a kanban view
with color dropdown is created in studio), there was a HTML element over
the whole tile preventing to click on links or other sub element of it.

This HTML element is just a transparent used for accessibility to
contain the tile color intelligible name, so this commit just size it
over the area of the color (currently in base bootstrap ~3px at the left
of the tile).

opw-1932283
closes #30717
2019-01-31 09:01:44 +00:00
Alexandre Kühn 8897cb1feb [FIX] mail: keep activity notification counter on today's meetings
Before this commit, when a user had some meetings planned today
and open the systray activity menu, the counter would disappear.

This was caused by a weak computation of the counter that relies
on activity having always a total counter. This was not the case
for activity that are today's meetings: Counter would be computed
as `NaN`, and since `NaN` is falsy, it won't display the counter.

Today's meetings have no reason to have a counter, so this commit
fixes the issue by letting those activities not change the
computation of the counter.

closes odoo/odoo#30695
2019-01-30 13:18:18 +00:00
Martin Trigaux 6b054f2640 [FIX] web: do not select disabled element
If xlwt is not installed on the server, the option is disabled.
However, the first element was checked, even if it is disabled.

Trying to export record without xlwt was causing a traceback.

Introduced at b60de0db41 where xls is now the first choice

closes odoo/odoo#30724
2019-01-31 10:41:33 +00:00
Pierre Paridans 6ca2563155 [FIX] web: form's tabs should be scrollable on mobile
On mobile, swiping right/left switches to next/previous record.

This feature prevents the horizontal scroll of the form notebook's tabs by
overtaking the swipe gesture on those elements.

This issue had different consequences depending on the platform:
  - on iOS: the tabs cannot be scrolled at all.
  - on Android: the tabs can only be scrolled by using a two-fingers
    gesture

This commit restore the horizontal scroll on the tabs but also keep the
swipe-gesture to navigate records.

opw-1929267

closes odoo/odoo#30658
2019-01-30 15:42:41 +00:00
Olivier Dony 483b6024cd [FIX] base: restore auto report layout selection
As of 12.0 the superuser account (UID 1) is only meant to be used for
advanced debugging, and non-superuser admin accounts are used for
day-to-day administration.

Adapts the admin detection system to allow non-superuser admins to
select the report layout as well.
2019-01-30 22:31:51 +01:00
Olivier Dony e61b0cac46 [FIX] account_payment: warn when payment can't be matched
The payment reconciliation screen can't be opened if there is no partner
on a payment, and currently crashes with a traceback.
Rather than hiding the button which could cause surprises for users, we
can raise a proper error to explain why it can't work, for the cases
where a payment has no related partner.

This could happen for example when a customer paid via a direct
/website_payment/pay link.
2019-01-30 22:31:51 +01:00
Nicolas Lempereur 006002646e [FIX] survey: resend survey input=>right one
When we use "Send invitation again" on a survey.user_input, it will send
the first survey.user_input it finds corresponding to:

- the state "new" or "skip",
- the partner it must be sent to,
- the survey the user_input corresponds to,
- the email it must be sent to,

or if none found, it could be create a new one.

This is an okay behavior in most instance, but in the case of
hr_appraisal where a manager could have same survey to fill for
"employee A" and "employee B" and when you send them again, we would receive two
mails linking to the same employee.

With this changeset, the current behavior is kept but when an existing
user_input is resent, we prioritize itself before searching a matching
one.

opw-1934478
closes #30693
2019-01-30 13:43:14 +00:00
Denis Ledoux d11a2000c4 Revert "[FIX] base ir.actions.report order pdfs when attachment_use option selected"
This reverts commit 529069996c, reversing
changes made to 76e085cbb7.

PR #30690 is a cleaner solution to the problem
than PR #30402.

closes odoo/odoo#30696
2019-01-30 14:00:49 +00:00
Nicolas Martinelli 1b753b0d53 [FIX] document: PDF indexing
Since PyPDF2 gives bad results for PDF indexing, stop using it since it
raises more issues than it helps users.

opw-1928446

closes odoo/odoo#30692
2019-01-30 12:50:27 +00:00
Denis Ledoux 651859a337 [FIX] web: reports, fallback for external report layout.
Following revision 61eef73b52

the fallback to the standard external layout when
the external layout is not set on the company has been removed.

It therefore leaded to the raise of the exception
```
The report's template '%s' is wrong, please contact your administrator.
Can not separate file to save as attachment because the report's template
does not contains the attributes 'data-oe-model' and 'data-oe-id'
on the div with 'article' classname.") %  self.name)
```

when the external layout was not set,
which could happen quite easily in a multi-company environment,
if you do not set the company external layout after having created it.

This revision simply puts back the fallback as it was before.

opw-1931195

closes odoo/odoo#30687
2019-01-30 10:57:00 +00:00
Julien (juc) Castiaux c7b6fcb9f2 [FIX] hr_holidays: Disable emails when importing from file
When using the "test import" feature to import leaves request, odoo
fails with a 500 error and no error message.

The only difference with a real import is that the test dry-runs by
rollbacking. The issue here is that mails are sent *after* a commit
is done hense crashes because they do not exist anymore.

opw-1916913

closes odoo/odoo#30523
2019-01-30 14:29:23 +00:00
Christophe Monniez e3f54a7808 [FIX] stock: use proper font in PDF report
When printing a delivery order in waiting state under MS Windows, the
produced PDF does not use the proper font for the warning line.
This leads to an unreadable line full of small rectangles.

The problem comes from the fact that the 'fa' class is applied to a full
paragraph.

With this commit, the proper 'i' tag is used to display the exclamation
triangle.

opw-1931892

closes odoo/odoo#30680
2019-01-30 09:26:44 +00:00
wan 3eead65f07 [FIX] account: add date field in reconciliation writeoff form
purpose:
    when creating a writeoff from the manual reconciliation widget (invoices & payment matching), there's no way to specify the date of the writeoff journal entry

specs:
    in v12, add a date field in the js and set the date of the writeoff entry accordingly

Was PR #29794
Was OPW 1896593

closes odoo/odoo#30676
2019-01-30 09:28:40 +00:00
qdp-odoo 0237654113 [REF] base, account: removed useless @api.depends on name_get() 2019-01-30 09:16:26 +00:00
wan 7e9009f93a [IMP] base: choice of state/country easier in banks and partners
OPW 1891131
closes #27497

When creating a new bank account/partner address, the view displays the 'state 'field before the 'country_id'  field, which naturally leads users to select the state before selecting the country.
But there was problem: in order to select a state, one had to first select a country, which was confusing.

Done:
  - allow the user to select the state before the country (without restriction on country)
  - remove the state from the form when the country changes, if the state (name) is not in the country
  - automatically set the country when the state is set
  - always display the country code in the name_get of res.country.state, to deal with the case where different countries have a state with the same name
2019-01-30 08:55:32 +00:00
qdp-odoo 3ef3aeb640 [FIX] account: Added missing method to save template 2019-01-29 14:18:58 +00:00
Julien (juc) Castiaux e65446fe42 [FIX] mail: Force the writing of the attachment when the user can post
To reproduce:
1) Enable multi-company
2) Create two companies: c1, c2
3) Create two users: bob in c1 and alice in c2
4) Install subscription
5) Remove the ir.rule that forbid users from accessing subscriptions
   made in other companies: "Subscription multi-company"
6) Using u1, create a new subscription in c1
7) Using u2, follow the chatter of the newly created subscription
   allowing the user to post messages/log notes.
8) Using u2, send a message with an attachment. Access Error.

The problem raises only for the **first** attachment. That
attchement is written on the record as the main attachment thus
raises an error if the user doesn't have write access.

There is no problem to add attachment to any following record or
when the user has write access on the model. If the user doesn't
have access to the chatter, he is blocked before accessing the
write thus it is safe to sudo it.

opw-1915606

closes odoo/odoo#30659
2019-01-30 10:46:01 +00:00
Jeremy Kersten d609dbdd11 [FIX] website: make "Edit in backend" always go to website backend
Before this commit, clicking "Edit in backend" from the website could randomly
lead to the backend under another menu or without module, depending on the
other modules that are installed or version com/ent used.

After this commit, it will always open the backend under the specifiec menu
or website menu if not defined.

+ uses existing website dedicated action for product.template in 'Edit backend'

task-1919436
closes #30555

Co-authored by seb@odoo.com

closes odoo/odoo#30657
2019-01-29 10:54:56 +00:00
Jeremy Kersten 09be5b235c [FIX] website: force web.layout inheriting later
Before this commit, if you installed website in community you was not able to
install web_enterprise, because the web.login_layout was replaced (by hinerit)
by website and break the xpath from enterprise login.

Now we apply the Enterprise login xpath before that website replace it.
2019-01-29 10:46:09 +00:00
Jeremy Kersten cbe0dd66af [FIX] website_forum: fix intro msg 2019-01-29 10:45:57 +00:00
Nicolas Martinelli a5edf7ec09 [FIX] mail: user signature
- Install Invoicing
- Multi company Set up with no common contact book
- Create & validate an invoice with user A in company 1
- Change to company 2 with user A
- Connect with user B in company 1
- Send & Print the invoice

An error is raised on the template rendering because user B cannot read
info from user A.

opw-1928676

closes odoo/odoo#30649
2019-01-29 12:22:29 +00:00
Nans Lefebvre 9e276477ce [FIX] mail: keep record changes on attachment upload
Steps to reproduce:
 - Edit a record.
 - Log a note or send a message with an attachment.
 - Save the record.
Bug: changes made to the record are discarded.

Because uploading an attachment triggers a reload without 'keepChanges',
the record values are read from database.
However displayed values are not updated, so there is no feedback that changes
have been discarded.
On save, the page is reloaded so the user sees that changes have been lost.

Introduced by 7f97c9fc05.

opw 1923824

closes odoo/odoo#30642
2019-01-30 07:58:19 +00:00
Martin Trigaux 83b37a8004 [FIX] mass_mailing: support partner_id field
A sale.order is an authorised model for mass mailing but it does not have
an email or email_from field.
When trying to send a mass mailing campaign on sale orders, an error was raised
as sale_order.email_from does not exists

closes odoo/odoo#30220
2019-01-30 10:26:51 +00:00
Jorge Pinna Puissant 0edd3ea5b4 [FIX] base_address_city: lost information when creating Partner from Lead
Have a Lead with the contact informations (Customer Name, Street,
Street 2, City, State, ZIP, Country) completed in the 'Followup' page.

Before this commit, when the base_adress_city module was installed, the
informations of the City, State and ZIP where lost when we try to create
a new Partner from the Lead.

Now, the informations are present in the Partner form; furthermore if
the country allows enforce cities, the information is also present in
the enforce city form.

OPW-1932018

closes odoo/odoo#30644
2019-01-29 13:18:24 +00:00
Julien (juc) Castiaux b6f11ace83 [FIX] web: datepicker fallbacks to default english locale
When using the datepicker with norwegian locales, the dates are
correctly formatted using the norwegian locale but the name of
the months are shown in english. This cause a date validation
error and thus it is not possible to change the date.

tempusdominus.js uses moment.js to deal with dates, it sometimes
copies/creates some and set their option according to the ones
given at instantiation time and fallbacks on default options for
that are not set.

opw-1922437

closes odoo/odoo#30276
2019-01-30 08:25:27 +00:00
Jorge Pinna Puissant e13d449f31 [FIX] stock: Warning in picking on product with serial number
In stock.picking, in mode show detailed operation, add a product with
unique serial number tracking.

Before this commit, a warning about the qty is raised. This warning,
must be raised only if the qty is different from 1.
However this is not the case,
the warning is raised at each modification of the line.
This issue occurs since the rounding given to the float_compare is 0.0,
because self.move_id.product_id is not set.
Float_compare with a 0.0 rounding always return different, hence the bug.

Now, the warning is only raised when the qty is different from 1.

OPW-1932044

closes odoo/odoo#30651
2019-01-30 09:28:16 +00:00
Romain Derie 326a44c3f7 [FIX] web_editor, website: consider COW view when loading view
Before this commit:
1. If we were editing a template with no xml_id, typically the case when
   editing a specific view (COW'd), the 'Template ID' label would be left empty
   as the view does not have an xml_id but only a key.
2. If we were editing a generic view, the template would be COW'd and replaced
   by the specific one created during the save.
   After the save, the page would be reload and will try to reopen the edited
   template (stored in url `res=123`). But as this template would be replaced
   by the COW'd view, the JS would crash trying to access an inexisting view.
   The HTML editor would then open in a very thin modal, barely editable.

Now:
1. Display the template's key instead of its xml_id. The key is basically a
   duplicate of the xml_id, mainly used in website.
2. If we are saving a generic view, we search for its newly created specific
   view to upload the URL hash before reloading.

task-1934279
Fix #30447
2019-01-29 16:06:23 +00:00
Romain Derie 751ea9634a [IMP] website: add tests for scss edition on html editor
As this behavior was recently broken (fixed in #30403), this commit
adds a test tour for that flow.

task-1934279
Fix #30447
2019-01-29 16:06:23 +00:00
Romain Derie 6bd579bd6b [FIX] web_editor: send the html editor writes one after another
With the following view hierarchy:
   A
   |
   B' (oe_structure_ID view)

Before this fix, when saving multiple templates at once from the same hierarchy
the COW views (website) would not be saved correctly as the first call to
`write` would COW the parent view, then the second concurent call to `write`
would create the child specific view under the generic parent view.
Instead, the generic parent should have been cloned to a specific parent view
and then the child view should be COW under the specific parent.

  A    A'
  |    |
  B'   B*' (This one is the old B', without B' changes in the html editor)

Instead of

  A   A'
      |
      B'

Calling the `write` one after another will do the trick. Indeed, when the
second call is fired, the first call has already triggered the COW behavior.
Thus, the second call correctly retrieves the COW view.

Another issue might still appear, if the parent view write is sent first.
Indeed, the parent view will be COW, thus the specific child view (second write
waiting to be fired) will be deleted to be added on the new specific hierarchy.
Thus, that write will then raise an error since the view does not exist anymore.

task-1934279
Fix #30447
2019-01-29 16:06:23 +00:00
Christophe Simonis e59a9d1678 [FIX] account: adapt test to new version
Oversight of previous forward-port.
2019-01-29 19:27:29 +01:00
Christophe Simonis 40b2bf96bd [FIX] test_mass_mailing: bump query counts
Now that urls are shortened by email (and not globally)[1], more queries
are executed.

Oversight of previous forward-port

[1] See #29083
2019-01-29 19:24:03 +01:00
Christophe Simonis bdfef60d60 [MERGE] forward port branch saas-11.3 up to cd5c8a02f9 2019-01-29 18:35:14 +01:00
Lucas Lefèvre 95ef460961 [FIX] mail: don't trigger if mail bus is undefined
Steps to reproduce the bug:
1. open an app such that there is a breadcrumb (e.g. an employee form view)
2. create a chat window with a user
3. click on the expand button to open the chat in Discuss
4. unsubscribe from the thread
5. click on the breadcrumb to go back

=> Traceback

When expanding the chat window to open Discuss, it registers a callback which
triggers an event on the mail bus. This callback is called when clicking
on the breadcrumb.
Because the channel was left, any related chat window is destroyed.
Since the widget is destroyed, it has no parent, so any service call
returns `undefined`, hence `getMailBus` returns `undefined`.

Fix: check if mailbus exists before triggering.

closes odoo/odoo#30640
2019-01-29 14:25:42 +00:00
Jorge Pinna Puissant e2e0101349 [FIX] sale_timesheet: project from SO in multicompany
Have a product of type service with :
- Service tracking : Create a task in a new project
- Project template : A project of the company
- Re-invoicing Policy : No

Create a SO with the product, and validate it.

Before this commit, when the project was generated. It was generated in
the company of the super user, and not in the company of the SO.

Now, the project is generated in the company of the SO.

OPW-1927005

closes odoo/odoo#30607
2019-01-29 13:11:31 +00:00
Christophe Simonis cd5c8a02f9 [MERGE] forward port branch 11.0 up to 36d96e0150 2019-01-29 13:17:12 +01:00
Christophe Simonis 36d96e0150 [MERGE] forward port branch saas-15 up to 788684a5dd 2019-01-29 11:57:06 +01:00
Christophe Simonis 788684a5dd [MERGE] forward port branch saas-14 up to aaa2035bcf 2019-01-28 19:45:46 +01:00
Christophe Simonis aaa2035bcf [MERGE] forward port branch 10.0 up to 4a5862a492 2019-01-28 19:45:04 +01:00
Arnold Moyaux 428546bc02 [FIX] stock: scrap insufficient qty bypass UoM
Usecase to reproduce:
- Set 1 unit of product A in stock
- Scrap 1 dozen of product A

Warning message for Insufficient Quantity is not triggered.

It happens because there is no UoM conversion between scrap qty and
product quant quantity.

Fixes #30570

closes odoo/odoo#30589
2019-01-28 13:13:21 +00:00
Nicolas Martinelli ae88e50928 [FIX] stock: unreserve
- Create a SO with 2 stockable products: 1 is available, the other is
  not.
- Validate, go to the picking
- Set the 'Shipping Policy' to 'When all products are ready'

The 'Unreserve' button disappears, while some products were reserved.

When changing the shipping policy, the state of the picking is
recomputed and set as `confirmed` ('Waiting').

We make the button visible in this state also, when 'Shipping Policy'
is set to 'When all products are ready'.

opw-1932658

closes odoo/odoo#30635
2019-01-29 07:13:08 +00:00
Lucas Perais (lpe) 4a5862a492 [FIX] point_of_sale: offline invoicing => backend printing
In a pos session:
OFFLINE
make an order with invoicing , try to validate
    The order stays there because it needs to be validated by the server
make another non invoiced order, validate

ONLINE
make another order
    At validation, all orders will be pushed to the server

Before this commit, when trying to validate the invoiced order
the report download couldn't find the order id, and crashed
This was because the order in question was already pushed
but treated as a non invoiced order

After this commit, an "warning" message is displayed to the customer
saying he/she has to print the invoice from the backend.
In most cases it is enough and acceptable, since a customer would actually leave the premises
and come back later for the invoice
It is also safer in terms of data consistency to keep pushing all orders once the connection is back

OPW 1918044

closes odoo/odoo#30485
2019-01-28 12:14:30 +00:00
Géry Debongnie dc751f20a2 [FIX] web: add exponential backoff strategy for lost connection
Before this commit, the web client had a naive strategy to handle lost
connections: it tried to poll the server every 2 seconds until a rpc
succeeds.

This works quite well from the perspective of the user, but may be a problem
from the perspective of the server.  If a server is down for a longish period,
then each users active tabs will then perform a request every 2 seconds. This
means that the server will be progressively hammered by many requests, which
will clutter the logs, and make it more difficult to gracefully recover.

With this commit, we simply exponentially increase the delay each time, and add
a little jitter to give a better distribution.

Cherry-pick of 4a3f04bcc5

closes odoo/odoo#30136

closes odoo/odoo#30596
2019-01-28 10:55:53 +00:00
Lucas Perais (lpe) 7ab26999be [FIX] account: tax in right refund account
Have a tax that has a different account for refunds
make an invoice and its refund

Before this commit, the refund's tax is still in the old account

After this commit, the refund's tax is in the account for refund defined on the tax

OPW 1907950

closes odoo/odoo#30325
2019-01-28 10:53:01 +00:00
Nicolas Martinelli 93a767a678 [FIX] pos_discount: error if misconfigured product
In case the discount product is misconfigured and therefore not loaded
by the POS, a traceback appears when applying a discount.

Add a comprehensive error message instead.

Closes #30574
opw-817527

closes odoo/odoo#30582
2019-01-28 07:46:51 +00:00
Nicolas Lempereur 6c6ef6588f [FIX] website: affix menu no close frontend mobile menu
On mobile the frontend menu navbar is an hamburger menu that open on
click.

If the option "Customize > Main layout | Affix Top Menu" is
enabled, there is two menu:

- one at the full top of the page
- one affixed to the top of the viewport (only shown if we are at least
  scrolling 300px away from the top of the page)

But there is a side effect: when scrolling if the menu at the top of the
page is opened, it will be automatically closed => this makes sense to
avoid having two menu shown on the same page but is an odd behavior.

With this commit, the behavior is changed and when the menu is opened in
the top, the affixed menu is not shown (it only works if the top page
menu has no opened dropdown).

opw-1920310
closes #30567
2019-01-25 16:58:19 +00:00
Christophe Simonis 387d5cff90 [MERGE] forward port branch 11.0 up to 8f47b028ed 2019-01-24 17:01:40 +01:00
Robot Odoo 8f47b028ed [IMP] l10n_be_hr_payroll_fleet, fleet: Adapt CO2 Tax up to 2019
Specification
=============

- Adapt the formula used in the code with the current legal value.
- Add the LPG fuel type in standard fleet module.
- Adapt the atn formula in the code with the current legal value.

Documentation:
https://finances.belgium.be/sites/default/files/downloads/121-faq-voitures-de-societe-2019-version17.pdf
https://www.socialsecurity.be/employer/instructions/dmfa/fr/latest/instructions/special_contributions/companycar.html

Description of the issue/feature this PR addresses:

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

closes odoo/odoo#30484
2019-01-24 14:22:24 +01:00
sed-odoo dad59a62c3 [IMP] l10n_be_hr_payroll_fleet, fleet: Adapt CO2 Tax up to 2019
Specification
=============

- Adapt the formula used in the code with the current legal value.
- Add the LPG fuel type in standard fleet module.
- Adapt the atn formula in the code with the current legal value.

Documentation:
https://finances.belgium.be/sites/default/files/downloads/121-faq-voitures-de-societe-2019-version17.pdf
https://www.socialsecurity.be/employer/instructions/dmfa/fr/latest/instructions/special_contributions/companycar.html
2019-01-24 12:24:04 +01:00
Nans Lefebvre 8275b6eff8 [FIX] sale, sale_expense, sale_stock: make the False expense_policy selection behaves as 'no'
The sale.order model has an expense_policy selection field, with values in 'no',
'cost', 'sales_price'.
However that value can also be set to False.

The code that handles that field expected the value to always be set to a value.
We explicitly treat False as if it was 'no' (the default value for that field).

opw 1915508

closes odoo/odoo#30336
2019-01-24 07:12:33 +00:00