Commit Graph

94522 Commits

Author SHA1 Message Date
Denis Ledoux 12f77fa22f [FIX] mail: notify all partners of the thread
As stated in the comment:
all notified_partner_ids of the mail.message
have to be notified for the parented messages

Record rules are applied when browsing one2many fields.
Therefore, when browsing `message.notified_partner_ids`
with a user other than the SUPERUSER, the multi-company
rules are applied, and a regular user could therefore not see
all partners of the thread, according to which
company the partners are associated with.
Nevertheless, all partners of the thread have to be notified,
including the ones the regular user cannot see.

To reproduce the issue:
 - Create a second company 'Second company'
 - Create a third user, associated to the first company 'YourCompany'
 - Set the demo user as in the 'Second company'
 - Create a project 'test' in the first company, 'YourCompany'
 - In the followers of the project, add the Demo user,
   with as subtypes "Stages changes" only
 - As the third user, create a new task in this project
 - Change the stage of this task, as the third user [this is important]
 - Sign in as the demo user, and see that you cannot access
   your messages inbox, due to an access rights error.

2015-11-26 18:08:07 +01:00
Xavier, Sodexis 70847ac5c0 [FIX] account_analytic_default: Default analytic account for invoice on delivery
When creating an invoice from a DO,
if there is no analytical account defined on the SO,
then use the default analytical account for that product.

Closes #9725
2015-11-26 16:34:02 +01:00
Denis Ledoux 1b8c9aed9f [FIX] models: custom fields seen as base fields
This was possible to create custom fields `x_*`
but seen as base fields.

For instance,
 - Go to Settings > Technical > Database Structure > Fields
 - Select a field (any)
 - Click on the model link, to be redirected to the model form
 - Edit & add a custom field from there.
 - Save
 - Notice that the field you just added is saved as a base field.

We solve this issue by assuming that all created fields and models
are customs, except the ones created by the ORM, by the database
initialization, the fields coming from the modules in python.

We therefore remove the mechanism on which a field was set
as custom according to the fact `manual` was set to True within
the context: This is now the case by default.

No change was required for the base fields: The `state` `base`
was already forced for those fields, that are created using
direct SQL requests `INSERT INTO`.

2015-11-26 15:44:29 +01:00
Denis Ledoux da667b573d [FIX] stock: barcode interface, do not reload locations all the time
Locations were search & read each time you changed
the quantity of a product in a picking.

Once the locations loaded the firs time, this is unlikely
the locations will change during the operation. It shoudln't,
at least.

Therefore, for performances, we avoid to load the locations
each time the picking is reloaded.

Fixes #8344
2015-11-26 14:08:44 +01:00
Denis Ledoux adf6d0e557 [FIX] sale_layout: remove `categ_sequence` default value.
`categ_sequence` are stored related fields, to `sale_layout_cat_id.sequence`.
Setting a default value for them has as side effect to rewrite
the value on the related field.

To reproduce the issue:
 - Create a sale layout category, with 10 as sequence
 - Create an invoice with one line, with this sale layout category
 - Come back to the sale layout category,
   notice that the sequence has been changed to 0.

Besides, as the sequence was rewritten on the sale layout category,
the sequence was rewritten on all sale order lines and invoice lines
having this sale layout category.
If you have a bunch of them, this could take a while.

The `categ_sequence` default value is supposed
to come from the sale layout category.

2015-11-26 11:22:48 +01:00
Christophe Simonis 78ea8eb058 [FIX] core: correcly handle pidfile deletion.
As atexit function are inherited by subprocess, the pidfile was always
deleted when the first worker (http or cron) died. Now, only the
process that created the pidfile will delete it.
2015-11-26 10:40:59 +01:00
Cedric Snauwaert d179a94da6 [FIX] web: list_view, context when doing name_get call in m2m was not compute correctly
this is a backport of commit fd56268c6ca4e8a6f94f16de9129bd12be87303f
2015-11-26 10:25:15 +01:00
Denis Ledoux b459c4dc03 [FIX] website: possibility to set no url for the home menu
Unsetting the URL of the menu `Home`,
in Settings > Configuration > Website Settings > Configure Website,
leaded to the unavailability of the website.

2015-11-26 10:02:41 +01:00
Martin Trigaux 5c0fd9780e [FIX] calendar: duplicated term 2015-11-26 09:52:42 +01:00
Nicolas Martinelli bb90e55fb5 [FIX] product_visible_discount: corrected price
This applies the commits 503820a and f26b94fd (and their subsequent
corrections) to the calculation of the discount. Indeed, the calculation
of the discount must take into account the corrected price, otherwise
the discount is wrongly computed.

2015-11-25 16:00:13 +01:00
Martin Trigaux 1c5c255186 [FIX] calendar: translatable date content
The time_display is present in a translatable email template but was not
translated. Added the missing term.

Updated .pot file for a few missing terms.
Removed base_calendar.pot that has no reason to be in 8.0

Fixes #9573
2015-11-25 14:36:55 +01:00
Denis Ledoux 2fd14db574 [FIX] stock: multi-company rule for `stock.quant`.
`stock.move` & `stock.product` have multi-company rules.
There is therefore no reason why `stock.quant` could not have one.

Besides, this could lead to access rights issues,
when a user went to the `Quants` list,
in Warehouse > Traceability > Quants,
while there were quants for products in a company different
than the user company.

2015-11-25 14:32:46 +01:00
Martin Trigaux 1660daf2fb [FIX] crm: avoid constraint errors when merging partners
As for the _update_foreign_keys, the _update_reference_fields method may raise an unique constraint when merging two partners.
In such case, the new record is not relevant and can be removed.

Backport of 8d23a3a86c.
OPW 657338, closes #9705.
2015-11-25 14:15:25 +01:00
Raphael Collet 8e1a5add38 [FIX] api: improve decorator `returns` to handle special cases, like method `search`
Add the possibility in the decorator to specify the `upgrade` and `downgrade`
functions that convert values between APIs.  Both function have the same API:

    upgrade(self, value, *args, **kwargs)
    downgrade(self, value, *args, **kwargs)

The arguments ``self``, ``*args`` and ``**kwargs`` are the ones passed to the
method, following its new-API signature.

Fixes #4944, #7830.
2015-11-25 09:59:35 +01:00
Denis Ledoux 3e03cfe7ac [FIX] website: type openerp -> odoo
2015-11-24 16:09:19 +01:00
qdp-odoo f8c261c76a [FIX] account: when a payment is processed in the bank interface, it will complete the partner automatically if a single invoice is found with the same reference. As expected for a structured communication for example. Fixes opw 653452 2015-11-24 10:22:16 +01:00
Thibault Delavallée 8fa7318178 [FIX] project, issue: change user_id + date_start
project.task: use an onchange to update date_start when changing user_id.
Indeed date_start is automatically updated in the create / write. Without
the onchange, this may lead to errors related to date_start being greater
then date_end.

project.issue: code in create and write now takes into account date_open
values given to the method and avoid erasing them.
In issue however the onchange is not added. Indeed the date_open and
date_closed fields are not visible in the view. They are automatically
computed and used to compute statistics.
2015-11-23 17:36:40 +01:00
Thibault Delavallée af6305722f [FIX] mail: server action: do not send directly email notifications
This is a backport of a fix in 9, revision 890f1302c7175e24887e66a2f8b973e72fb4c7e9.
In this revision a context key is added wshen evaluating server actions.
Notification emails created during a server action will be set in the queue
and not send directly.
2015-11-23 17:36:39 +01:00
Thibault Delavallée e74c12ffe2 [FIX] hr_holidays: mailing deadlock / spam
Some fixes coming from V9 revision 2be1dfc1ed7c9814cd3dbf4eb4cc95f842f738c2. The
purpose is to avoid to send emails in batch and to limitate automatic

 - add a context key to use the email queue for notifications linked
   to allocations created in batch. This way emails will be send asynchronously
   and will not create a deadlock when having a lot of allocations to process.
 - also fixed a missing context in a browse
2015-11-23 17:36:39 +01:00
Denis Ledoux 6f29cbe3ac [FIX] website,ir_qweb: prevent inherit_branding for assets
The attribute `data-oe-*` (`data-oe-id`, `data-oe-model`, ...)
must not be added when rendering the assets, to avoid
having different assets content,
e.g. a different content for the assets_common,
according if the user is signed in or not,
if the user can edit the website or not.

A different content for an assets according to the
users rights or the user being signed in or not means
that the assets are permanently re-written in the filestore,
which is against the point of the assets.

The content of the assets (assets_common) must not be
different from time to time, it must always be the same
(except when installing a new module, obviously).
Adding the `data-oe` attributes was pointless for the assets
anyway, and prevented having an identical content all
the time, therefore rewritting the assets all the time
in the filestore.

2015-11-23 17:01:03 +01:00
Julien Legros a92b558652 [FIX] mail: update_notification 2015-11-20 15:28:21 +01:00
Jairo Llopis 4eab4d7868 [DOC] reports: clarification about styles
* correct xpath to add style in report.styles
* informations about style troubleshoot

closes #9105
2015-11-20 15:21:56 +01:00
Denis Ledoux 777f215edb [FIX] website_quote: quote email template
When there is a quote template set on a sale order,
the email sent by default is the email
`Sales Order - Send by Email (Online Quote)`,
and this since 5153b2d281.

Therefore, there is no point to override the content of the
email template `Sales Order - Send by Email` to set
the quotation link in the email template, since this is not
this email which is being used for sales order with an
online quotation template.

Nevertheless, the link to the email quotation must be
put in the `Sales Order - Send by Email (Online Quote)`,
so the customer can access his online quotation directly
from the confirmation email, as it was designed and done
in the override of the `Sales Order - Send by Email`.

2015-11-20 14:35:13 +01:00
Lionel Sausin 6188bc6e9d [DOC] Add words of caution about `sudo`
Closes #9655
2015-11-20 13:52:36 +01:00
Denis Ledoux 8590f0445f [FIX] stock: `partner_id` field in incoming products list
`partner_id` is not the `supplier` of the stock move,
this is the destination address:
`Optional address where goods are to be delivered,
specifically used for allotment`.

The supplier would be a related to the `partner_id`
of the `picking_id`.

Nevertheless, displaying the `supplier` in the `stock.move` list
is not useful. You should use the pickign list for that matter.

Closes #9219
2015-11-20 11:28:44 +01:00
Xavier Morel c6d6ae8aec [FIX] qweb: handle unicode tags and attributes
closes #8895
2015-11-19 14:59:44 +01:00
Thomas Groutars b665478fa7 [FIX] py.js: unhandled prefix `not`
closes #6129
2015-11-19 13:54:26 +01:00
Thibault Delavallée f57e580f2d [FIX] project_issue: correctly update alias
When choosing use tasks / use issues, correctly update the project alias. Indeed
only the use issues checkbox had an onchange. This revision adds the onchange
on use tasks so that the method correctly computes the new alias destination model.

Also updated the _get_alias_models method to be more modular instead of hardcoding
values. Call super.
2015-11-18 14:41:56 +01:00
Martin Trigaux 2831d94c20 [FIX] survey: no attachment in shared survey
When sharing a survey, a mail.mail is created but the attachment were lost.
This is due to a missing command (6, _, ids) when creating records in
attachment_ids field (many2many).

Fixes #9364, opw 656742
2015-11-18 13:52:21 +01:00
Olivier Dony d117d6645e [MERGE] Forward-port 7.0 up to 051b2ce539 2015-11-17 17:55:17 +01:00
Denis Ledoux f69b0cade1 [MERGE] forward port of branch 7.0 up to df91cb5 2015-11-17 13:04:39 +01:00
Denis Ledoux df91cb5a9a [FIX] mrp: Product Cost Structure decimal precisions
The decimal precisions for the quantities, cost/supplier price
per unit of measure were not respected. It was always
set to 2 digits, whatever the configuration in the database
decimal precisions.

2015-11-17 12:56:28 +01:00
Denis Ledoux dd8cbf49ac [MERGE] forward port of branch 7.0 up to d24fcd1 2015-11-06 16:04:21 +01:00
Nicolas Lempereur d24fcd1d2e [IMP] base: test for expression distribute_not
Testing the use case of c28a28e, in which distribute_not was refactored
with iteration instead of recursion.
2015-11-05 17:13:55 +01:00
Raphael Collet c28a28e69e [IMP] osv: use iteration for expression negating
The current code when applying negative operator on an expression used
recursion which in extreme case is not best friend with python.

e.g: on instance with a lot of wharehouse, some simple action could lead
to a domain with lot of elements which could easiliy go over the python
maximum recursion limit.

This commit fixes this by replacing recursion with iteration.

We have a stack of negation flags and loop on each token of the domain
as follow :

- when we iterate on a leaf, it consumes the top negation flag,

- after a '!' operator, the top token negation is inversed,

- after an '&' or '|' operator, the top negation flag is duplicated on
  the top of the stack.

closes #9433
2015-11-05 17:13:28 +01:00
Denis Ledoux a23468c845 [FIX] hr_timesheet_sheet: total attendances & timesheets performances
For these function fields, bypassing the ORM, using a SQL query,
improves the execution time by 100 for a set of 80 timesheets
in a database with
 - 250K `hr.analytic.timesheet`
 - 250K `hr.attendance`.

These function fields depends on a one2many field which use
the SQL view `hr_timesheet_sheet_sheet_day`.

When performing `sheet.period_ids`, two SQL requests are performed,
 - the first just to know the ids in the sql view matching this sheet
 - the second to read the fields `total_attendance` & `total_timesheet`
and the request is performed on the entire set of lines of this view
(~250K lines in the observed use case)

while, when replaced by this SQL request, only one request is performed,
on a restricted set of lines, speeding up significantly the computation
of these computed fields for smaller sets of sheets.

2015-11-05 16:23:48 +01:00
Olivier Dony 051b2ce539 [FIX] tools: ignore unknown entities while parsing 2015-11-03 21:38:53 +01:00
Olivier Dony e99358415a [FIX] tools: ignore unknown entities while parsing 2015-11-03 21:38:53 +01:00
Olivier Dony 789a86901a [FIX] account, l10n_fr: avoid exceptions when processing parameters 2015-11-03 21:38:53 +01:00
Olivier Dony 2ae6481233 [FIX] account, crm, l10n_fr: avoid exceptions when processing parameters 2015-11-03 21:38:53 +01:00
Jesús Alan Ramos Rodríguez 881a46a7ce [CLA] update signature to fix the github account
Closes #9202
2015-11-17 17:14:35 +01:00
Jesús Alan Ramos Rodríguez b6cade2c2d [CLA]: Fix typo and add another e-mail to CLA 2015-11-17 17:14:35 +01:00
michaelhwalther 751b6ba25a [CLA] michaelhwalther sign individual CLA
Closes #9013
2015-11-17 17:14:35 +01:00
Khwunchai Jaengsawang 2cdbd9b9bc [CLA] Khwunchai Jaengsawang sign individual CLA
Closes #8810
2015-11-17 17:14:35 +01:00
Alex Comba 0fd91cec1c [CLA] Alex Comba sign individual CLA
Closes #8523
2015-11-17 17:14:35 +01:00
Panagiotis Issaris 462af90df5 [CLA] Panagiotis Issaris sign individual CLA
Closes #8497
2015-11-17 17:14:35 +01:00
Nicolas Lempereur 9717afbbb7 [FIX] event: fix send mail to event registrant
Currently, the button "Send Email" next to the email address of an event
registration didn't work if a partner was not set.

This commit removes the button, thus removing the feature but partially
adds it back via the chatter suggested recipients in the same way it is
done for a lead.

It is still partially a feature regression since to work the viewing
user need more access rights (e.g read access right on res.partner)
than before.

closes #9486
2015-11-17 16:25:45 +01:00
Nicolas Martinelli f18399f721 [FIX] purchase: invoice state of PO
If the invoicing policy of a PO is set to "Based on incoming shipments"
and the PO contains a product of type "service", it is never considered
as invoiced, and therefore reach the state "Done".

The reason is that no stock move is linked to this PO line, and
therefore it is never considered as invoiced since we check the invoice
state of the associated sotck moves.

This fix assumes that in this specific case, a PO line for a service is
always invoiced, since there is anyway no incoming shipment linked to

2015-11-17 13:40:37 +01:00
Denis Ledoux c9fce1a404 [MERGE] forward port of branch saas-3 up to f69b0ca 2015-11-17 13:05:15 +01:00
Goffin Simon e3b90ba1d4 [FIX] sale_stock: payment_term in supplier invoice
When invoicing a supplier, this is the supplier payment term which
has to be taken into account.

2015-11-17 10:45:17 +01:00