Commit Graph
101963 Commits
Author SHA1 Message Date
Adrien Dieudonne 1ec2e4b22d [IMP] mail: limit number of messages fetched to 25 2016-06-29 08:36:41 +02:00
Nicolas Martinelli 506c161990 [FIX] stock: appropriate chatter log when picking done
Commit d349584 solved the state change tracking of pickings, and
moreover prevents unnecessary state changes to be recorded. However,
this also prevents the state "Done" to be recorded in the chatter.

Saving properly the state change for the picking might be quite tricky,
since the stock processes sometimes imply unreservation/rereservation of
quants, and therefore lead to several state changes inside the same
process.

opw-680343
2016-06-28 16:13:34 +02:00
Martin Trigaux 3e15b86428 [FIX] point_of_sale: do not insert related fields on one2many
fields ref, journal_id and date on account.move.line are all related fields on
the account.move.
Setting a value here is then useless and triggers write on the account.move
after the creation of the account.move.line (inverse values in write)
2016-06-28 13:23:41 +02:00
Martin Trigaux 5d9e4b7858 [FIX] account: performances of map_tax
break on first match instead of checking other Tax Source that will not match
anyway.
2016-06-28 13:23:41 +02:00
Martin Trigaux 173b76c7bb [FIX] point_of_sale: performance and invalidation
Function fields, old-api style, that are not stored do not have cache
invalidation mechanisms. This means that they are recomputed every time the
field is accessed.
Due to the way the cache behaves, the records that are present in the cache will
be included when the prefetching is done.

In the scenario of the a POS session being closed, this implies that the cache
will contains more and more account.move.line records and try to prefetch all
(hopefully max 1000) without ever relying on the computed result for the next
access. This makes the computation of fields `amount_total` and `price_subtotal`
very slow, even for orders with a very low number of lines.

Backport the new API migration of these computed field to benefit from depends
mechanism and keep the computed value into cache when needed.

In master these fields should be stored.
2016-06-28 13:23:41 +02:00
Christophe Simonis 10550aa5a5 [MERGE] forward port of branch saas-6 up to e68ed41 2016-06-28 13:11:35 +02:00
Christophe Simonis e68ed417b6 [MERGE] forward port of branch 8.0 up to 3e965ec 2016-06-28 12:23:54 +02:00
Martin Trigaux cbbc90fc2e [FIX] website_payment: access parent payment method
On the other routes (e.g. /my/, /my/contract/) payment information on the parent
contact are displayed but can not be access in the my payment route.
You get in a unconsistant situation where you can access the contract of the
company and its payment information but can not use this payment information.

opw-681491, opw-681502
2016-06-28 12:16:41 +02:00
Nicolas Martinelli 77212863b1 [FIX] stock, sale_stock, portal_stock: picking access
An access error occurs when a the delivery address of a SO is set to a
different partner than the SO partner. In this case, the picking
created is associated to the partner of the delivery address. This is an
issue when the SO partner tries to view the picking from the front-end
("My Account"), since he is not allowed to access it.

opw-681341
2016-06-28 09:10:55 +02:00
Martin Trigaux cc4f8df99f [FIX] account: compute total invoice in batch
The computation of the total_invoiced field did not work in batch mode.
When displaying a company in a form view (field invoice_total comptued), the
children of this company are present in the cache and the value of the field
invoice_total will be prefetched for these children as well (at least in 9.0).
Most of the time this is redudant information and the same value is computed
for each child while most of the invoices are on the parent.

Batching the computation per partner allows to make one global query for all
partners.

Add test to make sure the total increase correctly after a test invoice
confirmation.
2016-06-27 17:20:05 +02:00
Denis Ledoux 9062c01c02 [FIX] web: pager page on next/previous record
When browsing a form with a one2many / many2many field
with several pages, the one2many pager page was not reset
when going to the previous/next record, while the next/previous
record could not have multiple pages on its one2many/many2many,
and the page on which the user was on the former record could
not exist in the newly displayed record.

Besides, even if the page does exist, there is no reason
to display this new record X2many value from its first page.

It's the case anyway when you edit/save, it comes back to the first page.

opw-679092
2016-06-27 16:50:47 +02:00
Goffin Simon d577eeaa6e [FIX] product: pricelist items
With the pricelist, it is possible to define a pricelist just for
a variant. But in the product.product.form, only the pricelist items
linked to the product template could be displayed.
The field item_ids has been created in product.product model to display
all the pricelist applied on a product.

opw:674700
2016-06-27 15:47:58 +02:00
Nicolas Martinelli 3229629579 [FIX] stock: reserved quants in lots
Let's take the following case:
- Enable lot tracking on a product
- Costing Method is "Real Price", Inventory Valuation is "Perpetual"
- Create a picking with 2 stock moves, each stock move is linked to the
  same product

When the picking is validated, 4 account moves are created instead of 2.

This occurs because the list of stock moves and the list of reserved
quants is sent to the method `_move_quants_by_lot`, but there is no
check to which stock move is related a given quant.

For most cases, the issue doesn't show up since there isn't usually 2
stock moves with the same product in a given picking. There is at least
one use case where this happens: selling a pack of two identical
products. In this specific case, 2 stock moves of the same product are
created, but one pack operation will merge the 2 stock moves.

opw-680308
2016-06-27 12:19:08 +02:00
Martin Trigaux 5abcbf0eb2 [FIX] js: translations and string substitutions
_('foo '+bar) does not work as `bar` is a variable with undefinied content
during translation export (and variable content during evaluation) so a match
will not be found.
Also trailing spaces are stripped during synchronisation with transifex.

The proper syntax would be
_.str.sprintf(_t("foo %s"), bar)
but to avoid breaking existing translations (need to reexport .pot)
use the syntax
_("foo ") + " " + bar
that is more stable friendly.

The 'No value found for the field...' string is not possible to be fixed without
breaking the translations should be split at least twice.
Write it the propre way directly.
2016-06-27 12:05:36 +02:00
Denis Ledoux 0fa052cc1e [FIX] l10n_generic_coa: remove liquidity account templates
These accounts are created automatically on the journals creation
e.g. On the creation of a Bank Journal, a Bank account is automatically
created, linked to this journal.

Before this revision, when installing the generic chart of account
(or l10n_us), you had two Bank accounts (101400, 101401),
and two Cash accounts (101500, 101501),
by default,
which is not right.

opw-676950
2016-06-27 11:21:35 +02:00
Stéphane Bidoul e30ea5647d [IMP] account: adding the invoice.tax.line id in tax_line_move_line_get() to allow inheritance.
Was PR #12576. Courtesy from sbidoul
2016-06-27 10:55:07 +02:00
qdp-odoo 0a6afa1ff1 [FIX] account: grouping tax lines on invoices when no tax account is set on them. Fixes #12561 2016-06-27 10:55:07 +02:00
Martin Trigaux c20ec2ced6 [FIX] website: truncate description at 160
Search engines (or one at least) truncates the description at 160. The advised
size is between 150 and 160 so no need to force a smaller size. It's a good
idea to keep it at 155 but larger sizes should be allowed.
cf: https://moz.com/learn/seo/meta-description

We could fully remove the limit as there is corner cases where a longer size is
used (https://moz.com/blog/i-cant-drive-155-meta-descriptions-in-2015) but this
should be in addition with an indication for the user of the current size and
the advised size.
2016-06-27 09:55:25 +02:00
Odoo Translation Bot 3e965ecf58 [I18N] Update translation terms from Transifex 2016-06-26 02:57:50 +02:00
Odoo Translation Bot 765b3fc6ac [I18N] Update translation terms from Transifex 2016-06-26 00:29:54 +02:00
Stéphane Bidoul (ACSONE) ee3666237a [CLA] add Denis Roussel in Acsone CCLA
Closes #12570
2016-06-24 14:31:00 +02:00
engelant b00ba0b6db [CLA] signature for engelant
Closes #12551
2016-06-24 14:28:09 +02:00
Nicolas Martinelli 44d23c371c [FIX] crm, sales_team: expected closing
On the Sales Team dashboard, clicking on "exp. closing" will show all
opportunities, not only the one which are supposed to be closed.

opw-681048
2016-06-24 13:43:58 +02:00
Christophe Simonis 4030f2fd32 [MERGE] forward port of branch 8.0 up to 297bbff 2016-06-23 16:21:28 +02:00
Nicolas Martinelli 5ca8f08730 [FIX] purchase: scrap instead of receive
The button scraps the products, so the tip should reflect this behavior.

opw-680788
2016-06-23 16:06:57 +02:00
Nicolas Martinelli 162edf276c [FIX] account_asset: depreciation start date
If the depreciation is not prorata temporis, the start date is defined
as:
- 1st of purchase month if frequency is < 12 month
- 1st of January instead

opw-681564
2016-06-23 15:08:02 +02:00
Nicolas Martinelli b114c9e681 [FIX] purchase_requisition: link stock.move to procurement
When a purchase requisition is created from a procurement, the
subsequent stock moves (create from the PO lines) are not linked to the
original procurement/stock moves.

This is an issue in the following use case:
- Product "Assembly" configured in MTO and manufactured
- Product "Part" configured in MTO and bought from suppliers thanks to
  purchase requisitions
- A BoM is created for "Assembly" and is build from "Part"

When "Assembly" is sold, a MO is created, which generated a purchase
requisition for "Part". The MO is in state "Awaiting for Raw Materials"
since we need to purchase the components.

However, when the components are purchased and received, the MO stays in
the same state since there is not link between the stock move received
from the PO and the stock move created for the MO. The MO is therefore
stuck in "Awaiting for Raw Materials" state.

The fix is to keep track of the original procurement and stock moves.
Ideally, we should link the procurement to the PO lines, but that is not
possible since the field `purchase_line_id` on the procurement is a
Many2one. Therefore, we need to hook the confirmation process and
manually link the stock moves related to the PO to the stock moves
related to the MO.

opw-681138
2016-06-23 12:19:14 +02:00
Denis Ledoux f0c571f773 [FIX] calendar: recurrent events metadata
Developer feature `View Metadata` wasn't working
on recurring events, because of the recurrent events
virtual ids.

opw-678580
2016-06-23 11:51:19 +02:00
Christophe Matthieu 025263d3bf Revert "[FIX] web_editor: test jinja content to load editor in codeview"
This reverts commit f38f8930f0.

Revert for internal choice. Odoo want to use qweb in template and remove jinja support on next version.
If users want to use jinja they can change the view to use text widget instead of html widget.
2016-06-23 11:45:17 +02:00
Denis Ledoux 2e785a8869 [FIX] web_settings_dashboard: Invite new users reload
Before this revision, it wasn't possible to invite new users
(in the Settings Dashboard) multiple times without reloading
the dashboard
e.g. Invite one user, then fill again the textarea, and click
again the `Invite` button

This is because a new widget is created at each reload,
because of:
```
load_invitations: function(data){
    return new DashboardInvitations(this, data.users_info).replace(this.$('.o_web_settings_dashboard_invitations'));
},
```
and
```
reload:function(){
    return this.parent.load(['invitations']);
},
```

and `this.$('#user_emails').val().` is empty at the second reload,
because the textarea retrieved with this selector is the textarea
of the previous widget, which is now empty.

It should probably be proper to make another mechanism for the reload,
that doesn't create a new widget each time,
but we don't take the chances in a stable release. Therefore,
we just use the event delegate target to retrieve the right
textarea.

opw-677680
2016-06-23 11:28:20 +02:00
Denis Ledoux ff090ab23d [FIX] delivery: order delivery line creation with inventory users
When processing the delivery order coming from a sale order,
the delivery line must be created as sudo, as the user
processing the picking could not have the access rights
to create the extra line on the sale order
(e.g. for users being inventory users but not sales
users).

opw-677628
2016-06-23 10:52:58 +02:00
Goffin Simon 7ed73b6d62 [FIX] point_of_sale: creation of a pos session as a user
When an pos session is created, a bank statement is created and
it must be linked to the pos session.
A pos user doesn't have the rights to write and read on a bank statement.
This is why the creation of the pos session and the creation of bank statement
have to be done as super user.

opw:678970
2016-06-23 09:44:13 +02:00
Goffin Simon 55bdf0e8ff [FIX] website_project_issue: Only portal issues must be visible
When going to routes ['/my', '/my/home'], only the project issues in
portal privacy visibility must be displayed.
Inpired from 56c5d0a
The field privacy_visibility is not accessible in portal due to access
rights.

opw:676447
2016-06-23 09:40:51 +02:00
Odoo Translation Bot d14efd562b [I18N] Update translation terms from Transifex 2016-06-22 21:14:56 +02:00
Denis Ledoux b630c199a5 [FIX] web: 2many race condition on fast click on Save / Edit
For `this.viewmanager.active_view` to be set, the view manager
switch mode must be completed, meaning the deferred returned by
the function `switch_mode` must be resolved
(see `this.active_view = view;` in `view_manager.js`, line 146)

In a 2many field, the view manager `switch_mode` deferred is resolved
when `is_loaded` of this field is as well resolved.

Before this revision, clicking fast on Save then Edit
of a vendor bills resulted to a JS error due to a race condition,
because `this.viewmanager.active_view` was undefined when
the field was not loaded / the view manager switch mode not completed.

opw-678097
2016-06-22 18:11:20 +02:00
Alexis de Lattre 297bbff6f5 [FIX] stock: use float_compare to avoid an error in the transfer (The roundings of your Unit of Measures kg on the move vs. kg on the product don't allow to do these operations or you are not transferring the picking at once.) 2016-06-22 15:05:07 +02:00
Christophe Matthieu f38f8930f0 [FIX] web_editor: test jinja content to load editor in codeview
The preview change the content because the browser try to fix the dom.
If a user use jinja and activate the preview, the jinja code is (re)moved by the browser and broke the template.
2016-06-22 14:26:42 +02:00
Raphael Collet ff93777099 [FIX] models: inverse several computed fields based on a common computed field
Consider fields G1 and G2 being computed fields with inverse methods that
require the value of a common dependency F, which is also a computed field.
For inversing G1 and G2, their values are put in cache, then their inverse
method is called.  If the inverse method of G1 requires the computation of F,
setting F's value will invalidate both G1 and G2 in cache.  Hence the value of
G2 is lost when invoking its inverse method!

The fix consists in marking G1 and G2 as being computed before invoking their
inverse method, which prevents them from being invalidated by field F.
2016-06-22 14:01:59 +02:00
Nicolas Martinelli ab94b1fa54 [FIX] purchase: pricelist based on supplier price
DO NOT FORWARDPORT!

If a purchase pricelist depends on the supplier price, the purchase
price in a PO automatically from procurements will be zero.

It was (partially) working before 7613cb3 by luck since the price of the
first supplier was chosen by default if no supplier was found. In fact,
the condition `seller_id.name.id != partner` requires the `partner` to
be an ID, not a browse record.

opw-681105
2016-06-22 10:45:33 +02:00
Martin Trigaux cecc12ffc6 [FIX] doc: adapt the xpath for snippet
To reflect the changes made at 28ed28f9

Fixes #12523
2016-06-22 10:29:41 +02:00
Martin Trigaux 06fd45241f [IMP] hw_blackbox_be: better description
Some users using community version of Odoo may understand that this module turns
the POS into a certified module (which is what pos_blackbox_be does).

Update base.pot to reflect the changes (and add other missing translations)
2016-06-22 09:43:44 +02:00
Goffin Simon 9a36a9b760 [FIX] purchase: Vendor without Vendor Location set
When creating a stock picking from a partner without Vendor Location,
a validation error was raised due to a user error.
2016-06-22 09:29:38 +02:00
Christophe Matthieu a9fac2ea2d [FIX] web: required attribute on one2many field
Require One2many field without any line must show an error like many2many fields.

issue 11782
2016-06-22 09:16:07 +02:00
qdp-odoo b8a58caad1 [FIX] account: in the bank statement reconciliation widget, don't convert amounts using the amount_currency to the target currency if the target currency is the compmany currency. OPW 680854 2016-06-22 08:25:17 +02:00
Odoo Translation Bot 108eee76c5 [I18N] Update translation terms from Transifex 2016-06-22 07:45:52 +02:00
Odoo Translation Bot 41ec7eec56 [I18N] Update translation terms from Transifex 2016-06-22 07:12:57 +02:00
Sebastien LANGE 58e3ac5cd8 [FIX]mrp: order view in mrp bom tree view
The order of BOMs is based on the sequence which is
not present in the view. When you open all
BOMs, any order is defined. This patch will display the
list of BOM by product.

opw:681189
2016-06-21 15:07:09 +02:00
Goffin Simon e049506b70 [FIX] account: _prepare_reconciliation_move_line
float_is_zero(value1-value2) is not equivalent to
float_compare(value1,value2) == 0, as the former will round after
computing the difference, while the latter will round before

opw:678588
2016-06-21 14:14:39 +02:00
Nicolas Martinelli ffe0db0dd1 [FIX] mail: mail template in Discuss
When the mail composer is opened thanks to the "Send Mail" button in
Discuss, it's possible to save a mail template, but the user can't
access it anymore later on.

This is because the field `model` is by default empty in this specific
case since this is a client action. However, when saving the template,
the default value 'mail.template' is used for the `model` field.
Therefore the domain on the `template_id` field prevents the user to
find back the model he just saved.

The fix sends the `active_model` in the context with the value
'mail.message', so that the `default_get` method of
`mail.compose.message` will set the appropriate default value.

opw-677936
2016-06-21 13:02:16 +02:00
Christophe Simonis e8827d013f [MERGE] forward port of branch saas-6 up to be94653 2016-06-21 11:59:15 +02:00