The new settings model loads by default all settings. In the case of
non-admin user having the 'Settings' access rights this can lead to
access errors.
This commit deals with the multi-company issues on a standard
installation. If the admin is in Company A and the other user in Company
B, accessing the settings is pretty much impossible because of records
rules.
This fixes the master or demo data to avoid setting a company by
default. Note that it only fixes a standard installation: if the
settings are later customized, there is no guarantee that it will still
work.
Problematic fields:
`auth_signup_template_user_id`
`crm_default_team_id`
`leave_timesheet_task_id`
opw-801210
Previous to this commit, if a user hadn't properly set up his
Authorize.net credentials, when getting a response from Authorize.net's
servers, we would expect some attributes to be in the response's body,
but this is not the case if the credentials are wrong, thus we would
have an unexpected error like "NoneType object has no attribute text"
which is only a sympton of the real error (bad credentials and no
error-checking).
This is fixed by checking if the response body contains an error
message, if it is the case we raise an UserError with the error code and
the error message (which is only shown if debug mode is activated).
OPW 788261
[FIX] web: Fix column_invisible issue
This commit fixes an issue with the column_invisible attribute.
When we choose product variant for BOM for any particular product,
at that time from the BOM Lines column "Apply on Variants" is hidden,
but when we unset product variant from BOM Form,
at that time the column 'Variants" set to visible. but in this case, it is set to hidden always.
PR 21693, OPW 779555
When
- a user A had set 'notifications handled by Odoo'
- a user B sent a @userA message
Before this commit, the user wasn't notified in the inbox needaction
After this commit, he is
OPW 801315
When confirming a quotation for an MTO product, the state of the
delivery order goes from draft to waiting another operation to waiting
while it should stays in waiting another operation.
If procurement_jit is enabled, confirming a sale order line will
unreserve and rereserve the pickings associated (see
`action_launch_procurement_rule` override). Unreserving a picking will
always set its state to "confirmed", which is wrong if it should be in
"waiting another operation". Not writing on state (which is a computed
field) and let the depends call _compute_state fixes the issue.
The unreserve/rereserve thing is probably useless and is a remain of the
previous stock implementation where it was not possible to complete the
reservation of a move without wiping all its current reservation.
Another commit will improve this part of the code.
opw-801588
- Set the currency rounding to 0.001 (3 digits)
- Create an account move
- Add an account move line, set an account
When switching from edit/read-only mode, the rounding switches from 2 to
3 digits.
This is because, in edit mode, the format method is the method of the
float widget. Therefore, in this case, the formatting doesn't take into
account the currency rounding.
To avoid this, we simply use a `noSymbol` flag to avoid adding the
currency symbol, while keeping the monetary rounding.
opw-800279
When copying a done MO that is unlocked, the new MO is also unlocked and
the buttons to produce/check availability aren't displayed and it is
confusing to the user.
Fixes#20119
Optional bom line havea default `product_qty` of 0. As the "check
availability" button is displayed if the MO is not available and
the `_compute_availability` method considers all move of 0 `product_qty`
as unassiged, the "check availability" button was always displayed and
it was confusing.
Do not consider move with a 0 product_qty in the `_compute_availability`
method to fix the display of the button.
If a row is being edited, this row will be refocused when performing changes
(i.e. resequencing records). It can cause an issue if an onchange modifies the
record being focused.
To avoid this issue, the row is unselected before resequencing records. The row
isn't selected anymore but this behaviour wasn't expected anyway.
Resequencing records with the same sequence wasn't correctly working in the
editable list because we only care about the range between the swapped ids. In
some cases, this isn't good enough.
For example, if we have the records 1,2,3 with sequence field = 10,10,10, then,
swapping records 1 and 2 should lead to resequencing 3 with the sequence values
11,10,12 (to guarantee that the third item is after the previous 2).
Resequence now checks if the list increases or decreases without interruption
to create the subset that must be changed ; otherwise the whole list is changed.
Before this commit, the route to the pager couldn't be resolved
because the <model("xxx.xxx") was having a typo
Now it doesn't, no traceback nor 500 error
OPW 801651
- Create payslip
- Add a contract with any structure
- Add a structure in payslip, different from the one defined in step 2
- Confirm or compute sheet
Payslip is computed using the contract structure, while it should be
computed using the payslip structure.
Closes#21567
opw-787671
Purpose
=======
When you create a budget, the field analytic account on the budget line is not mandatory but if you don't set one, it doesn't work, the practical amount always stays at 0 even if there are journal items in the accounts defined in the budgetary positions
The field `price_subtotal_signed` contains the price converted in the
company currency. However, we should make sure to use the exchange rate
of the invoice date for its computation.
An use problematic use case is the creation of a deferred revenue from
an invoice (commit 7fe89d08b3).
opw-702352
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.
Before this commit, when the sales person (user A) of a lead assigned another user (user B) to an activity
user B couldn't see the lead in his pipeline
After this commit, he can
OPW 787935
Before this commit, because of 9d2f48d and abea8d3 and 4ebb5efac4
closed crm.lead with late activities wouldn't show.
Aware that this is essentially a choice of non-crucial behavior, there are some precautionary arguments.
- The three commits above make the choice of having a "clean" backlog:
late activities are not polluted by crm leads that are already won
- The choice of this commit is to count activities as late regardless of the state of the lead:
The use case: Close a deal with a partner > lead is won and closed
But it doesn't mean you don't have to call the partner back in a few days to actually sign a paper, organize some sort of meeting
The argument: it is better to not miss deadlines eventhough they might accumulate, rather than forgetting about them altogether
(but you don't script something to put all your emails as read when they arrive, do you ?)
OPW 744940
When opening an opportunity from a notification, it always opens the default view
which is the lead view and then the button "Button "Convert to opportunity" was visible.
opw:792931
As admin every tax is loaded, which is wrong anyway.
When the admin opens a session a change the cashier in the POS interface,
every order is made with every tax ever (on the product)
which could lead to major faulty records
See the case on OPW 786803 which is critical
[FIX] mail: delete leftover followers
Previous to this commit, if during the unlink of a model which inherits
from mail.thread an exception is raised before mail.thread's unlink() is
called, followers for such model won't be properly deleted from the
database.
This commit changes this by overriding ir_model's unlink and deleting any
followers whose res_model is not installed.
Partial back-port of 3614193Fixes#21462
OPW 786790
Changed at 08d48b0ff but was crashing when building the documentation as not
complient for sphinx
Temporary fix that should be restored when our doc engine will be smarter
Before this revision,
Assigning a user for which its partner is inactive
was sending the assignation notification email to the `partner_id`
of the object.
e.g. Assigning a task to a user for which its partner is disabled
sent the assignation notification email to the customer of the task.
opw-787659
When modifying files the a widget FieldMany2ManyBinaryMultiFiles would
not keep its metadata (currently associating attachment to [url,
allowUnlink]) up with current value.
So with an attachment added after init:
- clicking on it would error (because link is wrong)
- deleting it would unlink attachment originating from from onchange
The expected behavior is:
- being able to download attachments
- not unlinking attachment originating from onchange
and this is what this commit fixes.
opw-787746
closes#21813
Discarding a new record triggers the 'history_back' action. This makes
sense if the record was discarded from a normal form view, but not so
much when in a modal, where the expected behaviour is to close the
dialog.
This commit overrides the function in the action manager which handles
the switch to the previous view. It checks whether a dialog window is
open, in which case it simply closes it.
note: 10.0 backport from 11.0 33aa89edcloses#20405
opw-786866
closes#21792