The payment method code is not supposed to be changed
from an `account.payment`.
Besides, this field is only used for technical reasons,
as stated:
```
Technical field used to adapt the interface to the payment type selected.
```
There is therefore no reason to not set it as readonly.
Not setting it as reandonly could lead to a `write`
operation on the `account.payment.method` with the value
of the code, even if this is already that one set, and
such an operation could be prevented by the access rights.
opw-668624
A missing feature in discuss was the possibility to directly reply to a
message from a channel without opening the document. This commit add
that feature. Now, there is a small 'reply' icon in channels (including
inbox/starred) if the message comes from another document. This icon
opens an extended composer, which will post the message in the document
chatter.
This controller was very slow as not providing a pricelist computed the price of
all products of all pricelists.
Instead only fetch the prices for the useful products.
Could incorrectly rename the stock.location.path objects, and in case
the route has push_ids but no pull_ids would crash the method entirely.
closes#10747
In a multi-company environment, a user from company A which is a parent
of the company B has access to taxes from both companies. The
consequence is that the method _set_taxes will automatically add the
taxes from both companies.
Method `is_css_preprocessed()` introduced by #9978 at revision
79f13a2aaf might fail when the
user/visitor did not have sufficient access rights to read
the cached assets (depending on ir.attachment ACL)
In addition an empty cached asset could trigger a corner case.
While the signature makes sense in an old API context (sort-of) it's
very easy to misuse in a new API context as one'd expect `has_group` to
use the subject (recordset), not the user in the environment, compounded
by ``env.user`` being browsed as administrator, resulting in the
"obvious" ``env.user.has_group(foo)`` checking if the
administrator (rather than the current user) has the specified group.
Adds a divergent v8 version of has_group which first checks if it's
called on a non-empty recordset, and in that case use the recordset id,
otherwise fallback on the context user (to handle new API conversions
which used the "correct" call convention rather than the obvious one).
fixes#9649
Mainly by moving the authority to handle the ir.attachments records
for Less and SassStylesheetAsset from the asset to the bundle.
We introduce a method `is_css_preprocessed` that will check if the
less/sass assets contained in a bundle already have ir.attachments
records. On top of that, it'll check if these existing records
need to be invalidated by comparing the last modified date of the
file and the __last_updated field on the record. If it is the case,
we chose to unlink all the less/sass attachments from the same
bundle.
Only call `product_id_change_margin` method if exists. This method is
defined in `sale_margin` module, but as there is no dependency between
modules (nor a bridge module), the call have to be done here.
The condition self.uom_id != self.product_id.uom_id could actually
never be met, since a few lines before you could read
self.uom_id = product.product_tmpl_id.uom_id. From now on, simply
check if the uom_id on the cached record is different from the one
on the product and check the price using the pricelist (_compute_price
does not take pricelists into account) with the wonderfully explicit
with_context call.
Code introducted by commit f39e535 was ignoring the value.
Now, we change the logic to always have True as value regardless the operator.
!= False become = True ...
Commit c04103f re-renders the thread every minute to update messages' date.
As a consequence, the expanded messages are lost (they are shortened again).
This rev. makes sure to keep those messages expanded.
Accessing a related field with `related_sudo=True` on a draft record should
effectively traverse the fields as the admin user. Traversing new records in a
different cache requires that all new records on the path are copied across
caches. Make the copy across caches recursive when the first record on the
path is a new record.
Iterator was consuming the first 45k records.
So don't need to specify an offset, because that will ignore the next 45k.
Eg: if step of 5, and range(1,13),
it will only use [1, 2, 3, 4, 5, 11, 12, 13]
When writing on a recordset with duplicates, the ORM raises a `MissingError`
because the rowcount gives a difference with the injected ids. The fix simply
eliminates duplicates from ids.
When a record is exported, an external ID, in the form of __export__.<model>_<id>
is created on this record.
When the translations are generated (e.g. "synchronise terms" wizard), the
translations may be duplicated for records that have been exported. If a
translation is submitted before the export (when the record had no external ID
yet), a new empty translation is created as the module differs in the import.
Creating a new translation may be a problem as the new term (equal to the source
term) will be used as the translation value.
Fixes 9480
When overriding a method that calls its super later on, it's important
that arguments is used to correctly pass all arguments to the super.
Consider the following:
// module 1 (not correct)
method: function(a) {
return _super.call(this, a);
}
// module 2 (correct)
method: function(a, b) {
return _super.apply(this, arguments);
}
If the method of module 1 gets called first it will throw away the b
argument when it calls _super. Therefore the b argument will never
arrive in method of module 2.
The margin in a SO line is the difference between the price unit and
the cost price of this SO line. In function "_product_margin" in model
"sale.order.line", the cost price is equal to the purchase_price or
the standard_price of the product. Then the cost price in the SO line
must be set with the same value when creating SO line linked to the delivery.
opw:668090
Add the normalized quantity to the SO line. This field is useful for
delivery carriers, since the package price depends on the weight, which
is always defined as a function fo the product UoM.
opw-667594