Commit Graph
111837 Commits
Author SHA1 Message Date
Yannick Tivisse 7cc14b15f8 [FIX] website_portal_purchase: Fix access right error when loading my/home/
Purpose
=======

Currently, loading my/home without purchase manager access rights returns a 403

Traceback (most recent call last):
  File "/home/accounts/src/odoo/saas-16/addons/website/models/ir_http.py", line 273, in _handle_exception
    response = super(Http, cls)._handle_exception(exception)
  File "/home/accounts/src/odoo/saas-16/odoo/addons/base/ir/ir_http.py", line 168, in _handle_exception
    return request._handle_exception(exception)
  File "/home/accounts/src/odoo/saas-16/odoo/http.py", line 763, in _handle_exception
    return super(HttpRequest, self)._handle_exception(exception)
  File "/home/accounts/src/odoo/saas-16/odoo/addons/base/ir/ir_http.py", line 194, in _dispatch
    result = request.dispatch()
  File "/home/accounts/src/odoo/saas-16/odoo/http.py", line 822, in dispatch
    r = self._call_function(**self.params)
  File "/home/accounts/src/odoo/saas-16/odoo/http.py", line 341, in _call_function
    return checked_call(self.db, *args, **kwargs)
  File "/home/accounts/src/odoo/saas-16/odoo/service/model.py", line 102, in wrapper
    return f(dbname, *args, **kwargs)
  File "/home/accounts/src/odoo/saas-16/odoo/http.py", line 334, in checked_call
    result = self.endpoint(*a, **kw)
  File "/home/accounts/src/odoo/saas-16/odoo/http.py", line 930, in __call__
    return self.method(*args, **kw)
  File "/home/accounts/src/odoo/saas-16/odoo/http.py", line 514, in response_wrap
    response = f(*args, **kw)
  File "/home/accounts/src/custom/private/openerp_enterprise/controllers/main.py", line 1673, in account
    response = super(website_account, self).account(**kw)
  File "/home/accounts/src/odoo/saas-16/odoo/http.py", line 514, in response_wrap
    response = f(*args, **kw)
  File "/home/accounts/src/odoo/saas-16/addons/website_portal/controllers/main.py", line 67, in account
    values = self._prepare_portal_layout_values()
  File "/home/accounts/src/enterprise/saas-16/website_contract/controllers/main.py", line 24, in _prepare_portal_layout_values
    values = super(website_account, self)._prepare_portal_layout_values()
  File "/home/accounts/src/odoo/saas-16/addons/website_portal_purchase/controllers/website_portal.py", line 23, in _prepare_portal_layout_values
    ('state', 'in', ['purchase', 'done', 'cancel'])
  File "/home/accounts/src/odoo/saas-16/odoo/models.py", line 1390, in search_count
    res = self.search(args, count=True)
  File "/home/accounts/src/odoo/saas-16/odoo/models.py", line 1413, in search
    res = self._search(args, offset=offset, limit=limit, order=order, count=count)
  File "/home/accounts/src/odoo/saas-16/odoo/models.py", line 3676, in _search
    self.sudo(access_rights_uid or self._uid).check_access_rights('read')
  File "/home/accounts/src/odoo/saas-16/odoo/models.py", line 2793, in check_access_rights
    return self.env['ir.model.access'].check(self._name, operation, raise_exception)
  File "<string>", line 2, in check
  File "/home/accounts/src/odoo/saas-16/odoo/tools/cache.py", line 87, in lookup
    value = d[key] = self.method(*args, **kwargs)
  File "/home/accounts/src/odoo/saas-16/odoo/addons/base/ir/ir_model.py", line 1175, in check
    raise AccessError(msg % msg_params)
AccessError: (u'Sorry, you are not allowed to access this document. Only users with the following access level are currently allowed to do that:\n- Purchases/User\n\t- Purchases/Manager\n\t- Inventory/User\n\t- Accounting & Finance/Billing\n\t- Technical Settings/Billing Read-Only\n\t- Other Extra Rights/Portal\n\n(Document model: purchase.order)', None)

Specification
=============

Count the number of purchase orders as a superuser.
2017-12-26 12:59:11 +01:00
Yannick Tivisse db54e0df79 [FIX] l10n_be_hr_payroll: Count spouse deductions if revenue 2017-12-22 16:28:12 +01:00
Yannick Tivisse b72240e3c9 [FIX] fleet: Don't copy driver_id on vehicle duplication
Purpose
=======

There's an unicity constraint on the fleet.vehicle model.

It's thus impossible to duplicate a car if the driver is set.
Y
2017-12-19 12:47:42 +01:00
Yannick Tivisse 4288b5b6fb [FIX] l10n_be_hr_payroll_fleet: Add missing dependency on compute method 2017-12-19 12:45:38 +01:00
Yannick Tivisse 1f7a9281fa [FIX] l10n_be_hr_payroll_fleet: Hide car model if transport mode not set 2017-12-19 10:51:22 +01:00
Yannick Tivisse 867f44a235 [FIX] l10n_be_hr_payroll: Store existing field company_car_total_depreciated_cost
Purpose
=======

In l10n_be_hr_payroll, the field is a simple Float field, it implied `store=True`
In l10n_be_hr_payroll_fleet, a compute method is added, and becomes `store=False`

Specification
=============

Keep this field `store=True`. This could only be done because the column already exists in the database.

PS: Same reason for car_atn
2017-12-19 10:51:22 +01:00
Yannick Tivisse 3694b02604 [FIX] l10n_be_hr_payroll: Round the car value to 2 decimals in name_get 2017-12-19 10:51:22 +01:00
Yannick Tivisse 0b85adc691 [FIX] l10n_be_hr_payroll_fleet: Compute correclty car names 2017-12-19 10:51:21 +01:00
Alexandre Kühn 6632822d14 [FIX] web_editor: html field commitchanges fully loaded
Fix over this one: https://github.com/odoo/odoo/commit/cae188514fa8b0a7c785a630ac4aff677b2071fa

The intent was to disable buttons in form views until html fields are fully loaded,
but it was not disabling the buttons for the following reasons:

   1. It is looking for buttons in the DOM, although they
      are not already attached into the body at this moment.
   2. It was disabling the buttons only at widget start(),
      so only once after "Empty Cache and Hard Reload".

We propose a better solution than disabling the buttons in the control panel:
when we click on "Save", the html field ensures that it is fully loaded while commiting the changes.
2017-12-18 11:27:11 +01:00
Richard Mathot cea587e383 [FIX] *: wrong forward-ported imports 2017-12-18 09:52:24 +01:00
Richard Mathot 8628cef167 [REV] "[FIX] base: language code for Khmer (Cambodia)"
This reverts commit 3830621075.

This patch was unstablie as updating language code is actually forbidden.
2017-12-18 09:26:06 +01:00
Christophe Simonis 5c093849b5 [MERGE] forward port branch saas-15 up to 58a86ab671 2017-12-14 15:53:40 +01:00
Christophe Simonis 58a86ab671 [MERGE] forward port branch saas-14 up to dcdbccbb6d 2017-12-14 15:46:54 +01:00
Christophe Simonis dcdbccbb6d [MERGE] forward port branch 10.0 up to e89fbb5c38 2017-12-14 15:41:04 +01:00
Christophe Simonis 5dee10b75c [FIX] l10n_fr_sale_closing: declare crons correctly 2017-12-14 15:38:50 +01:00
Christophe Simonis 25375efd5b [FIX] l10n_fr_certification: correct settings view 2017-12-14 15:38:06 +01:00
Nicolas Martinelli 063314b78a [FIX] account: switching chart of account
Backport of cf3235e134

opw-788228
2017-12-14 15:15:46 +01:00
Christophe Simonis e89fbb5c38 [FIX] l10n_fr_certification: correct view inheritance hook 2017-12-14 14:27:53 +01:00
Christophe Simonis 60c2fd3126 [MERGE] forward port branch saas-14 up to d91cf14689 2017-12-14 14:02:28 +01:00
Sanjay Jamod 3830621075 [FIX] base: language code for Khmer (Cambodia)
Closes #17633
2017-12-14 13:44:14 +01:00
Christophe Simonis d91cf14689 [MERGE] forward port branch 10.0 up to 767e2509f7 2017-12-14 13:32:57 +01:00
Christophe Simonis 767e2509f7 [MERGE] forward port branch 9.0 up to 228f6086b1 2017-12-14 13:24:01 +01:00
Christophe Simonis 228f6086b1 [FIX] l10n_fr_pos_cert: correct dependency 2017-12-14 12:55:32 +01:00
David 849a10b1da [FIX] website_event_sale: registration visibility
- When all the tickets in an event expire, the form is still visible,
wich is confusing for users.

This closes #21384
2017-12-14 12:50:05 +01:00
Lucas Perais (lpe) b75927f9e3 [FIX] l10n_fr_certification: adapting to the new specs
Main resource document to be found at https://www.economie.gouv.fr/files/files/directions_services/dgfip/controle_fiscal/actualites_reponses/logiciels_de_caisse.pdf

    This document states that only business operations with partners not being subject to VAT should be inalterable and secure.
    We adpat the module by differentiating between b2c and b2b journals and apply hashing on the former's moves

    Protection against account_cancel is not necessary anymore

    By default, this module considers a sales journal being a b2c, thus activating hashing on its move.
    Since we can't afford to lose information, when a b2c journal contains hashed moves, its b2c characteristic cannot be changed

[ADD] l10n_fr_pos_cert: module to adapt the POS to the recent French regulation CGI art. 286, I. 3° bis.

    The module adds following features:

    - Inalterability: deactivation of all the ways to cancel or modify key data of POS orders, invoices and journal entries

    - Security: chaining algorithm to verify the inalterability

    - Access to download the mandatory Certificate of Conformity delivered by Odoo SA (only for Odoo Enterprise users)

[ADD] l10n_fr_sale_closing: module to store automatically the total of daily/monthly/annualy sales.

    (both of the period and cumulative).

    This fulfills another requirement brought by the recent French regulation CGI art. 286, I. 3° bis related to the storage of data

Was PR #20581. Was task 29922
2017-12-13 17:22:51 +01:00
qsm-odoo 3a13eada0e [FIX] web: readonly required text fields should not be highlighted
The bug is also present in enterprise but the required style of
enterprise makes the bug invisible. The bug has also been naturally
fixed in 11.0 thanks to the views and design refactoring.

Thanks @auyeung112002 for the original fix.
2017-12-13 17:14:11 +01:00
Christophe Simonis 27ad91f846 [MERGE] forward port branch 10.0 up to 1022e4fb25 2017-12-13 15:56:15 +01:00
Christophe Simonis 1022e4fb25 [MERGE] forward port branch 9.0 up to 22f8660e22
Works better when you add files...
2017-12-13 15:17:22 +01:00
Christophe Simonis 39fb0825ac [MERGE] forward port branch 9.0 up to 22f8660e22 2017-12-13 15:16:46 +01:00
Martin Trigaux b92aaf1e66 [FIX] mail: display email of partner in the tags 2017-12-13 12:57:48 +01:00
auyeung112002 d847a66415 [FIX] web: Make search view dropdown menu scrollable 2017-12-13 11:35:48 +01:00
Olivier Dony ae39802f7c [FIX] l10n_be_hr_payroll: add missing group restrictions
Without proper group restrictions many computed/related fields will
crash because they depend on other group-restricted fields, such as
the `children` field.
2017-12-13 10:29:34 +01:00
Josse Colpaert 22f8660e22 [FIX] stock: don't propagate cancel when chained move is done
When you have e.g. an SO with a product MTO generating a manufacturing
order, and you put the delivery order to done, before the MO is done,
you can not cancel the MO anymore, because the cancel method checks if
the move is not done (and raises an error).

As the user stays blocked in this case, it is better to just not try to
cancel the destination move by not propagating the cancel when the destination
move is done.

opw-786571
2017-12-13 10:17:48 +01:00
Josse Colpaert b3be0b7576 [FIX] stock: don't propagate cancel when chained move is done
When you have e.g. an SO with a product MTO generating a manufacturing
order, and you put the delivery order to done, before the MO is done,
you can not cancel the MO anymore, because the cancel method checks if
the move is not done.

As the user stays blocked in this case, it is better to just not try to
cancel the destination move by not propagating the cancel when the
destination move is done.

opw-786571
2017-12-13 10:10:46 +01:00
Wolfgang Taferner 30d0861f0a [FIX] base: ir.sequence better fallback
Zero is an non-acceptable value for sequences, so the fallback should be
one instead.

Fixes #21267
2017-12-13 08:51:05 +01:00
Jeremy Kersten a9d58a3fc2 [FIX] l10n_be_hr_payroll: don't compute field dependent_children if no access
Once installed, a standard employee cannot open a employee form view since this
field was computed and that field children is not allowed without group hr_user
2017-12-12 19:56:16 +01:00
Christophe Simonis a2ea4ba095 [MERGE] forward port branch saas-15 up to 5701010d0d 2017-12-12 16:15:04 +01:00
Adrien Peiffer (ACSONE) 2a9e6e6a3b [FIX] res_partner: bad sudo.
Using sudo on super call can turn into infinite call in odoo.

opw:785415
2017-12-12 15:58:59 +01:00
Christophe Simonis 5701010d0d [MERGE] forward port branch saas-14 up to 744c2934b3 2017-12-12 15:35:11 +01:00
Josse Colpaert b0acb42f0b [FIX] stock: avoid infinite or longer than necessary loops
In some cases the MRP scheduler can remain blocked on an infinite loop
consuming a lot of CPU. The reason comes from the loop 'Check done
procurements'

If a new procument is created from another process (such like MTO
orders) during this loop, the process never ends.

The only way to reproduce is in debug mode:
1. Put a breakpoint on line 'Check done procurements'
2. Launch the MRP scheduler manually and stay paused on the breakpoint
3. In parrallel, create and confirm a sale order with a MTO route, this
   will trigger the creation of a new procurement order in state
   'Running'
4. Continue debugging step by step the scheduler and you will notice
   that the loop never ends.

Closes #21565
opw-787651
2017-12-12 15:20:57 +01:00
Christophe Simonis 744c2934b3 [MERGE] forward port branch 10.0 up to 219c93252f 2017-12-12 14:49:29 +01:00
Christophe Simonis 219c93252f [MERGE] forward port branch 9.0 up to 7a24a2f45f 2017-12-12 14:15:15 +01:00
Nicolas Martinelli 7a24a2f45f [FIX] field: avoid overhead of record._set_dirty when setting fields (#21378)
Setting fields as dirty was dramatically slow for huge one2many fields.
2017-12-12 13:36:23 +01:00
Nicolas Seinlet eb36f42729 [FIX] stock: complete_name of stock location
Have the following location structure: Loc A -> Loc B -> Loc C
The `complete_name` fields are:
- Loc A
- Loc A/Loc B
- Loc A/Loc B/Loc C

When changing Loc A to Loc D, the `complete_name` are:
- Loc D
- Loc D/Loc B
- Loc A/Loc B/Loc C

Compute `complete_name` of stock location using `complete_name` of
parent instead of parsing the full bunch of ancestors.  This improves
the computation speed, and moreover solves the recursivity problem.

Closes #21585
2017-12-12 13:15:47 +01:00
Goffin Simon 2720eb84ee [FIX] website_portal: Verification of vat number in EU country
We have problems when trying to validate our EU VAT report because some vat number are wrongly encoded in Odoo.
    There are 2 problems:

    1) We use vatnumber library to check the validity of the VAT number entered by the user on website.
       That library removes the following characters '.' and '-' in order to perform the check and
       thus can return True for a number like 123.123.123.13 or -123-3454-34
       And those VAT number are then saved in our database but are rejected by the state
       as VAT number should only contains alphanumeric character
    -> Solution: prevent entering vat number with other characters than alphanumeric for users that are located in EUROPE!

    2) Usually VAT is prefixed by country code, however some people in europe managed to bypass the system
       by prefixing their VAT number with CC instead of their country code, CC is consider valid in odoo
       (it means Country Code) but is not a valid European country code in general, which means that those
       people that should have pay some tax have not. Which is a huge problem.
    -> Solution: prevent the use of CC as country code by the user when entering a vatnumber only if the user country is in EUROPE!

    source: https://en.wikipedia.org/wiki/VAT_identification_number

opw:785443
2017-12-12 11:51:52 +01:00
Pedro M. Baeza d82b360309 [CLA] backport signature for Tecnativa
backport of dc8010c9b to 9.0
Asked in #21496
2017-12-12 11:39:35 +01:00
Martin Trigaux ffbcf69af5 [FIX] product_extended: remove not working price computation
costs_hour field no longer exists
Some modules in a different repository (let say enterprise), may be still using
it but it is not its place here.
For stability reasons, we keep the computation if an external module adds the
missing field anyway

Fixes #16269
Closes #20899
2017-12-12 11:36:58 +01:00
Nicolas Seinlet 98072f1ad0 [IMP] stock: performance on _compute_reserved_availability
Improve performance (* 2.5) on _compute_reserved_availability
`mapped` makes use of orm prefetch, which is inefficient in this use
case when facing high volume.

Closes #21198
2017-12-12 11:17:54 +01:00
Christophe Simonis eff2c77726 [MERGE] forward port branch 10.0 up to 17c9208889 2017-12-12 11:05:29 +01:00
Christophe Monniez 17c9208889 [FIX] base: backport of set mimetype on js and css assets
On MS Windows, the mimetypes module relies on the Windows Registry to
guess mimetypes. As a consequence, when generating assets bundle for
javascript files, the mime type of js files may be wrong. In that
particular case, the Odoo user is facing an empty web page.
This commit enforce 'application/javascript' for js assets when they are
saved as ir_attachment in the database.

This commit is a backport of 77ca51f
2017-12-12 09:42:55 +01:00