Commit Graph

94819 Commits

Author SHA1 Message Date
Raphael Collet a3ec5a35a5 [FIX] fields: in `copy_cache`, add single records to set `todo` 2016-02-04 14:33:53 +01:00
Raphael Collet 0f2e7d783e [FIX] fields: make `copy_cache` use a todo list instead of recursion
The recursion was based on an incorrect assumption: the cache of the target
environment is initially empty.  If another computation left some value there,
the copying is incomplete, and that causes bugs in onchanges.
2016-02-04 13:48:28 +01:00
Olivier Dony 67a63e2cc9 [MERGE] Forward-port 7.0 up to rev. cb609bd425 2016-02-03 16:42:29 +01:00
Denis Leemann 5b4d303d05 [FIX] kanban: 180 in Firefox 43+ and Chrome 48+
The kanban CSS applies both a 90 degree rotation and a top-bottom rtl
writing mode to folded kanban group titles. This was initially fine
because browsers didn't support the (SVG) "tb-rl" value for writing-mode
and the property was thus ignored. Firefox 43 (December 2015) and Chrome
48 (January 2016) added support for this value, and thus now end up with
a 180 degree rotation on the title.

Issue #7955 fixed it in 8.0 due to MSIE impact, this is essentially a
backport to 7.0.

close #10687
2016-02-03 15:03:43 +01:00
Martin Trigaux aca28c82b4 [FIX] website_sale: do not compute price of every pricelist
This controller was very slow as not providing a pricelist computed the price of
all products of all pricelists.
Instead only fetch the prices for the useful products.
2016-02-03 12:05:42 +01:00
bima d01ecb6e79 [FIX] stock: wrong variable used in _handle_renaming
Could incorrectly rename the stock.location.path objects, and in case
the route has push_ids but no pull_ids would crash the method entirely.

closes #10747
2016-02-03 09:55:43 +01:00
Olivier Dony cb609bd425 [FIX] tools.misc: log errors when parsing fails 2016-02-03 02:25:09 +01:00
Olivier Dony e8d06f7b20 [MERGE] Forward-port 7.0 up to bdbcbea285 2016-02-03 00:40:27 +01:00
Olivier Dony bdbcbea285 [FIX] marketing_campaign: incorrect field accessor 2016-02-02 22:43:39 +01:00
Olivier Dony cc724c2e61 [FIX] base: centralize custom data serialization for builtin types only 2016-02-02 22:42:31 +01:00
Olivier Dony 000c681f1e [FIX] ir.values: remove redundant deduplication logic
Handling update/create of existing values is already
handled by ir.values.set() itself.
2016-02-02 19:49:09 +01:00
Xavier Morel 8848af76f0 [IMP] account: recordset calling conventions for fixed has_group 2016-02-02 18:28:23 +01:00
Xavier Morel ccb0f6db61 [FIX] base: has_group behaviour under the new API
While the signature makes sense in an old API context (sort-of) it's
very easy to misuse in a new API context as one'd expect `has_group` to
use the subject (recordset), not the user in the environment, compounded
by ``env.user`` being browsed as administrator, resulting in the
"obvious" ``env.user.has_group(foo)`` checking if the
administrator (rather than the current user) has the specified group.

Adds a divergent v8 version of has_group which first checks if it's
called on a non-empty recordset, and in that case use the recordset id,
otherwise fallback on the context user (to handle new API conversions
which used the "correct" call convention rather than the obvious one).

fixes #9649
2016-02-02 18:28:23 +01:00
Nicolas Martinelli 3ac46ee3d4 [FIX] stock: propagate UoS quantity
Both UoM and UoS quantity change should be propagated.

Fixes #10623
opw-667805
2016-02-02 11:25:57 +01:00
Raphael Collet a688bcdbbd [FIX] fields: make `copy_cache` not invalidate the cache! 2016-02-01 18:01:02 +01:00
Goffin Simon 08b286111c [FIX] models: `MissingError` when writing on recordset with duplicates
When writing on a recordset with duplicates, the ORM raises a `MissingError`
because the rowcount gives a difference with the injected ids.  The fix simply
eliminates duplicates from ids.
2016-02-01 14:56:49 +01:00
Martin Trigaux a46f8bb9c5 [FIX] tools: do not generate translations for exported records
When a record is exported, an external ID, in the form of __export__.<model>_<id>
is created on this record.

When the translations are generated (e.g. "synchronise terms" wizard), the
translations may be duplicated for records that have been exported. If a
translation is submitted before the export (when the record had no external ID
yet), a new empty translation is created as the module differs in the import.

Creating a new translation may be a problem as the new term (equal to the source
term) will be used as the translation value.

Fixes 9480
2016-02-01 14:13:34 +01:00
Goffin Simon 9481ee5c2f [FIX] sale_margin: Cost price in a SO line
The margin in a SO line is the difference between the price unit and
the cost price of this SO line. In function "_product_margin" in model
"sale.order.line", the cost price is equal to the purchase_price or
the standard_price of the product. Then the cost price in the SO line
must be set with the same value when creating SO line linked to the delivery.

opw:668090
2016-02-01 13:29:25 +01:00
Denis Ledoux 2083c16606 [FIX] account: bank statement lines indeterminist order
The order of a bank statement lines is entirely done on the sequence:
`_order = "statement_id desc, sequence"`

The `create` method of `accounT.bank.statement` is overriden
to handle the sequences of each line.

The `write` method as well, except that the set of the sequences
lines is done after the call to `super`. So, if you add
several new lines to a bank statement, the order of the line
you just added can be different before and after save,
as the sequence of these new lines are not set before
actually writting them on the bank statement.

The widget `handle` serves this sequencing purpose. The
fact it isn't used here is most-likely because
it did not exist at the time this was designed.

Besides, this gives the possibility to the user
to add a new line and re-order it where he wants.
For instance, when manually entering a bank statement,
a user could skip unintentionally a line. If he would
like to add it at the right place, before this revision,
he would have to delete all the lines coming
after the line he skipped. Now, he can add
it at the end, and re-order it where he wants.

What is done in the overriden `create` and `write`
is now useless, but we left it for retro-compatibility
purposes, for databases updating their sources without
updating their views.

opw-667541
2016-02-01 12:53:22 +01:00
Odoo Translation Bot 72983cac8e [I18N] Update translation terms from Transifex 2016-02-01 00:29:03 +01:00
xmo-odoo 19a1c18f57 [FIX] make m2m checkbox labels clickable 2016-01-29 16:24:14 +01:00
Goffin Simon bafa1a677e [FIX] stock: creation of stock inventory adjustement
The system cannot create two inventory adjustements in state 'in Progess'
with the same product, with the same location, same package, same lot and
same owner.
Example:if two adjustments(ADJ1, ADJ2) are created with the same product(P)
and with the same location(L), let's say:
qty_available for P is 10
in ADJ1: Theoritical Quantity=10 and Real Quantity=20 => a quant with +10 is created
in ADJ2: Theoritical Quantity=10 and Real Quantity=30 => a quant with +20 is created

When ADJ1 is validated then qty_available for P is now 20(that 's ok)
When ADJ2 is validated then qty_available for P is now 40(that's wrong because
the Real Quantity is expected which is 30)

This is why this fix is required.

opw:660658
2016-01-29 12:25:30 +01:00
xmo-odoo edeb5a8c0f [FIX] module finder path parameter should be optional
According to PEP302, the signature of `Finder.find_module` should be 
`find_module(fullname, path=None)`.

Ever since it was introduced in 64ec5f36df the addons import hook 
defines the second parameter as mandatory, which is an issue for
systems relying on the specified behaviour (and not needing to
provide a path) like the stdlib's `pkgutil.find_loader`.

fixes #10670
2016-01-29 10:20:08 +01:00
Raphael Collet ca7983a40f [FIX] account_budget: in test, use `float_compare` to compare amounts 2016-01-29 09:37:27 +01:00
Raphael Collet 812332855a [IMP] fields: speedup `Float.convert_to_cache` by not rounding the value 2016-01-29 09:37:27 +01:00
Raphael Collet f0646cb51b [IMP] fields: use a "lazy" cursor to compute attribute `digits`
Borrowing a cursor each time you access `field.digits` may be costly, because
of the connection reset.  Moreover, in most cases, the cursor is not used at
all, since the decimal precision are kept in cache.

For the installation of module `product` with its demo data, the number of
cursor allocations was reduced from ~1500 to about 50!
2016-01-29 09:37:27 +01:00
Joren Van Onder 6f4e7867f0 [IMP] hw_escpos: add the MAC address to the ticket printed at startup
Usually when setting up a POSBox you want it to have a static IP. The
best way to do that is by configuring whatever DHCP server is
used (usually just on the router) to always assign the same IP to a
certain MAC address (naming depends on what is being used, sometimes
it's called static DHCP but it's also known as DHCP reservations and a
bunch of other names).

The process of setting this up is complicated for a non-technical user,
and this attempts to make it a little bit easier to do by immediately
giving them the correct MAC address they should use. To avoid confusion
this only prints the MAC addresses for interfaces which have an IP
address.
2016-01-29 09:25:15 +01:00
Nicolas Lempereur 29be9ae80b [FIX] web: conserve /id for saved export list
With 003d85b instead of getting the name of the relation
field_relation we get field_relation/id which will get us an xmlid
instead.

But the data about related fields are not gotten all at once when
opening the export modal. They are gotten by clicking on the arrow of
the related record.

It is in this data that the /id will be appended for the field, but when
getting a saved export list, this data may not be available.

This commit immediately add the `/id` when a field is put in "Fields to
export" column, so this inconsistency is no more.

closes #10640
fixes #10327
opw-665994
2016-01-28 17:27:18 +01:00
Denis Ledoux fd038801c0 [FIX] im_livechat: Strict MIME type.
Backport of revisions
 - 100d604cb0ebd6aa3f57c9809c6771b0b4b72a07
 - ddd3e08fbcb54e971537f9f20668c00dbe36ab37
opw-667814
2016-01-28 16:48:46 +01:00
Raphael Collet 995b257a6c [FIX] fields: make `related_sudo` work for draft records (2)
Traversing new records in a different cache requires that all new records on
the path are copied across caches.  Make the copy across caches recursive when
the first record on the path is a new record.
2016-01-28 16:33:09 +01:00
Denis Ledoux afd2dbfb7f [FIX] mrp_repair: quotation report, shipping and invoice address
Copy the structure of the sale order report regarding the
partner, invoice and shipping address.

Besides, on a repair order, this is possible
to set a shipping address without setting
an invoice address (if no invoicing is set).

In such a case, the `Invoice address:` must be hidden.

opw-666506
2016-01-28 15:08:06 +01:00
Luc De Meyer b493faf595 [FIX] account: pass context as kwargs
context -> context=context in writes within validate.
This is required for super().write with new api.

Closes #10645
2016-01-28 17:30:41 +05:30
Jeremy Kersten bb2ecb3672 [FIX] website: typo - missing s
Who has eaten the s ?
2016-01-27 17:55:35 +01:00
Denis Ledoux e2d16ea04a [FIX] account_voucher: unreconcile with deleted journal items
This is possible to unreconcile and then remove journal
items associated to `account.voucher.line`.

When it's done, the voucher is within a corrupted state,
with debits and credits lines without journal item, which
is required.

Because the journal item of this line is empty,
while required, this is no longer possible to use
the "Unreconcile" button, because the form is invalid.

In order to allow to unreconcile a posted customer/supplier
payments with missing journal items, we set
the journal items as required only when the payment
is within the `draft` stage.

opw-667232
2016-01-27 16:36:26 +01:00
Joren Van Onder 634c62610e [FIX] purchase: only search in requested model
Because otherwise a user who has access to a view displaying
supplier_invoice_count will get an access error if he doesn't also have
access to purchase.order, even if that wouldn't have been displayed.

opw-666935
2016-01-27 13:13:03 +01:00
Christophe Simonis 43a4ffe6b6 [MERGE] forward port of branch 7.0 up to 098c084 2016-01-26 18:09:05 +01:00
Nicolas Lempereur e95b01db3e [IMP] web_graph: XLS export fail if more than 256 columns
When creating a XLS file with more than 256 columns, the library used
(xlwt) fail since it is targetted to support MS Excel 97 up to
Excel 2003.

But Odoo doesn't has no check and in this given instance (an error
happening in a controller generating a binary filte) the real error
message is lost.

This commit check if the to-be exported data has more than 256 columns,
and if this is the case display an error message without even trying
the export.

closes #10630

opw-660474
2016-01-26 17:38:52 +01:00
Yuriy A. Apollov 098c084eae [FIX] orm: iteration on `browse_null` object lasts forever 2016-01-26 17:34:39 +01:00
Stefan Rijnhart 014a1294b2 [FIX] Context argument may be immutable 2016-01-26 17:18:35 +01:00
Raphael Collet d0c18d7a85 Merge pull request #10228 from hbrunn/8.0-search_computed_in_path_odoo
[FIX] search with computed fields in path
2016-01-26 15:59:01 +01:00
Holger Brunn 6fd57c2188 [FIX] allow searching for new style function
fields in a search path
2016-01-26 14:15:22 +01:00
Denis Ledoux ab245fcaa2 [FIX] stock_account: stock valuation at date total
When performing a stock valuation at date,
the stock valuation total wasn't equal
to the sum of each line of the report.

This is because the domain forcing the
date wasn't passed to the `search` call
when no group by was applied.

Indeed, when calling
`read_group` with a group by, the lines in the results
contains the domain used for each line, but when
there is no group by applied, this is not the case, the domain
is not included in the line dict returned by `read_group`.

In such a case, therefore, we must use the domain that was passed to
the `read_group` call.

opw-667761
2016-01-25 18:29:28 +01:00
David Monjoie 11fe2d5b6d [FIX] mass_mailing: added missing models in form view
Backport of fda5021e6b6b81c1f7d5de60dffc5821e521b484 that I
erroneously did in 9.0, thinking it was reported on 9.0.
2016-01-25 13:42:37 +01:00
Denis Ledoux 7ad309e015 [FIX] survey: matrix results after row deletion
In a survey question of type `matrix`,
nothing prevents to remove a row from the matrix,
even if there are already answers for this line.

If the case happens, the row is deleted, but
not the answers. The answers are therefore orphan.
The answers should probably be deleted when the
row is removed from the survey, but this is a risky
change, and, even, users might want to keep track
of the answers given even if the line doesn't exist
anymore in the survey.

Therefore, we just handle the case when displaying
the survey results,
we ignore matrix answers for which the row no longer
exists.

opw-666393
2016-01-25 11:32:31 +01:00
Odoo Translation Bot dc48744bf7 [I18N] Update translation terms from Transifex 2016-01-24 03:00:37 +01:00
Raphael Collet 70fdb5a26e [FIX] calendar: in method write(), process all records and not the last one only 2016-01-22 17:12:09 +01:00
Raphael Collet 748a719fd9 [FIX] fields: make `related_sudo` work for draft records (used by onchange)
Accessing a related field with `related_sudo=True` on a draft record should
effectively traverse the fields as the admin user.

This fixes #5121, #7138.
2016-01-22 16:06:27 +01:00
Goffin Simon ec0e413099 [FIX] website_sale: Suggested alternatives
Suggested alternative descriptions spill out of the boxes if the
description is too long.

PS: same fix as in saas-6 with f7110b46bef2d84cd2ce864f5bdd747457099e1e.
This fix doesn't have to be forwrad ported.

opw:667343
2016-01-22 15:41:54 +01:00
Goffin Simon 5009944410 [FIX] stock: action_cancel
When writing several times on the same record in the same transaction,
the orm raise a Missing error because the rowcount only gives one
difference.

opw:666470
2016-01-21 14:51:56 +01:00
Goffin Simon c790464fd6 [FIX] hr_payroll_account: onchange_contract_id
If there is no contract then the default journal_id must be set.
PS: The field "journal_id" in "hr.contract" model is not required.

opw:667093
2016-01-21 10:12:43 +01:00