Commit Graph
103231 Commits
Author SHA1 Message Date
Nicolas Martinelli e680f29560 [FIX] account, sale: modify invoice
When a user validates an invoice linked to a SO, he might want to modify
it afterwards thanks to the 'Modify' option in the refund wizard. This
will create a refund, reconcile and create a draft invoice.

The issue is that the draft invoice is not linked with the SO.

The fix is to link, in this specific case only, the draft invoice to the
SO. At the same time, we have to make sure to:
- unlink the first invoice (to prevent counting the quantity as invoiced
  in the SO)
- keep track of the first invoice/refund in the invoice list of the SO

opw-673446
2016-04-25 14:11:47 +02:00
Raphael Collet f5f7df9df2 [MERGE] orm: implement new model for the prefetching of records
The new model is now the following:
 - each recordset is attached to a prefetch object: records._prefetch
 - the prefetch object associates model names to record ids to prefetch:
   ids = records._prefetch[model_name]
 - a call to model.browse(ids) returns a recordset with a new prefetch object
 - the prefetch object is passed and populated by
    - iteration
    - access of relational field
    - with_env(), sudo(), with_context()
2016-04-25 13:38:27 +02:00
Raphael Collet b684f0b521 [IMP] doc: add some basic description of record prefetching 2016-04-25 13:37:12 +02:00
Raphael Collet 7a8a8097f6 [IMP] fields: change the cache format of relational fields
Relational fields are now cached as tuples of ids instead of recordsets.
2016-04-25 13:37:12 +02:00
Raphael Collet 318fc6f4b1 [FIX] check values passed to update 2016-04-25 13:37:12 +02:00
Raphael Collet 84cf3ceb44 [FIX] base_action_rule, mail, membership, point_of_sale: do not mix cache format with record format 2016-04-25 13:37:11 +02:00
Raphael Collet 1ec7b28a09 [FIX] models, fields, api: do not mix the cache format with the record format 2016-04-25 13:37:11 +02:00
Raphael Collet d035828778 [FIX] models, fields: make read add secondary records for prefetching
Make the following statements add secondary records (values of relational fields)
in the prefetching object of ``self``:

    self.read(fields)
    self.partner_id             # implicitly invokes read()

This makes sure that traversing relational fields on records automatically
feeds the prefetching of secondary records.
2016-04-25 13:37:11 +02:00
Raphael Collet f9b08f09b2 [IMP] models: make with_env, sudo, with_context preserve the prefetch object 2016-04-25 13:37:11 +02:00
Raphael Collet 8bc7d8565c [IMP] models: attach prefetching data to recordsets instead of environments
The prefetching now has a more intuitive and controllable model: every
recordset is linked to a "prefetch object" that tells which record ids to
prefetch for any model.  The prefetch object of a given recordset is shared
with the records obtained by iteration and relational field access.  All other
operations instantiate recordsets with a fresh prefetch object.

    records = model.browse(ids)
    assert records._prefetch is not model._prefetch

    for record in records:
        assert record._prefetch is records._prefetch
        assert record.relation._prefetch is record._prefetch
2016-04-25 13:37:11 +02:00
Raphael Collet 6037f3a56d [REF] fields: change API and semantics of converter methods
The cache data format has been split between a cache format and a record format
(returned by accessing a field on a record).  We have the following converters:

                                   ANY FORMAT
                                       |
                                       | convert_to_cache
                                       v
                                  CACHE FORMAT
                                       |
                                       | convert_to_record
                                       v
                                 RECORD FORMAT
                                       |
                                       | convert_to_read
                                       | convert_to_write
                                       | convert_to_onchange
                                       | convert_to_export
                                       | convert_to_display_name
                                       v
                                 OTHER FORMATS

Modify the API of the converter methods to make them uniform (pass value and
record), and adapt their documentation.
2016-04-25 13:37:11 +02:00
Raphael Collet cb8d432bb2 [IMP] fields: do not validate values when not necessary 2016-04-25 13:37:10 +02:00
Raphael Collet d3cfb47285 [IMP] fields: simple code improvements (add blank lines, remove unused imports) 2016-04-25 13:37:10 +02:00
Christophe Simonis 4d337f72ed [MERGE] forward port of branch 9.0 up to ac7beb3 2016-04-25 13:33:01 +02:00
Christophe Simonis ac7beb3d7b [FIX] test_new_api: adapt test to new x2many commands return by onchange 2016-04-25 13:08:03 +02:00
Christophe Simonis ac16454965 [MERGE] forward port of branch saas-6 up to ba34df1 2016-04-25 12:40:13 +02:00
Denis Ledoux dc1b8a5a51 [FIX] res_company: some information missed on company creation
On the `res.company` model, the fields
`name`, `phone`, `email`, `website`, `vat` are
related field on the `partner_id` of the company.

When creating a new company, the partner
associated to the company is created automatically,
it's handled in the overrided `create` method
of the model, but it forgots the values
`phone`, `email`, `website`, `vat` at the moment
the partner is being created.

opw-675526
2016-04-25 12:37:06 +02:00
Christophe Simonis ba34df1ead [MERGE] forward port of branch 8.0 up to 0410d11 2016-04-25 11:56:52 +02:00
Fahad Alqahtani fedfe85a58 [CLA] corporate signature for cloudland
Closes #11803
2016-04-25 11:40:53 +02:00
Aaron Bohy 3241415a0c [FIX] mail: utils.send_native_notification doesn't exist 2016-04-25 11:31:08 +02:00
Aaron Bohy 83081cd435 [FIX] mail: chat_manager: unnecessary lookup in messages 2016-04-25 11:31:08 +02:00
Aaron Bohy f069815980 [FIX] mail: chatter: dialog's form view not ready
Since rev. 002660a9, form views are instantiated with their fields_view. This
had an impact in FormViewDialog as the inner form view instantiation was made
asynchronous. Unfortunately, an event handler was set on this form view in the
chatter, and it produced a traceback as the form view wasn't instantiated yet.
2016-04-25 11:30:51 +02:00
Aaron Bohy 69cb6088be [FIX] web: form_view: unnecessary jumping Edit button
When opening a record from a list view, the Edit button in the control panel
sometimes bounced. This was because we listened to event 'mouseup', and
astonishingly, the 'mouseup' event of the click in the list view was catched
by the form view.

The reason why we listened to 'mouseup' instead of 'click' is that some
widgets need the event to be propagated to the body. So this fix simply makes
the form view listen to 'click' instead of 'mouseup', but removes the call to
stopPropagation() on the catched event.
2016-04-25 11:29:59 +02:00
Aaron Bohy 47f27b8023 [FIX] web_kanban: column title hidden and config button
Use 'display: none' instead of 'visible: hidden' for the config button in
columns' header so that the columns' title can take full width if that button
is hidden.

Bonus: if the config dropdown is open, the button remains visible.
2016-04-25 11:28:00 +02:00
Adrien Dieudonne 68ba897ce9 [FIX] web_editor: fix svg issue
className should return a string but svg node returns an object
2016-04-25 10:34:18 +02:00
Goffin Simon 6719df5988 [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-04-25 09:50:59 +02:00
Nicolas Martinelli 9c5683dbfd [FIX] purchase: use purchase UoM
When a PO is created from a reordering rule, we should make sure to use
the purchase UoM of the product. Any PO line automatically created or
modified will be a PO line in the purchase UoM.

opw-673309
2016-04-25 08:46:24 +02:00
Nicolas Martinelli e6180e3543 [FIX] purchase: UoM for cancellation
When cancelling a procurement (e.g. from a SO), we need to make sure
that the quantity is in the UoM of the PO line.
2016-04-25 08:46:24 +02:00
Odoo Translation Bot 0410d1187b [I18N] Update translation terms from Transifex 2016-04-24 02:59:16 +02:00
Odoo Translation Bot c8cd67c5d9 [I18N] Update translation terms from Transifex 2016-04-24 00:30:00 +02:00
Nicolas Lempereur b06c3cb1f5 [FIX] account_extra_reports: None unattended
For the partner ledger report, since LEFT JOIN are used in the request
we could get NULL values which broke the following code.

note: issue reported on 7c6c188
2016-04-23 20:55:41 +02:00
qsm-odoo 23e3be006d [FIX] web_kanban: column title overflow when folded
Commit 3b19fa426b fixed a bug where the column title of kanban group
was overflowing its area when too long. However, when the column is
folded, the title is now really small (width of the folded column)
and then stopped to add the "..." ellipsis.

The solution is to let the text overflow when the column is folded.
2016-04-22 17:13:12 +02:00
Nicolas Lempereur 6de2091d4d [IMP] base_import: only feed utf-8 to csv reader
As noted in the csv module documentation*, up to python 2.7 it is best
to used UTF-8 as input (and worst to use UTF-16 csv).

closes #11792
opw-674756

* https://docs.python.org/2/library/csv.html
2016-04-22 16:36:48 +02:00
Raphael Collet 86d276b4bb [FIX] models: fix *2many multi-onchange bug
This fixes the case where the lines of a one2many field are modified several
times by onchange methods: instead of retrieving the most recent updates, we
merge them with former updates.

This solution was written as an improvement of a proposal made by Alexis
Delattre and Sébastien Beau as #11620.
2016-04-22 16:25:11 +02:00
Martin Trigaux fd7a7207ac [FIX] orm: do not save empty translation as 'false'
When writting a value on a translatable field in a different language than
English, the submitted *raw* value was saved in the database.

This could cause the following issues:
- empty value (provided as `False` by the web client) saved as the string
  'false' in the translations table
- no encoding or sanitization convertion
- ignore size parameter on the translatable field

Process the submitted translation through symbol_set method to clean it before
storing it blindly in the database.

This allows to convert `False` into `''` for empty value and fixes #10862
2016-04-22 16:14:19 +02:00
Tanguy Charlier d9f050f852 [FIX] mail: Avoid traceback on notification for some browsers
Before showing a chat notification, a check is performed to ensure that the browser does support
notifications. On browsers that do not support Notification (IE, android native,...), the check was wrong and
would eventually cause a traceback. This will no longer happen.
2016-04-22 15:30:11 +02:00
Adrien Peiffer (ACSONE) 600f884524 [FIX] account: Allow to select sale taxes in bank statement reconciliation process. Courtesy of adrienpeiffer. PR #11673 2016-04-22 15:25:10 +02:00
qdp-odoo bf33c4ea0c [FIX] account: bank statement reconciliation with taxes use case. The journal item for the bank should have the same amount as in the statement line except in case of already recorded payments only. Ticket 673358 2016-04-22 15:03:58 +02:00
Jérome Maes 0fcbff389c [FIX] hr_recruitment, website_hr_recruitment : compatibility method
Duringthe migration, backward v7 compatibility were removed, but
there were still used in inherited modules.

This commit fix this problem by using the new method names.
2016-04-22 14:49:44 +02:00
Jérome Maes d0459de338 [FIX] google_calendar : sync with google button not bound
Commit 002660a9b0 remove 'view_loading' method, but doesn't adapt this code.
2016-04-22 14:49:35 +02:00
Levent Karakas f5b7d2ef4f [IMP] base: remove old Turkish lira
No longer in usage since 2005, replaced by TRY.
Closes #10424
2016-04-22 14:16:59 +02:00
Olivier Dony 7b1c208d5f [MERGE] Forward-port 9.0 up to d29ca90c75 2016-04-22 13:52:14 +02:00
Levent Karakas 7c584d3ebb [FIX] sale: untranslated label
attribute string is translatable on a search filter, not name (which is used as fallback label
Closes #10419
2016-04-22 13:49:12 +02:00
Tanguy Charlier 67c7d45ea8 [FIX] project_timesheet: Missing 'fields' argument in search_read
* It is always better to restrict the read to the fields that are actually needed
* In this particular case, since _get_task is called during the create() of an an analytic line with task_id set,
it would result in reading the analytic line being created, which will overwrite the cache for stored computed fields with wrong empty values.
Restricting the fields to read means that computed fields are not read and keep their appropriate values
2016-04-22 13:44:57 +02:00
Ranjit Pillai 989bccca45 [MIG] crm_project_issue: migrate into new api
Part of the code was refactor by applying `self.ensure_one()`,
and removing the loop 'for'.
2016-04-22 13:31:12 +02:00
Ranjit Pillai ee566f6042 [MOV] crm_project_issue: split files according to models 2016-04-22 13:31:12 +02:00
Ranjit Pillai c804a61ac0 [MOV] crm_project_issue: reoganize module directories 2016-04-22 13:31:12 +02:00
Aaron Bohy d29ca90c75 [FIX] im_livechat,mail: address livechat sessions with their unique ID 2016-04-22 13:20:50 +02:00
Aaron Bohy 5b5100b3da [FIX] web_kanban: many2many tags only displayed the first time
This bug was a consequence of commit 6c57935 which introduced a JS cache of
stuff like actions, fields_view... The fields_view being modified in place by
the kanban_view (which is obviously not a good practice), it was able to
identify its many2many fields only the first time the view was displayed, as
from the second time, it received an already processed version of the
fields_view in which is wasn't able to identify many2many fields. Thus, those
fields were only displayed the first time the view kanban view was displayed.
2016-04-22 12:07:07 +02:00
Géry Debongnie d65d251c57 [IMP] base, web: add type=fullscreen to ir_actions
With this commit, actions can have a type=fullscreen.  This means that
the navbar will be hidden, for the action and for all subsequent actions
open in the breadcrumb

There is no real security behind this, this is just a feature for
convenience, so users can bookmark an url an open some action in a way
that they are not distracted by anything.  In short, this is some kind of
light 'kiosk' mode.
2016-04-22 11:03:21 +02:00