Fine-tuning of 463601a384.
It does not make sense to be able to write on mail.activity.type
using the related fields defined on mail.activity.
But this field is not a related one, and it is necessary to be writable to make
the 'recommended next activity' feature work at all.
opw 1974236
closesodoo/odoo#33325
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
This commit is a followup to #25854
If a custom relational field is in a view and the field it references is
in another module and this module is uninstalled, the registry will
crash.
This is not because the ORM doesn't properly cascade-delete the field,
it tries to, but since the field is in a not-to-be-deleted view, the
unlinking of the field is interrupted and an error is raised to prevent
the breakage of the view.
However, module install/upgrade/uninstall cannot be stopped by such
errors and once the registry is reloaded, it crashes because it cannot
find the referenced field.
The solution, while not ideal, is to force the deletion of the field if
we're in uninstall mode... This means that the view in question will be
broken until the field is manually removed from the view, but a broken
view can be dealt with more easily than a broken registry.
opw-1974362
closesodoo/odoo#33130
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
Since the refactoring of forum, faq sanitize is set to False.
The editor of the faq can make what he want...
But disable sanitize will break the translation since fields.py has code:
```python
def _setup_attrs(self, model, name):
super(Html, self)._setup_attrs(model, name)
# Translated sanitized html fields must use html_translate or a callable.
if self.translate is True and self.sanitize:
self.translate = html_translate
```
Now we don't become html_translate magically, but we need to specify it
in the field definition direclty.
Courtesy of @mart-e
This commit closes opw-1978662
closesodoo/odoo#33112
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
In the tree view for account.invoice, two columns are signed
(amount_total and residual) and two columns are not signed
(amount_untaxed and amount_tax).
Now, all the columns with numeric values are signed.
This commit reverts the commit : 622af0b7cc
opw-1964348
closesodoo/odoo#33097
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Create 3 products:
C1, no tracking
P1, tracked by lot
P2, tracked by lot
- Create a BOM: to product 1 unit of P1, use 1 unit of C1. It also
produces 1 unit of P2 as byproduct.
- On the Stock location, create a Put Away Strategy to send:
P1 to Shelf 1
P2 to Shelf 2
- Create a MO, validate until then end
P1 is correctly sent to Shelf 1, but P2 is sent to Stock instead of
Shelf 2.
No call is performed to `get_putaway_strategy` at move line creation.
opw-1972130
closesodoo/odoo#33109
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Rounding each element of the sum decrease the
precision and prevent to reconcile large recordset.
closesodoo/odoo#33100
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
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>
Allow the cancellation of invoices 'In Payment', since there is no good
reason to not be able to do it.
opw-1981682
closesodoo/odoo#33093
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Open a record with a chatter (ie an opw task), add an attachment, enable
debug mode and click on "Set Defaults" in the debug tools, traceback.
The `message_attachment_count` field is a special view added by the
chatter on the form view. This field exists on the view but is absent on
the list of field listed by the XML file. Setting a default value on
that special field is not supported.
opw-1972372
closesodoo/odoo#33044
Signed-off-by: Alexandre Kühn (aku) <aku@odoo.com>
When a sale order is free, no transaction are created but you are
redirected to the page '/shop/confirmation' that display a transaction
and lead to bad displaying because there are no transaction.
To fix this behaviour, we redirect to the portal view of this sale order.
We've also added the 'href=#' on the button link to have it written in
white.
closesodoo/odoo#33019
Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
Because of d5d93474de,
when displaying a quote on the portal, which quote has a product with a website description
containing a long h3
the left sidebar took all the space
After this commit, we limit the width of the anchor to the description in the sidebar
OPW 1974650
closesodoo/odoo#33056
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Because of 5fd19cc
when invoicing an order having a product with no tax
the onchange of invoice line put some default taxes on it
After this commit, the taxes we consider are the one coming from
the order line itself
OPW 1981326
closesodoo/odoo#33059
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
In 6c2b54ff there was an optimization that removed extended addresses
fields syncing on parent_id, or concerning field update or creation.
But the list of fields was also used partly for formatting address which
had been supporting extended addresses fields and now does not.
With this changeset, we have the extended fields back but only for
formatting in a new "_formatting_address_fields".
opw-1984608
closes#33144
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
This commit will correctly check for a custom payment.transaction create method
on 'self' instead of the acquirer's provider before calling it.
closesodoo/odoo#33033
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Steps to reproduce:
- Create a product as user for Company A.
- Set a tax on it for Company A.
- As a user in company B, set a default tax for the account associated with the product and/or company.
- As a multicompany user of Company A and B, in company B, create an invoice with the product.
When the onchange is triggered - no tax.
https://github.com/odoo/odoo/blob/11c950ef23faefb5b826c7fb6eb0dccb8e345ca0/addons/account/models/account_invoice.py#L1644-L1654
Its because first we evaluate product taxes for all companies, if none then the account, if none again then the company.
Then they are filtered by company, but in reality the only taxes that need filtering are product taxes (as account
taxes and company taxes should already belong)
fixes#27696
opw:1963881
closesodoo/odoo#33013
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
- Activate Invoice Online Payment
- Set Authorize to pay through Odoo (S2S)
- Create a new customer (do not give portal access)
- Create invoice -> send to them
- Open invoice in incognito mode
- Try to pay invoice online with Authorize
An error is raised:
The transaction cannot be processed because some contact details are
missing or invalid: City, Country. Please sign in to complete your
profile.If you don't have any account, please ask your salesperson to
update your profile.
The error is quite confusing, and the user is missing the main point: he
needs to sign in.
There is no reason to display the fact that contact details are missing
for a public user, so this part is now shown only if the user is logged
in.
opw-1981003
closesodoo/odoo#33116
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
- Open the bank reconciliation widget
- Throttle the connection
- Click multiple times on the same move line in order to select it
The line is added multiple times to the statement line.
We mitigate the behavior thanks to a `debounce`.
Fixes#33000
opw-1978551
closesodoo/odoo#33020
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Before this commit, the date_last_stage_update field in fill everytime at task creation. This does not make sense if ther is no project linked to the task or if there is no stages associated to the project/task.
This commit populates the date_last_stage_update field only when needed. So, we can now have newly created task without date_last_stage_update filled.
closesodoo/odoo#31999
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
On write, a check is done that raises
'You can not modify already invoiced timesheets …'.
We put that check in a function so that this behaviour can be extended.
(restricted by an override, or relaxed by not calling the super)
opw 1974968
closes#33057closesodoo/odoo#33092
Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
Steps to reproduce the bug:
- Configured bank account for CHF with all the ISR related informations
- Click on "Send & Print" on a customer invoice with that bank account
- Save the email template
Bug:
An error was raised because the key 'attachments' didn't exist in the variable
rslt.
opw:1970005
closesodoo/odoo#33042
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Create a model and extend this model using an inherits. Define a
constraint in the inherited model that uses a field of the parent model.
Create a valid element using the inherited model then write an invalid
value. This pass the constraint although it should raise an exception.
The problem resides in the `write` function of `models.py`. It first
write values on the inherited model then write values on the parent
model. The order is wrong, it should write on the parent model first
then on the child model.
The solution is to change the order fields are written: first we update
child references to their parents, then we update the parents, then we
update the child.
opw-1962705
closes#32919closesodoo/odoo#33003
Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
When dragging a snippet in the editor, drop zones are created at the
correct locations (e.g. between columns when dragging a column). Some
code is in charge of "cleaning" the created drop zones to, for example,
remove multiples ones which are at the same position. This code is also
currently removing the drop zones which are between two "non-block"
elements. This is preventing to swap form rows thanks to the form
builder as rows are "non-block" elements as they are flex elements.
This commit solves the problem by changing the "is non-block" condition
to "is inline" condition which is what was intended.
Note 1: rows became flex elements with BS4, that is why this is fixed
in 12.0.
Note 2: this could be back-ported in previous stable versions as this
actually preventing to drop snippets between tables, list
items, etc (all non-block elements) but this can be considered
as a limitation unless a real breaking case presents itself.
See task-1874350 which discovered the bug.
closesodoo/odoo#33054
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
In the tree view for account.invoice, there are totals' in some columns.
There is no logic in adding the invoices values for these columns, the
invoices could be of different types, or the invoices could have
different currencies, which creates incoherents totals.
opw-1964348
closesodoo/odoo#33051
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
When 80f1ac3599 removed deferral of
parent store computations (the MPTT at the time), it also errornously
removed the computation during auto_init.
As a result, when adding a `_parent_store = True` and `parent_path`
field to an existing model (e.g. in an override, or when updating the
database) the column will be created but the column will be
False-filled, and hierarchical queries break as odoo will attempt to
perform string operations on `False` (either `False + '%'` or
`False.split('/')`).
Fix the issue by reintroducing the parent_store computation.
Note: uses the same gating as the old commit, the computation is only
performed if this is the install/update where the parent_path column
gets created.
We could alternatively gate on just _parent_store, but even the RCTE
can be expensive when executed on millions of records (at least when
it has to set all the parent_path) and while it could allow inserting
a bunch of records when calling -u to generate their parent_paths, it
feels like the caller could and would do so manually as they might
have shuffled the tree and need to update more than just the records
for which parent_path is null.
closesodoo/odoo#33034
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
Setting the `order_id` as read-only in the model prevents the import of
SO lines separately from the SO. We set it read-only in the view
instead.
opw-1978453
closesodoo/odoo#33021
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Steps to reproduce the bug:
- Install Timesheet, Sales, Accounting
- Create a product P that creates a project when validated on a SO
- Create a SO with P and validate it
- Create an invoice with a downpayment of 10% and validate it
- On the SO, click on "Project(s) overview" smart button
Bug:
The invoiced amount on the overview was not updated with the downpayment invoiced.
When the SO was completely invoiced, the amount of the downpayment was counted in
"Other cost" (because an analityc line is created for the downpayment SO line)
opw:1969143
closesodoo/odoo#32962
Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
Long product descriptions were overflowing on mobile when the list
layout was used. Indeed in all other cases (non mobile or grid layout),
a max-height is set to prevent this problem. This commit sets a
max-height for the mobile list layout use case.
Note: the layout is still to be reviewed to handle these cases the right
way. A task is actually being developed in master to do that.
opw-1974989
closesodoo/odoo#33023
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
When the snippet was moved from the theme repository to the community
repository, some scss mixins were badly refactored, making the theme
specific styles not work anymore.
This commit removes the bg color which was added to latest posts
snippet's post elements as it made no sense, appeared broken and was
not possible to remove. It also adds some padding to the snippet by
default.
This commit also reviews the snippet options which seemed to allow post
color edition while it is in fact not possible.
opw-1964485
closesodoo/odoo#33016
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Facebook API does not accept float values for height and width
parameters anymore.
closesodoo/odoo#32970
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Forward Port 0c46c8a929 from v10.0
has dome flows, namely, the new feature of grouping the taxes by tax group was not supported
Now it is supported: when modifying an optional product's quantity, every field is updated with the new values
OPW 1974708
closesodoo/odoo#32980
Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
Install CRM (we need the "Hide Private Message" record rule defined by
that module), create a meeting as of today, set a reminder of one day,
invite another user (Demo) as attendee, save. Edit, go to the options,
change the "Show time as" to "free", save => access error due to the
said record rule.
Using a search instead of browse ensures record unavailable due to a
record rule are filtered.
Same as 54e970e
opw-1974599
closesodoo/odoo#32987
Signed-off-by: Julien Castiaux <Julien00859@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>
Fix mexico accounts nature of the following SAT accounts:
- 119.01
- 119.02
- 119.03
- 199.04
- 180.01
- 503
- 505.01
- 505.02
- 607.01
- 610.01
- 612.01
Currently some debit accounts are being labeled as creditors and vice
versa. For example the account 119.01 IVA pendiente de pago should be
labeled as a debit account but is set as a credit account.
closesodoo/odoo#33287
Signed-off-by: Nicolas Martinelli (nim) <nim@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>