Commit Graph
117156 Commits
Author SHA1 Message Date
Pragnesh Mistry faf7225022 [IMP] account,...: Improve accounting menuitems
A little bit a reorganization, typo correction, menuitems uniformization between localizations, useless menuitems removal.
2017-07-26 16:35:53 +02:00
Yannick Tivisse c5bd509274 [FIX] pad: Update the pad if the pad_content_field is modified
If the pad content field is modified in Odoo, the content of the pad should be modified too.

Example: When merging tasks, the tasks descriptions are concatenated into the target record. But the taregt pad is not modified if it already exists.
2017-07-26 16:01:09 +02:00
Christophe Simonis 0a089f87fb [MERGE] forward port branch saas-11 up to 4bf6f5a7e3 2017-07-26 15:45:37 +02:00
Christophe Simonis 4bf6f5a7e3 [MERGE] forward port branch 9.0 up to da0eb25221 2017-07-26 15:41:11 +02:00
Nicolas Martinelli 44b6d608b0 [FIX] website_links: missing translations
opw-756108
2017-07-26 15:03:15 +02:00
Christophe Matthieu 8fa7c68ca8 [IMP] tools: add a profiler for odoo performance analysis
Use ``profile`` to decorate an entry point method.
If ``profile`` is used without params, log as shallow mode else log
all methods for all odoo models by applying the optional filters.

:param whitelist: None or list of model names to display in the log
                 (Default: None)
:type whitelist: list or None
:param files: None or list of filenames to display in the log
                (Default: None)
:type files: list or None
:param list blacklist: list model names to remove from the log
                (Default: remove non odoo model from the log: [None])
:param int minimum_time: minimum time (ms) to display a method
                (Default: 0)
:param int minimum_queries: minimum sql queries to display a method
                (Default: 0)

.. code-block:: python

  from odoo.tools.profiler import profile

  class SaleOrder(models.Model):
    ...

    @api.model
    @profile                    # log only this create method
    def create(self, vals):
    ...
    @api.multi
    @profile()                  # log all methods for all odoo models
    def unlink(self):
    ...
    @profile(whitelist=['sale.order', 'ir.model.data'])
    def action_quotation_send(self):
    ...
    @profile(files=['/home/openerp/odoo/odoo/addons/sale/models/sale.py'])
    def write(self):
    ...

NB: The use of the profiler modifies the execution time
2017-07-26 15:02:59 +02:00
Nicolas Martinelli da0eb25221 [FIX] l10n_be: VAT-IN-V81-12-EU
The tax 'VAT-IN-V81-12-EU' should be a group of taxes, similarly to
'VAT-IN-V81-06-EU' and 'VAT-IN-V81-21-EU'.

opw-752879
2017-07-26 13:20:55 +02:00
Nicolas Lempereur 69236ada46 [FIX] web: sorted saved filter lost in merge
In 3071ef16c sorted filter was added, but arround the same time with the
change of filter in 6c579354 the js part of the feature was lost.

This commit adds it back.

opw-749422
closes #18361
2017-07-26 12:47:14 +02:00
Thibault Delavallée 50794f64af [FIX] website_portal_sale: fix link to invoices of an order on customer portal
Route seems to be /my/invoices/<id> and not /my/invoices/pdf/<id> anymore.
2017-07-26 10:26:37 +02:00
Yannick Tivisse f63ad48834 [FIX] account: Retrieve correctly default taxes on account settings 2017-07-26 09:25:27 +02:00
Nicolas Martinelli 1c4f779c33 [FIX] report_intrastat: fiscal position on invoice
Display both fiscal position and fiscal position remark on invoice.
Since the note is usually empty, it most of the time displays an empty
label next to 'Fiscal Position:'.

opw-756720
2017-07-26 09:16:53 +02:00
Nicolas Martinelli cfc2a55c06 [FIX] point_of_sale: discount != 0
Display "Discount:" only if strictly larger than zero. Most of the time,
it just shows 'Discount: 0.00'

opw-757101
2017-07-25 19:06:28 +02:00
Wolfgang Taferner 901d777591 [FIX] website_sale_stock: use sale order warehouse default first
Taking unrelated first warehouse can only be the last fallback, so we
check first if there is a default value for the SO.

opw-756265
2017-07-25 18:33:37 +02:00
Simon Lejeune 2d137f56c8 [REF] stock: action_done on stock.move.line
Before this commit, `action_done` on stock.move.line was intended to
receive the recordset of the move lines of a single move where the move
lines having a null `qty_done` were already unlinked.

This part of code was in stock.picking's `button_validate` and not
copied in mrp, and weird things happened when mrp tried to run
`action_done` on a stock.move.line with a `qty_done` of 0.

We move this check directly in `action_done`, as well as the check on
the picking type that was done in stock.move's `action_done`.

We also adapts rev[0] that was not working anymore since the new stock,
and add some tests.

[0] e79eaecc46
2017-07-25 17:24:12 +02:00
Christophe Simonis fa38adef5a [FIX] product: natural order for products
It has been remove with 08a85eb458 but
was somehow usefull.
2017-07-25 16:30:20 +02:00
Wolfgang Taferner bfa55e42f9 [FIX] hr_attendance: constraint must allow same time for check out/in
The constraint does not allow the same check out time as the next
check in time which might be rare but a possible and likely use case.

opw-756694
Closes #18400
2017-07-25 15:51:56 +02:00
Wolfgang Taferner 77b68a170d [FIX] purchase: fiscal position change must trigger a tax recomputation
It applies the same behavior than in the Sales module.

opw-756556
Closes #18377
2017-07-25 14:36:10 +02:00
Christophe Simonis 5ed09bc17c [MERGE] forward port branch saas-11 up to c16ec6405b 2017-07-25 14:27:31 +02:00
kujiu 2771b23a35 [FIX] web: do not delete records for one2many with widget=many2many
Some one2many fields are called with a many2many widget to unlink
records instead of delete them. But this behavior was modified with the
new views and the records were deleted anyway.

In this commit, we restore the previous behavior, and create a FORGET
command in basic model
to do that. Note that the widget='many2many' is a hack, and a better way
to accomplish this is to use a new custom option. But this would be a
fix for master  (PR #18413)
2017-07-25 13:43:37 +02:00
Christophe Simonis c16ec6405b [MERGE] forward port branch 9.0 up to 34bc9b4983 2017-07-25 13:04:29 +02:00
Martin Trigaux 044b8b1240 [I18N] export saas-16 source terms 2017-07-25 12:26:50 +02:00
Odoo Translation Bot 621e392b52 [I18N] Update translation terms from Transifex 2017-07-25 12:14:02 +02:00
Elkasitu a4e30a1b43 [FIX] web: prevent crash in FieldReference
Trying to display external identifiers would make the server crash
because the method in charge of requesting the external id information
would expect an object but it was being given a string and thus not
computing the m2o_value for the record.

This commit fixes this by changing FieldMany2One objects' m2o_value
instatiation to use its _formatValue method to compute it, _formatValue
is then overridden in FieldReference so that it properly handles both
strings and objects to calculate its m2o_value and relation.
2017-07-25 12:04:19 +02:00
Odoo Translation Bot 34bc9b4983 [I18N] Update translation terms from Transifex 2017-07-25 11:46:16 +02:00
Géry Debongnie a41db9a2cf [FIX] web: allow record creation even if onchange returns warning
Before this commit, the makeDefaultRecord could return a rejected
deferred if the onchange returned a warning.  This was useful in this
usecase: the user is in a form view with a one2many (for example, an
invoice with no customer set), then click on 'Add a line' (the invoice
line).  In that case, the onchange returns a warning, and we do not want
to add the line at all, so the makeDefaultRecord is rejected.

This works fine, but we then have another problem: when we create a new
record from scratch, it may happen that a warning is returned (for
example, if a vendor has its 'warning on invoice' flag set, then a
purchase order is done with this vendor, then confirmed, then the stat
button for 'vendor bills' is clicked, which opens a list view with the
vendor in the context.  Clicking on 'create' will return a warning,
which is what we want).  In that case, the record still needs to be
created.

To solve this issue, we simply add an option to the makeDefaultRecord
function to prevent rejecting the deferred.
2017-07-25 10:58:14 +02:00
Richard Mathot 4c6c16a382 [IMP] delivery: mechanism to log XML requests
This will help future debugging of integrated shipping providers by
enabling the logging of XML requests in ir.logging table.
2017-07-25 10:42:27 +02:00
Lucas Perais (lpe) 890152cb6b [FIX] website_sale, website_sale_options: fix modal prices
Backport of 8bd56bb466

OPW 744943

Closes #18416
2017-07-25 09:09:30 +02:00
Christophe Simonis 06b670e6ba [MERGE] forward port branch 9.0 up to e2a255717f 2017-07-24 19:41:30 +02:00
qsm-odoo 67e2372d61 [IMP] web_tour, *: allow to extend timeout limit for specific steps
* website

Unfortunately, we cannot guarantee that the duration between two odoo
actions is always less than 10 seconds. Indeed, loading translations
is for example quite slow. With this commit, we are now able to modify
the timeout duration for a specific step.
2017-07-24 17:55:00 +02:00
Richard Mathot 35601dfe6f [REM] tools: old and unused lib pdf_utils 2017-07-24 16:54:42 +02:00
Simon Lejeune 8822b7cfa4 [FIX] stock, stock_account: add move when picking is available
When a picking is available, any added stock move should directly be in
the available state. This is done thanks to a key in context put in the
one2many (stock.move) field on the picking view and an override of
stock.move's default_get. Sadly, an extension of the picking view in
stock_account redefined the context attributes, and the new context did
not have the special key we need. As all the context keys present in
stock_account are present in stock, we remove the extension. And we add
a simple test in stock.
2017-07-24 16:06:57 +02:00
Martin Trigaux 09c6d9f7ce [I18N] Update translation terms from Transifex 2017-07-24 15:45:48 +02:00
Xavier Morel 44304b7e24 [FIX] P3: reintroduced issues
* can't compare a function and a float in Python 3 (it works in
  Python 2, though it makes no sense and was just hiding a bug)
* no iteritems method on dict in Python 3 (use compat helper)
* P3-invalid "except" syntax (sadly pylint apparently does not have a
  standard lint for that, though it's easy to catch... if you can run
  the code under P3)
2017-07-24 15:13:03 +02:00
Nicolas Martinelli 8354efde0a [FIX] account: missing dependency
Introduced by 1e4f4299bc

opw-756270
2017-07-24 15:10:11 +02:00
David Tran 7106db6ca1 [IMP] point_of_sale: improve report.pos.order report for extendability
Closes #18253
2017-07-24 14:34:35 +02:00
qsm-odoo 5f1ef0910b [IMP] web, *: lazy load dialog xml template
* web_editor, web_planner, website

The 'Dialog' class is used in both backend and frontend. Also, lots of
actions can be done without the use of any modal. It thus makes sense
to lazy load its related xml only when a first modal is opened.

This change also allows to get rid of the "base_common.xml" file as the
dialog template is the only remaining one in there and, in the future
website update, it will allow to not load any static XML file on website
page loadings.
2017-07-24 14:28:35 +02:00
qsm-odoo 68766764bc [IMP] web: get rid of WidgetButton template
Qweb rendering is great to render "complex" widget structures. However,
using it to render something as simple as a button was not very
meaningful. This commit deletes the "WidgetButton" template and replaces
it with an utility JS function to render buttons according to given
parameters.

Also, this change will allow a better change. Before this commit, the
only templates left in the "base_common.xml" file are the "WidgetButton"
and the "Dialog" ones. With the removal of "WidgetButton", the file can
now be lazy loaded only if necessary, on the first dialog instantiation.
This will allow to remove the need to load static XML files on each
frontend page loading.
2017-07-24 14:26:59 +02:00
Richard Mathot afc5c0709a [FIX] delivery: missing parenthesis
Thanks to @xmo-odoo and its Python3 virtual machine for spotting this
one (and shame on Python2 that does not crash when comparing a method to
a float because voilà).
2017-07-24 14:11:55 +02:00
qsm-odoo f2521c9449 [FIX] web: frontend does not need X.tooltip templates
WidgetLabel.tooltip and WidgetButton.tooltip are backend static xml
templates. They should never have been in base_common.xml.
2017-07-24 13:41:50 +02:00
qsm-odoo dbfdd86cc2 [IMP] web: add a widget property which allows to lazy load xml files
Add the 'xmlDependencies' key to the 'Widget' class. If defined, it is
an array of URLs to XML files that the widget will need to work.
Those are loaded in the `willStart` method so that they are available
before all rendering parts.
2017-07-24 13:41:50 +02:00
qsm-odoo 417a664f16 [REF] web: improve ajax.loadXML behaviors
- Refactor the function and document it
- Multiple calls to the function with the same URL now load the
  templates only once
- A call to the function with an URL now returns a deferred which
  indicates when the given URL has been loaded (not when all the
  calls to the function are finished)
2017-07-24 13:41:50 +02:00
Thibault Delavallée 69c083583c [FIX] website_payment: add requirement on website
In order to be sure website is loaded and to allow searches in DOM require
on website was necessary. This is a partial revert of e66ba3ce1e
that was a bit hasty.
2017-07-24 13:35:15 +02:00
Martin Trigaux 9931a29930 [FIX] stock: include zero quantity products in search results
A special case was made for products not available when running a search on
the qty_available field.

For domains like ('qty_available', '<=', 5), it should include non-available
products too.

Fixes #18336
2017-07-24 13:23:08 +02:00
Jaykishan Solanki bee246b22b [FIX] stock: populate date_done field on picking 2017-07-24 13:14:37 +02:00
Khoi Nguyen 952c17b8a7 [FIX] web: add tooltips for buttons
Button tooltips have been missing since the switch to the new views. As
their omission was unintentional, this revision restores the
functionality.
2017-07-24 13:14:23 +02:00
Christophe Simonis f00aa596a3 [REL] back to v11 alpha 2017-07-24 13:06:32 +02:00
Laurent Smet cae497b679 [FIX] account_accountant: allow install coa without required transfer account (#18356)
Create a company, try to install a coa without specify an Interbank Transfer Account (required field):
The COA can't be installed due to the missing Interbank Transfer Account that will be created by the COA... that leads to a "deadlock".

-opw: 752928
2017-07-24 12:47:33 +02:00
Kinjal Mehta 0a13b7a7a2 [IMP] product: Remove field Category Type on product category
Purpose
=======

It is possible to break the installation of any module if a module that creates a product should be installed.

to reproduce:
set "all" as category of one product
then change "all" category to view type
then install pos (because pos installs one product)

you will get the error message in a traceback

See https://www.odoo.com/web#id=748876&view_type=form&model=project.issue&action=963&active_id=49&menu_id=4720

Specs
=====

remove "Category type" in categories

it seems to me the only usefulness of this was the deprecated tree view of product categories (no longer exists)
2017-07-24 11:46:09 +02:00
Pierre Masereel e2a255717f [FIX] stock: MTO move status
When we validate a SO with an MTO product, then an RFQ and a delivery
picking are created. The status of the delivery picking is in state
'confirmed', but should be 'waiting' as the delivery waits for a
specific delivery input.

The problem is caused by the unreserve method, which is called in the
'procurement_jit' module. This method only checks that a move has
ancestors to determine if the move should be in waiting or in confirmed,
which is not the case for our delivery move because the RFQ has not been
validated yet so there is not ancestors yet.

To fix this issue, we check the 'procure_method' of the move, and if it
is in 'make_to_order' we put it in 'waiting' instead of 'confirmed'.

We also fixed the function recalculate_move_state that could cause the
same problem.
2017-07-24 10:53:36 +02:00
Nicolas Martinelli c4ebea8cb1 [FIX] sale: taxes on report
- Create a tax using the tax template 'GST + QST for sales'
- Create a SO with the following lines:
  Product 1 100 Units @ 0.1
  Product 2 2000 Units @ 10.334
  Product 3 2000 Units @ 10.334
  Product 4 5000 Units @ 0.1
  Product 5 1500 Units @ 0.1
- The totals are:
  Amount without taxes: 41996.00
  Taxes: 6288.90

When printed, the quotation gives:
  Amount without taxes: 41996.00
  Taxes: 6286.52

This is due to the method `_get_tax_amount_by_group`, which is using
`line.price_reduce` for tax computation. Since it is a Monetary field,
it is automatically rounded to the currency precision, while it should
be rounded with the same precision as `price_unit`.

Introduced in 99743cc4aa

opw-752487
2017-07-24 10:47:37 +02:00