Commit Graph
109140 Commits
Author SHA1 Message Date
Aaron Bohy 2eda2a7296 [FIX] hr_attendance: crash when opening the app
'session' is no longer an widget attribute, 'getSession()' should
be used instead.

Also remove a dead JS field widget (not used since
odoo/odoo@158f779b46)
2017-04-14 22:35:27 +02:00
David Arnold b9c76ddab5 [IMP] account_asset: extensibility
Before this commit, it was not easily possible to add the seamless closing
workflow while having 2 or more depreciation boards (eg. according to accounting
standard). With this commit, I can construct the move lines independently
inherit properly and pass all created move lines to the window action.

Closes #16073
2017-04-14 16:16:52 +02:00
Guewen Baconnier 2cf21519b9 [IMP] sale_timesheet: extract preparation of values for task creation
It allows to customize the values of the task created from a
procurement.

Closes #16387
2017-04-14 16:02:44 +02:00
Adrien Dieudonne 148f7b4597 [FIX] web: Form: *_view_ref in context not passed
For one2many and many2many fields, you have several ways for specifying
a view other than the default one:
- to write the arch of the view in the field tag
Example:
<field name="many2many">
    <tree>
        ...
    </tree>
</field>

- to write xmlid of the view in a specific key (*_view_ref)
in the context of the field.
Example:
<field name="many2many" context="{'tree_view_ref':'module.tree_view_ref'}">

Before this fix, the second case didn't work.
the default view was loaded instead of the one passed in the context.

In fact, this context is evaluated after the loading of the record but
we need some static keys to load the view (before fetching the record).
2017-04-14 14:49:09 +02:00
Christophe Simonis e92ae40d71 [MERGE] forward port branch saas-15 up to b0992d082d 2017-04-14 13:32:15 +02:00
Pierre Masereel ff2ce7524b [FIX] web: archive kanban column
When we try to archive a kanban column we get a traceback when the field
'active' exists on the model but not in the view.

This traceback is caused by an unecessary check of the active value of
the record.

To fix it, we apply the 'active' value on all records, and not only on
the ones where active value changed.
2017-04-14 10:50:35 +02:00
Christophe Matthieu 2f67881d45 [FIX] calendar: Various fixes
Traceback when:
* click on first row of calendar
* move an event somewhere else with drag and drop
* click on the mini calendar
* filter from the control panel triggers a traceback
* add an attendee: traceback
* day/week/month: traceback
* cannot add a leave, the fromViewDialog does not open
* one day oo server-side when select all day
2017-04-13 16:55:11 +02:00
Christophe Matthieu c32724eae0 [FIX] web: calendar timezone with user configuration
The client must receive the tzOffset to apply this on all hours.
To use the date picker we must change the date to apply the change
in the user's tzOffset, without this change the result is wrong.
For datetime widget we must change like it to avoid max stack error.

The server send the tzOffset, if it's undefined, by default the client
use the browser time offset.

Every test are change to use tzOffset.

A test is added in calendar to use the click by position for the
fullcalendar lib. This test create and drag and drop an event to check
timezone error and error when we use default value in the context.

Use formating date like 2026-04-04T08:00:00Z instead of 2026-04-04 08:00:00
is important for phantomjs, because it's crash without information if the
formating is not the standard format.

For the parsing, when the client receive a server date the date is utc
formating but when it's parsed from the client is in the user's timezone
2017-04-13 16:55:00 +02:00
Aaron Bohy 9c43ad85d4 [FIX] web: Form: apply style attribute on rendered nodes 2017-04-13 16:16:18 +02:00
Christophe Simonis b0992d082d [MERGE] forward port branch saas-14 up to 8f30e707e5 2017-04-13 15:31:27 +02:00
Christophe Simonis 8f30e707e5 [FIX] website_sale_options: correct template definition
Oversight of penultimate forward-port.
2017-04-13 14:34:20 +02:00
Aaron Bohy ec988d4121 [FIX] web(_editor): field widget html
The field widget html wasn't implemented yet in the new views. A
very basic implementation was done in addon web. It only handled
the readonly mode so that the field were displayed in studio.

This commit removes this basic implementation from web, and re-
introduced the old one, converted, in addon web_editor.
2017-04-13 14:31:24 +02:00
Aaron Bohy 6b936ba203 [FIX] web: correctly save many2manys inside one2manys
In a form view, if a one2many list view contained a many2many
field (e.g. widget many2many_tags), the commands for the embedded
many2many weren't generated for newly created one2many subrecords,
so this field couldn't be saved.
2017-04-13 14:31:24 +02:00
Aaron Bohy fce45c3361 [FIX] web: field_utils: correctly format many2manys 2017-04-13 14:31:24 +02:00
Aaron Bohy 15f26cc263 [FIX] web: Many2ManyTags: keep focus after being edited
When a tag is either added or removed, the focus should remain
on the input.
2017-04-13 14:31:24 +02:00
Christophe Simonis 282b036db3 [MERGE] forward port branch 10.0 up to d59555abb5 2017-04-13 13:47:13 +02:00
Christophe Simonis b6c4b0c645 [FIX] base: add missing import
Oversight of previous forward-port
2017-04-13 13:45:40 +02:00
Christophe Simonis 13ad16104a [MERGE] forward port branch 10.0 up to 00e169c05a 2017-04-13 13:22:27 +02:00
Goffin Simon d59555abb5 [FIX] website_sale: _website_product_id_change
When setting a pricelist for a product P with a fixed price,
the fixed price was not displayed in the cart.

opw:728312
2017-04-13 13:16:36 +02:00
Nicolas Martinelli 471115b06a [FIX] mrp: lose traceability
- Create 3 products (A, B & C) with tracking set to 'serial'
- Create a BOM: A consumes 1 unit of B and C
- Create a MO for A, create the lot A1 for the finished product
- Create another MO for A, use the existing lot A1 for the finished
  product
- Try to mark the MO as done => you get an error
- In the finished products tab, change manually the lot, for example by
  creating A2
- Mark the MO as done
- Open the Upstream Traceability => under the MO, there is nothing, the
  traceability is lost.

The `check_finished_move_lots` method takes care of setting the
`lot_produced_id` on the `move_raw_ids`. However, when changing manually
the finished product lot, this modification is not propagated.
Therefore, when posting the inventory (`post_inventory`), the line:
```
move_raw.move_lot_ids.filtered(lambda x: x.lot_produced_id.id == lot)...
```
doesn't return any lot. Consequently, `consumed_quant_ids` is empty, and
the traceability is lost.

opw-724944
2017-04-13 12:30:42 +02:00
Raphael Collet 00e169c05a [FIX] modules: do not log warnings for studio_customization 2017-04-13 12:17:05 +02:00
Martin Geubelle 87ac617eb1 [FIX] web: Kanban: edit the kanban color
The method has not been correctly ported to the new view (in the new
model in this case).

The change (on the color) needs to be notified to the model before
updating the record.
2017-04-13 11:14:40 +02:00
Nicolas Lempereur df60828488 [FIX] mail: dl inline image with original filename
In 599bd509 for inline image in a mail the `Content-Id` of the
attachment was used as the file name to avoir an issue of several inline
images with the same name only displaying the first one.

This solved the issue but with it the file name when downloading the
image were lost as well as the extension which can be an issue.

This changeset refactor the code so the behavior stay the same but the
original file names are kept.

opw-725305
2017-04-13 09:46:04 +02:00
Christophe Simonis 9e159ef204 [MERGE] forward port branch saas-11 up to f830c7c3e3 2017-04-12 18:51:16 +02:00
Christophe Simonis f830c7c3e3 [MERGE] forward port branch 9.0 up to 975086c039 2017-04-12 17:40:30 +02:00
Martin Geubelle 35c7cfa99e [FIX] web: use correct type integer
In tests, some fields were defined with the type `int` which
does not exist. The correct type is `integer`.
2017-04-12 17:22:20 +02:00
Raphael Collet 975086c039 [FIX] fields: avoid invalidation of fields computed on new records
Issue: when a field is computed on a new record, the record is not marked as
"being computed", and it could therefore be invalidated.  The fix consists in
using the standard method that marks records before calling the compute method.
2017-04-12 17:15:03 +02:00
qdp-odoo 3eb252ab0e [IMP] account, payment form view: add a button to open payment matching
button will only be visible if the move_line are not reconciled yet
This button will allow user to register a payment and then reconcile it with multiple invoices in the payment matching view.

Was PR #15157
2017-04-12 16:22:40 +02:00
Josse Colpaert d5908083b4 [IMP] point_of_sale: indicate on pos picking type the use of lots
By unticking the "Use Existing Lots" checkbox on the pos picking type,
you can choose not to enter any lots/serial numbers in the pos.  This
way, the picking will not specify the lots either and the system will
take the quants and lots according to the removal strategy.
2017-04-12 15:40:40 +02:00
Josse Colpaert 283f8df95b [FIX] point_of_sale: don't generate move lines with a qty of 0 2017-04-12 15:40:40 +02:00
Josse Colpaert 99deebe015 [FIX] point_of_sale: validate picking when all lots are correct
Before, when the POS order created the picking, it would not be set to
done when one of the lines contained a product that required lots.

This was to avoid the case where the lot given in text in the POS
order would not correspond with a real lot in the database.

So, in order to not annoy the user when he gives correct lots, we
validate the picking when we can find back the given lots in the
system.

opw-698060
2017-04-12 15:40:40 +02:00
Joren Van Onder 025d9432a1 [IMP] point_of_sale: handle products tracked as lots
The POS support for tracked products implemented at
8f39c652c6 was mainly meant for products
tracked with serial numbers. In theory it would also work for lots as
long as the lots were only sold in integer quantities. One could specify
the same lot multiple times.

For products tracked in non-integer quantities this wouldn't work
however. This commit makes the POS handle lots more like the stock
module. When a product tracked in lots is bought in the POS you can only
specify one lot number. If a product is sold from multiple lots then
multiple order lines have to be specified.

Fixes #15325
2017-04-12 15:40:40 +02:00
Xavier Morel 76852a2fad [#8530] fix uses of `reduce` builtin
Demoted to library in Python 3, see if uses can be replaced by more
specific construct, just import functools.reduce otherwise.

Futurize fixers:
* lib2to3.fixes.fix_reduce
2017-04-12 13:48:42 +02:00
Aaron Bohy 4950863e43 [FIX] web_tour: correctly redirect to tour url
This commit prevents from erasing the origin part of the url
when the tour manager does a redirection. This was an issue in
phantomjs if it allows local url as in this case, it will try to
load file://<tour_url> instead of <origin><tour_url>.
2017-04-12 13:44:02 +02:00
Christophe Simonis add62255be [MERGE] forward port branch 9.0 up to f10ef71f06 2017-04-12 13:06:41 +02:00
Christophe Simonis f10ef71f06 [MERGE] forward port branch saas-6 up to 87b21d19eb 2017-04-12 12:58:19 +02:00
Christophe Simonis 87b21d19eb [MERGE] forward port branch 8.0 up to ded636eae1 2017-04-12 12:56:09 +02:00
Martin Geubelle 15e17e7b48 [FIX] web: switch in edit mode when creating a record
When creating a new record (form view without `currentId`), the form
view should be rendered in edit mode and not readonly.
2017-04-12 12:25:03 +02:00
Martin Geubelle 16dc001e42 [FIX] web: Form: only render button StatButton
One could want to render something else than a `button` in the
buttonbox (even if the name seems to imply that it will contain
buttons).

In this case, we render the method corresponding to the tag instead
of a button.
2017-04-12 12:23:31 +02:00
Raphael Collet ff8329f4dd [FIX] ir_model: in _prepare_update, make error messages useful 2017-04-12 11:26:33 +02:00
Raphael Collet c988402370 [FIX] ir_model: in _prepare_update, check custom fields only
This allows to remove a custom model without checking all views.
2017-04-12 11:26:16 +02:00
Jonathan Nemry (ACSONE) b7803ce570 [IMP] website: allow inheritance on EditMenuDialog
Closes #16367
opw-728387
2017-04-12 11:13:02 +02:00
Nicolas Martinelli 65cd9269b4 [FIX] sale: invoice status
- Create a product invoiced at delivery (A)
- Create a SO with Product A, confirm => the invoicing status is
  "Nothing to invoice"
- Create a down payment => the invoicing status is "To Invoice"

Since the down payment is added as a product, its invoicing status
influences the global invoicing status of the SO, while it shouldn't.

opw-727936
2017-04-12 11:08:40 +02:00
Aaron Bohy 3638cade09 [MERGE] web,*: redesign all JS views
This branch introduces a full redesign of all JS views.  We started
basically from scratch.  The goal was to unify all the various views
under a common framework, to make them testable, to make then usable
in different conditions (in studio, or in the frontend), and to make
our lives easier.

Some important points are:
- we have a brand new testing framework (still QUnit based)
- kanban view (formerly in web_kanban) moved to the web addon
- calendar view (formerly in web_calendar) moved to web as well
- tree view was removed
- each view is now separated into 3 parts: the renderer, the model,
  the controller (so, actually a kind of MVC)
- we introduced new coding guidelines (camelCase, 80 chars width, ...)
- all new code should be documented

We hope that this code is the start of a new era for the Odoo web
client, we want to have a high quality codebase, well documented, well
tested, well designed.

Work done by the framework team: mostly aab, ged, chm, dmo, qsm, mge,
fwi, adr
2017-04-12 10:44:06 +02:00
Goffin Simon c5f2200a76 [FIX] website_sale: _cart_update
The price of the product was not updated according to the pricelist
when changing the qty of a product in the cart because the context
of the product was not correctly set before calling function
_get_display_price in _cart_update.

But this part of code seems to be redundant with _website_product_id_change.

opw:728312
2017-04-12 10:20:41 +02:00
Nicolas Martinelli eb9b888c5a [FIX] point_of_sale: empty picking
- Create 2 stockable products (A & B).
- Sell these products in the POS, but leave the qty of Product A to
  zero.
- Validate and pay
- In the backend, return the products and register payment

Two pickings are created, and one of them is empty.

Products with a quantity of zero are not included in a picking.
Therefore, we should ignore them when the pickings are created.

Fixes #16292
opw-728101
2017-04-12 09:33:01 +02:00
Goffin Simon cfb06c83e0 [FIX] base: preview_rml_report
Typo error

opw:728334
2017-04-12 09:19:25 +02:00
Raphael Collet 4f98311623 [FIX] fields: recompute recursive stored fields
This is a backport of rev 3481f0faff.
2017-04-12 09:18:23 +02:00
Aaron Bohy e2e0353ce5 [FIX] web: AceEditor Field should be debounced
Debounced fields do not notify their environment each time their
value changes, but rather wait for a given delay after the last
change. Input fields allowing the user to type text should be
debounced. The AceEditor is one of them.

Note: this should be tested, but i can't find a way to simulate
text entries in the ace editor.
2017-04-11 19:44:38 +02:00
Aaron Bohy 942d5fc4a3 [REF] web: Fields: DEBOUNCE is a DebouncedField attribute 2017-04-11 19:44:38 +02:00