The followers of the departments subscribed to the
`Leaves/Allocations Confirmed` are supposed to
receive a mail notification when an employee
confirms a leave request.
It was no longer the case since the below revision:
2be1dfc1ed
This revision subscribes the followers of the department
following the `confirmed` subtype manually
,on the leave request confirmation, because
`message_auto_subscribe` only works on fields for which
the value is passed to the `create` or `write` methods,
it doesn't work for related/computed fields
This can be removed as soon as `department_id` on `hr.holidays` becomes a regular
fields or as soon as `message_auto_subscribe` works with related/computed fields.
opw-676521
Since 3d8f7c2f, res.config support selection fields to set groups and install
modules using a selection field instead of boolean.
While the `module_*` fields are correctly casted from boolean to integers, it
was not the case with `group_*` fields.
This commit forces the conversion to get the expected field format value.
Closes#10373
When the user has several addresses, the call to the onchange method
`onchange_partner_id` will overwrite the actual invoice address chosen.
opw-675935
Without the proper decorator, the method is matched as `cr_ui_context`.
This is because the `guess` mechanism expects a name `res_id` instead of
`record_id`.
For stability reason it is better to add the decorator than modify the signature
of the method.
Closes#11735
When a kit is set with a valuation = "real_time" and invoice_policy = "delivery",
the price unit of the kit computed for the Expense Account in the the journal of
entries must be the sum of the average price of each component of this kit.
Used case:
Create a kit001 with:
*General information:
-Product Type=Stockable Product
-Invoicing Policy=Delivered Quantities
-Sale Price=100$
-Cost Price=80$
*Inventory:
-Route=Manufacture
-Internal Category=All/Sealable
*its product category set with
-Expense Account=210000 Cost of Goods Sold
-Costing Method=Standard Price
-Inventory Valuation=Perpetual(automated)
*a bom of two components child001 and child002
Create child001 with:
*General information:
-Product Type=Stockable Product
-Invoicing Policy=Delivered Quantities
-Sale Price=100$
-Cost Price=70$
*Inventory:
-Route=Buy
-Internal Category=All
*its product category set with
-Expense Account=210000 Cost of Goods Sold
-Costing Method=Real Price
-Inventory Valuation=Perpetual(automated)
Create child002 with:
*General information:
-Product Type=Stockable Product
-Invoicing Policy=Delivered Quantities
-Sale Price=100$
-Cost Price=10$
*Inventory:
-Route=Buy
-Internal Category=All
*its product category set with
-Expense Account=210000 Cost of Goods Sold
-Costing Method=Real Price
-Inventory Valuation=Perpetual(automated)
Create a SO with:
-one line with the kit001
Confirm the SO
Validate the Delivery
Create and view the invoices
-per invoicable lines(deduct down payments)
Validate the invoice
Result:
Before the fix: in the entry created for this invoice, the debit for the kit001 in Cost of Goods Sold
was equal to 70 instead of 80.
After the fix: the debit for the kit001 in Cost of Goods Sold
was equal to 80(the sum of the average price of each component of the kit001).
opw:674608
An OFX file can contain more than one account. Therefore, we need to
loop over all the included accounts, otherwise statements will be
missed.
opw-673814
This case corresponds to searches like `[(field, 'ilike', name)]` where `field`
is a many2many field. The domain processing performs a `name_search` on the
field's comodel, then makes the relation match the returned record ids.
Problem: the call to `name_search` uses the default limit (100), and this makes
the search return less results than expected. Make the search complete by
forcing `limit=None`.
Setting a binary field stored in attachment may trigger recomputations on the
main record before all fields are set on that record. This may cause access
errors if the record does not satisfy some access rule because of the fields
that are not set yet.
When traversing relational fields as superuser, you end up with a recordset for
which only a subset is accessible to the current user. An earlier fix to this
issue completely dropped the `related_sudo` feature; change its implementation
to keep the feature.
Since the crm refactoring in V9, the stages doesn't make sense anymore on a lead,
as this step is only to validate an opportunity. We should remove this view as it
is confusing in this case : If I create a stage on the opportunity form view,
it appears also on the lead kanban view. Other side effects can also be encountered.
When invoicing several SO with same partner and with different invoice address,
different invoices have to be created with each invoice address.
Used case:
-create a customer with two invoice addresses
-create a SO for this customer with the first address
-create a SO for this customer with the second address
-select the two SO in the SO tree view
-click on "Invoice Order"
-click on "Create and view invoices"
Results:
Before the fix: The two SO are merged in one invoice with the second
address.
After the fix: Two invoices are created, one for the first address and
one for the second address.
opw:675961
The picking type is not defined on the stock move when a picking is
created manually. This can cause errors, for example in manufacturing: a
product sold in kit will not be replaced by its components.
opw-673741
The Automated File Upload (AFU) Ogone API requires a transaction code to be set,
either:
- ATR for automated transactions
- MTR for maintenance operations
The default is ATR and is used for submitting transactions in batch.
However, the server-to-server mode of payment_ogone only uses the AFU
API to create new credit card aliases, and not to process transactions.
Using the ATR transaction code requires the ATR feature to be available
in the Ogone Merchant account - a paying option that is otherwise
unused. Using MTR as the transaction code is sufficient for adding
aliases, and the corresponding feature (MTR) is available at no cost
in most Ogone Merchant Accounts.
References:
- Ogone Advanced Batch:
https://payment-services.ingenico.com/int/en/ogone/support/guides/integration%20guides/batch
- Ogone Alias Management:
https://payment-services.ingenico.com/int/en/ogone/support/guides/integration%20guides/alias/bulk-alias-management-via-batch
This is possible to create bank statements
forcing the amount in the foreign currency,
along with the bank account currency, and therefore
to force the foreign currency rate.
In such a case, when reconciling the journal items,
the currency rate conversion must not be done
against the currency rates written in database,
in the rates records, at that date, but with
the rate that was forced in the bank statement.
opw-676048
The current behavior was allowing going on the previous row if the
user is at the start of an editable element and on the next row if the
user is at the end of an editable element. The problem was, we did not
want this behavior when the editable element is a select or m2o (as
the up and down input should open the select/m2o dropdown instead).
When a user is subscribed to a channel with many messages,
the discuss initial rpc /mail/client_action can become very
slow (in production, the rpc took > 20s when subscribed to
the Community mailing list). This is due to the query in
_get_message_unread, counting the number of unread messages.
This commit adds an index on the relation mail_channel_partner,
this allows postgres to perform only index lookups, and speeds
up the query by 2 order of magnitudes.
From v4.1.0 of the documentation (2015-06-29), the HMAC SHA-1 key is
deprecated. Indeed, it should be considered as a legacy option to
guarantee compatibility with older skins.
The HMAC SHA-256 key should be used instead, and moreover, it seems that
any new skin created does not support SHA-1 at all, even if the option
is available.
The merchant signature code is inspired from the documentation example.
Source: https://docs.adyen.com/developers/hpp-manualFixes#9786
opw-676081
In 8.0, the amount currency field was displayed
in the journal items list view
when choosing, thanks to the `quick add` widget,
a journal with a currency set.
Otherwise, if the journal had no currency set,
the column was not displayed.
It was done thanks to the key
"currency" passed in the context.
From 9.0, the `quick add` is no longer used,
and, due to that, the amount currency field
was no longer displayed in the journal items
list view at all, despite if the journal
had a currency set or not.
In technical words, `currency` was
no longer passed in the context,
making the invisibility property
set with
`invisible="not context.get('currency',False)"`
useless.
As this widget is no longer used, there
is no other choice than either
always display the column, either never.
We choose to display it only if you have
the multi-currency group (as this is the case
in the journal item form view)
We also take the opportunity to move the column
next to the debit & credit column, this is more
meaningful.
opw-676059
When creating assets from invoice lines, the system must check
that assets have not already been created for the related invoice.
If assets already exist then these assets have to be removed.
Used case:
- In the purchase journal, tick "allow canceling entries"
- On a supplier invoice line, set an asset category
- validate the invoice
- cancel the invoice
- set to draft
- validate the invoice
Before the fix: the asset is created twice.
After the fix: the asset is created once.
opw:674674
Note: This is a cherry-pick of commits 9d14230 and 58a5b5e
In v8.0, when a procurement is cancelled and the quantity remaining on
the PO line is zero, the line is deleted. It was not the case anymore
after the Purchase refactoring.
opw-675493
When creating a partner with company_type='person' and with an invoice
adress, the created partner must stay a person.
Now a partner which is not a comany can have an invoice address.
Fixes#11730
opw:675322
If the feedback of a form is too slow, people might be tempted to
click a second time, trigerring a second request. If, after that,
the result has not been received yet, the user might be tempted
to click a lot of time because he is angry at such slowness. This
behavior would trigger a record creation each time the user clicked
the submit button. This fix disables the button once it has been
clicked once, and re-enable it if the record could not be created,
which means that there was an error in the input and the user needs
to change the values and try again.
The button has been changed to a span to avoid the default browser
behavior to post the form when no function is bound on the send button.
When creating assets from invoice lines, the system must check
that assets have not already been created for the related invoice.
If assets already exist then these assets have to be removed.
Used case:
- In the purchase journal, tick "allow canceling entries"
- On a supplier invoice line, set an asset category
- validate the invoice
- cancel the invoice
- set to draft
- validate the invoice
Before the fix: the asset is created twice.
After the fix: the asset is created once.
opw:674674
When creating assets from invoice lines, the system must check
that assets have not already been created for the related invoice.
If assets already exist then these assets have to be removed.
Used case:
- In the purchase journal, tick "allow canceling entries"
- On a supplier invoice line, set an asset category
- validate the invoice
- cancel the invoice
- set to draft
- validate the invoice
Before the fix: the asset is created twice.
After the fix: the asset is created once.
opw:674674
The pricelist field is not a mandatory field on the partner. A default
value is usually defined for any new partner created. However, if the
pricelist is manually removed from the partner, errors (tracebacks) will
occur in the eCommerce when no pricelist is found.
We cannot make the field mandatory, as it could potentially break the
workflow of some users which are not using eCommerce. Therefore, we
simply log an error message to help debugging.
opw-673453
The "Resumes and Letters" action simply displays ir_attachments
linked to hr_applicant objects; but there is no default_res_model
in the context so no ir_attachment you create is actually
displayed in the kanban view.
Since the goal of this action is simply to display attachments
linked to applicants, it makes more sense to disable the create button
and to force people to upload resumes and cover letters through
the applicant record.
Avoid raising an access denied error for messages that
the user has indeed be notified about.
The issue arose when a message posted on a document inaccessible
to the user was notified to one of the channels the user
is subscribed to.
The access control logic on messages relies on 2 heuristics
to grant read access to a message:
a. either the user was notified about the messages, by being
a follower of the document, or a subscriber of a channel
following the document (in that case the user can see the
message but not the document)
b. or the user has read access to the document on which the
message is posted (in that case the user can see both
the message and the document)
Case `a.` sometimes fail to match when a message got notified
to several channels including one the user was not subscribed
to. Depending on the order of the returned rows in the SQL
query, the "foreign" channels could shadow the channels of
the user, making `a.` a non-match.
If case `b.` did not match either, the user would have the
`read` access denied, even though the message was visible by
the `search()` method.
The fix explicitly makes case `a.` match if the user was
notified in *at least* one channel.
This was not done through a change of the SQL query ORDER,
for readability reasons.
From 9.0, a sales order to invoice is no longer a
sales order in the state `manual`, but with the
Invoice Status "to invoice".
Before this revision, the sales order to invoice
were simply not counted at all, and this
count always displayed 0.
opw-675919