Commit Graph
101943 Commits
Author SHA1 Message Date
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 765b3fc6ac [I18N] Update translation terms from Transifex 2016-06-26 00:29:54 +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
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
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
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
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
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
Christophe Simonis be94653462 [MERGE] forward port of branch 8.0 up to fe15829 2016-06-21 11:55:55 +02:00
Christophe Simonis 0a2317d303 [FIX] test_new_api,web: tests 9.0 adjustments
Rev e37ba61 forward-ported 8.0 revision f02b230 from PR #12379.
This patch introduces extra tests and views for o2m onchange behavior,
including new fields in the test models.

In 9.0 a new convert_to_onchange() mechanism had been
introduced at 9f81c6d

The combination of both requires some adaptation to the
expected results of the new tests and adaptation of existing tests.

The test models in `test_new_api` have an implicit depencies between
models which cannot be express on ORM:
    messages depends on participants of their discussion.

So, when editing a discussion, the field `participants` should be
processed before field `messages`. This is not always done because
field processing order depends of the iteration order of a `dict` (which
is undefined in python).
The testing tour `widget_x2many` worked by chance until now.
Adapt the tour to save the participants before the messages.
2016-06-21 11:23:18 +02:00
Josse Colpaert fe15829c16 [IMP] stock: when applying a push rule the new move should not be linked to the same procurement anymore 2016-06-21 10:16:07 +02:00
Goffin Simon c77745b9c5 [FIX] sale, slae_stock, website_quote: get sale_delay in onchange_template_id
Inspired from a706ada

opw:681245, 681289, 681285
2016-06-20 15:13:01 +02:00
Goffin Simon 6101b856f0 [FIX] Wrong amount currency in account move line
When computing the amount currency, the date must be set in the context
to use the right currency rate.

opw:680693
2016-06-20 14:20:53 +02:00
Christophe Simonis e37ba61832 [MERGE] forward port of branch saas-6 up to b87a93a 2016-06-20 14:20:03 +02:00
Christophe Simonis b87a93a091 [MERGE] forward port of branch 8.0 up to 5b1beec 2016-06-20 13:34:46 +02:00
Nicolas Martinelli eea15ac92e [FIX] point_of_sale: taxes after fiscal position
Commit 358e285 introduces fiscal positions on the PoS. The new taxes
applied should be used in the form view of the pos order lines and in
the detailed sales report.

opw-680796
2016-06-20 12:46:03 +02:00
Christophe Simonis 5b1beec1f2 [FIX] models: commit *before* trying to set NOT NULL constraint
Setting NOT NULL constraints on required fields may fail if there are
any row with unset value for this column.
The ORM handle this case by catching the exception raised and warning
user.

However, not commiting the current transaction before, will rollback
changes made before like setting default values or renaming a column.
2016-06-20 11:53:59 +02:00
Denis Ledoux 1061cb5696 [FIX] expression: search on *2many fields with domain
Some one2many fields have a domain specified
in their definition
e.g.
`mail.thread`.`message_follower_ids`
`hr.applicant`.`attachment_ids`
`project.task`.`attachment_ids`

which is required for the one2many field to make
sense. For the mail thread, it does not make sense
to include the followers of other models with the same
`res_id`.

This domain must be took into account when doing a
'like' search on the one2many field
e.g. Followers contains demo
Otherwise it will include threads from other model

opw-680825
2016-06-20 10:53:37 +02:00
Nicolas Martinelli 8a1d7dfe7b [FIX] sale_stock: do not count discount twice
When a product is a kit and a discount is applied thanks to a pricelist,
the discount is counted twice if the invoice is created from the stock
picking.

This is because the pricelist will modify the price unit, but moreover
the discount will be applied a second time by the method
`_compute_price` of the account move line.

opw-676838
2016-06-20 08:36:19 +02:00
Odoo Translation Bot cd369396d9 [I18N] Update translation terms from Transifex 2016-06-19 02:59:13 +02:00
Xavier ALT f02b23006b [FIX] fields: during an onchange(), do not invalidate *2many fields because of their domain
Our usage of domain on fields One2many seems to trigger an obscure behaviour on
onchange.

With the following (simplified) config:

    Message(models.Model):
        _name = 'test_new_api.message'
        important = fields.Boolean('Important')

    Discussion(models.Model):
        _name = 'test_new_api.discussion'
        name = fields.Char('Name')
        important_emails = fields.One2Many('test_new_api.emailmessage', 'discussion',
                                           domain=[('important', '=', True)])

    Email(models.Model):
        _name = 'test_new_api.emailmessage'
        _inherits = {'test_new_api.message': 'message'}

        discussion = fields.Many2one('test_new_api.discussion', 'Discussion')
        message = fields.Many2one('test_new_api.message', 'Message')

Steps:
- We change 'name' on discussion, triggers an `onchange()` call
- we ends up filling cache on virtual record (on secondary fields, we calling
  record.mapped('important_emails.important'))
- we get a cache miss ('important' field not provided, only 'important_emails' ids,
  i.e with no change on existing records)
- we fill the cache, this mark 'important' field as modified
- because of commit 5676d81 and because 'important' is that case is a related (i.e
  computed) field we triggers cache recomputation
- as there is no way to recompute 'important_emails' for virtual record (no real
  ID) we ends up with empty 'important_emails' generating removal of existing records.

=> Finally changing any value for 'test_new_api.discussion' that trigger an onchange
will always reset 'important_emails' to empty

Fixed by Raphael Collet <rco@odoo.com>, and test by Xavier Alt <xal@odoo.com>.
2016-06-17 17:50:25 +02:00
Jeremy Kersten 39a7ce44b0 [FIX] tools: don't save dev_mode in config file.
When user reset master password from web database manager, the
config file is saved.

If server was started in dev_mode the param dev_mode was saved
in openerp_serverrc silently. (in 9 or always in trunk)

Remind: --dev_mode should be never used on a production server.
2016-06-17 17:19:00 +02:00
jeffery chen fan bcb191f273 [FIX] crm_profiling: backport of cf9230d1ff
Do not redefine the view arch but do a proper inherit.
It was a problem as the redefinition removed some fields (headers,..).
It was also a problem if crm_profiling was uninstalled as the redefinition was
not removed.

Closes #12454
2016-06-17 15:19:39 +02:00
Nicolas Lempereur e1deae7eab [IMP] base: allow 'render' override with new api
New API use a frozendict for context, so when a function in the call
chain is overrided by new API (eg: render function of ir.qweb) the code
now changed by this commit would cause an error.

Instead this code duplicate the context frozendict as a dict removing
the need to set back the intial language in the context.

opw-681167

note: no need for >=saas-11
2016-06-17 15:11:06 +02:00
qdp-odoo ba49172929 [FIX] account: on ir_sequence, number_next_actual must always be read instead of number_next which might contain wrong value in case of 'standard' sequence. This was causing a crash on creating a new invoice, if demo data were installed and the user went to settings\accounting to do some modification. Issue #12471 2016-06-17 14:41:12 +02:00
Jeremy Kersten e9aa5fdd85 [FIX] base: fix domain of serialization_field_id in ir model field view
During refactoring of the field view, parent.model has been replaced by
model_id since it is more elegant. (odoo/odoo@4a60a3)

That was correct when you was working directly from the ir.model.field.
But if you was comming from ir.model -> fields -> 'add an item', the
model_id is unknow in the context of pyeval.

This commit close #12455
2016-06-17 12:13:35 +02:00
Christophe Simonis 8284c7389f [FIX] website_quote: avoid setting unknow field
The field `delay` on `sale.order.line` has been renamed into
`customer_delay` and is already set.

This revert commit d0d3ba921d.
2016-06-17 11:09:44 +02:00
luc-demeyer 1750b90252 [FIX] account: fixed group_lines method of invoices.
The group_lines method didn't make the sum of the quantity field, hence resulting in incorrect results when making product based statistics from the account.move.line records.

Courtesy of Luc De Meyer. Was PR #10551
2016-06-17 10:27:53 +02:00