Commit Graph
111163 Commits
Author SHA1 Message Date
David Monjoie a3828dfed3 [FIX] web: fix o_row mechanism with phone field
The o_row class mechanism is supposed to be used to put another
element next to a field, like a button for example. However,
in the case of phone and email field, the o_text_overflow hack
gets in the way.

The problem that o_text_overflow is trying to solve is when you
have a long email, the table used to display the form view fields
tends to use very long cells (td) so it can display the whole email
address. This behavior completely breaks the form view, even though
the email address is clearly set to wrap in css. The o_text_overflow
class is a hack that forces the table to think that the email is
small, then defaulting to the width 50% css rules. If the email is
too long, it is correctly wrapped inside the cell, without breaking
the form view layout.

However, when we need to add a button next to those fields, this
hack gets in the way of the o_row class css rules, completely
wrecking it. We looked for a fix with qsm-odoo for hours but were
unable to find one that did not require a complete rewrite of the
form view css rules. In the end, we decided to remove the hack from
the phone field and keep it on the email field, as we think it is
less common to have a very long phone number than to have a very
long email.
2017-09-26 16:21:51 +02:00
Axay Javiya ede29e6d31 [FIX] l10n_be_hr_payroll_fleet: fallback for no language
If the context is lang=None, it crashed as called babel with a None locale.

Closes #18403
opw-756026
2017-09-26 16:16:50 +02:00
Aaron Bohy 28a2ba00ac [FIX] web: Calendar: update breadcrumbs and buttons
In calendar views, the breadcrumbs should display the period
displayed in the view (e.g. in month mode, something like 'April
2017'). Moreover, the 'Day', 'Week' and 'Month' buttons should be
highlighted when the corresponding mode is used.

This rev. ensures that this is the case.
2017-09-26 14:01:49 +02:00
Axay Javiya 484d33d931 [FIX] point_of_sale: fix traceback on 'Analytic Rules' stat button 2017-09-26 11:17:23 +02:00
Denis Ledoux 633b5495b7 [ADD] event, event_sale: registration summary methods.
Method which return summary information about the registration,
which can be used by email or QWeb templates to fetch useful
information about the registration.
2017-09-22 22:25:56 +02:00
Christophe Simonis 88395bdb8e [MERGE] forward port branch saas-15 up to 3ad3b34df6 2017-09-21 16:00:27 +02:00
Christophe Simonis 3ad3b34df6 [MERGE] forward port branch saas-14 up to 537d1ec0d2 2017-09-21 15:08:34 +02:00
qsm-odoo b51b0d66c2 [FIX] web: open domain selector's datepicker at the right position
Before this commit, and since the combination of new views + datepicker
library update, the datepicker opened at the top left of the window
when using it in a domain selector. It also could not be used at all.

This was because the current scenario occured:
1) Click on the datepicker
2) The datepicker triggers that it has changed on opening
3) The whole domain selector is rerendered
4) The datepicker computes where it should open... on basis of the
   old destroyed domain selector

As the main cause of the problem here was the (2), this commit changes
the datepicker odoo widget to only notifies that it has changed when it
has really changed.
2017-09-21 14:51:12 +02:00
Christophe Simonis 537d1ec0d2 [MERGE] forward port branch 10.0 up to e245135421 2017-09-21 14:01:41 +02:00
Christophe Simonis e245135421 [MERGE] forward port branch 9.0 up to d53a201987 2017-09-21 13:55:52 +02:00
Christophe Simonis d53a201987 [MERGE] forward port branch saas-6 up to 43a47dbc93 2017-09-21 13:51:19 +02:00
Christophe Simonis 43a47dbc93 [MERGE] forward port branch 8.0 up to 35441cfd62 2017-09-21 13:25:42 +02:00
Haresh Shyara 5b216c03c1 [FIX] account: wrong default journal on vendor credit note 2017-09-21 12:01:51 +02:00
Aaron Bohy c3a32fc98c [FIX] web: keep settings form view in edit mode
when coming back using the breadcrumbs.

The settings form view should always be displayed in 'edit' mode.
Before this rev., it was re-rendered in 'readonly' when the user
clicked on a link in a setting view (opening another view stacked
in the breadcrumbs), and then came back to the settings view using
the breadcrumbs. For instance, go to 'General Settings', click on
'Activity Types', come back.
2017-09-21 08:12:15 +02:00
Aaron Bohy 130c47bc0a [FIX] web: several minor issues with editable list
- correctly update the pager when a record is added or removed
- destroy the widgets of the removed row when the user clicks on
  'Cancel' when creating a new record
- ensure that the list always contains 4 rows (before this rev.,
  in list views with less than 4 records,   if the user created a
  new record, then clicked on 'Discard', there were only 3 rows
  left
- properly destroy field widgets when removed from the DOM

Note that the change of parent.parentID to parent.static is not a
bug fix, but it's better to use the key that indicates the type of
list element, instead of implying it from other attributes.
2017-09-20 17:07:04 +02:00
Goffin Simon 776e77b67c [FIX] account, point_of_sale, purchase, sale, website_sale: correctly set included tax in multi-company
A product can have multiple included taxes (i.e. one by company).
When computing the product price with function _fix_tax_included_price,
only the taxes of the company should be considered. Otherwise it could remove
all the included taxes of all companies.

ps: When no company is set on the SO, all the taxes visible from the company of the user
are set for the product of the line. Same behavior as in _compute_tax_id.

Closes #19566

opw:770464
2017-09-20 15:53:14 +02:00
Nicolas Lempereur a0fddebe64 [FIX] base: prevent bin_size/binary visual defect
Changing the address type of a contact in the "Contact & Addresses" tab
could in some instance lead to a dead image (just visually, saving it
would not change it) because the image is set to something like
"data:image/png;base64,5.23 Kb" because of a combination of kanba/form
x2many view, onchange, the differences of field present.

In 9.0 this did not happen because the image was not a field in the form
view corresponding to a contact of the kanban contacts view.

In saa-15 thanks to bf26445 the image_small is different than image in
the kanban view and this got us out of the issue.

In saas-16 it is solved even further because new views only load missing
fields.

This commit just get out of the issue by preventing an update of the
records field (with bin_size which caused the issue of the image) when
opening the modal form view of a contact's contact.

Ideally we should solve this more deeply but this is dangerous code to
change (eg. removing the bin_size would solve it but this was done for a
reason and could affect performances) and the effect is just visual in a
very particular set of factors (if we save the form after the image is
dead, the previous image reappeared).

opw-765952
closes #19491
2017-09-20 13:36:51 +02:00
Géry Debongnie a5ca63c83b [FIX] sale: add force_save to make sure SO is correct
Before the new views (SAAS15 and before), the 'readonly' modifier was
kind of weird: a field which was in a readonly state was not saved (the
field was not present in the RPC), UNLESS it is a subfield (for a
x2many).

With the new views, we changed the semantics, to make it more consistent:
fields in readonly state are never sent to the server. This is a much simpler
semantic, but it may introduce some problems, when we actually want to
save the record.  This is solved with a new attribute 'force_save',
where we explicitely have to declare which fields should be save, even
if they are in readonly mode.

In this commit, we simply add the missing force_save attribute to the
order line form view.  This allow the user to create a new SO, add an
order line with some invoice line, and save the result (without this,
the server complains about a missing product_id field)
2017-09-20 12:19:40 +02:00
Nicolas Martinelli dfe96ff38e [FIX] stock: UoM on return lot
- Create a product with:
  Product UoM: kg
  Purchase UoM: lb(s)
  Tracking: By lot(s)
- Purchase 100 lb(s), validate and receive picking (set lot 001)
- Return the picking
- Set the lot

The quantity to do is 45.36 instead of 100.

We make sure to convert the quant UoM (=Product UoM) into the
appropriate UoM.

opw-771930
2017-09-20 10:15:23 +02:00
Deep Patel 9f8efb9d16 [FIX] web: editable list: don't sort rows in edition
This commit disables the sort feature when a row is being edited,
like it was in saas-15, because it didn't work correctly anyway.
2017-09-20 08:20:01 +02:00
Nicolas Lempereur 6252c21000 [FIX] web: modifiers computed when x2many ready
Modifiers (eg. required, readonly, ... on a field) are computed after a
record has been changed. When loading a record they could be computed
based on x2many in a inconsistent state.

eg. on res.partner form, by defaut the email is required depending on:
        [('user_ids','!=', [])]
    but when switching from one record to another this was computed
    wrongly based on the difference between the two records.

This change make the x2many when loading a record ready to be used as
soon as it is set to solve this issue.

forward-port: not needed after saas-15 thanks to framework views rewrite

fix #18239
opw-749483
closes #18815
2017-09-19 17:49:43 +02:00
Laurent Mignon (ACSONE) e34f6aaa26 [FIX] stock: procurements must be confirmed with the right company
The method _procure_orderpoint_confirm in stock/procurement is calld in sudo() by run_scheduler.
Even if this method receives the company as parameter, the company is not enforced for all
the processes trigerred into the method. i.e. If a PO is generated by the run of the procurements
the sequence used is the one of the admin's company and not the one for the given company.
To enforce the company to use, we force the company into the context if it's not the same as
the user's company.

opw:771851
2017-09-19 17:25:27 +02:00
Jairo Llopis 35441cfd62 [IMP] doc: add test classes documentation
Closes #13902
2017-09-19 17:00:59 +02:00
Fabien Meghazi f234376034 [FIX] bus: compatibility with Odoo's PAAS external long polling handler
Add a `peek` option in the bus event dispatcher polling in order to let
an external event dispatcher fetch the notifications and their
corresponding channels.

Cherry-pick of rev. f2f99dc091
2017-09-19 16:57:00 +02:00
Fabien Meghazi 4e9b5e8f23 [FIX] bus: compatibility with Odoo's PAAS external long polling handler
Only start the bus events dispatcher when needed (lazy starting).
On Odoo PAAS it's never started because the platform has its own event
dispatcher.

Cherry-pick of rev. a2ed3d3d5b
2017-09-19 16:57:00 +02:00
Cedric Snauwaert 73bec3d60f [FIX] account: reconciliation, error when changing partner
Traceback by pressing enter when changing partner which should not occur as keyUp event is
in place for other M2O fields and not for the partner.

In some case, if the line is balanced (marked as reconciled) and we change the user for one that does
not have any move lines, we removed the selected proposition but we did not changed the line balance, resulting
in a widget that is marked as inactive and no way to do something with it.
2017-09-19 16:25:28 +02:00
Deep Patel 90a253bb72 [FIX] web: Form view: make 'Edit' button bounce in readonly
... when the form is clicked.

This commit restores the behavior of saas-15, before the new views.
2017-09-19 15:04:56 +02:00
qsm-odoo a79d83e436 [FIX] mrp, stock: picking type automatic colors
/!\ Should not be forward-ported in saas-18

Fix bug introduced by https://github.com/odoo/odoo/commit/e59c1b49c2d9729e5f7576e1c205701a340f9396:
When creating picking types, a color is automatically assigned. This
color is chosen to be the first available one, or by default 1 (since
mentioned commit, as '1' would be the default gray used in kanban
headers). Unfortunately, this was expressed as `color = first or 1`...
which will always be 1 since the very first available color is always 0.
2017-09-19 12:30:15 +02:00
Nicolas Martinelli 3678cffcf9 [FIX] account: due date
On an invoice:
- Select a partner with payment term defined => due date D1 is set
- Change to a partner withour payment term defined

The due date D1 is kept.

opw-772063
2017-09-19 10:17:38 +02:00
Hardik Patel c3a48da767 [FIX] web: FormView button box: position of More dropdown
Before this rev., the dropdown was positioned in the bottom left
corner of the form view.
2017-09-19 10:14:24 +02:00
Pratima Gupta de48daf53a [FIX] web: FieldDomain: don't open record from selection
The FieldDomain allows to open a list in a dialog to display the
records matching the current domain. In this dialog, clicking on
a record should do nothing (this was the behavior before the new
views).

Before this rev., it actually tried to open the record and it
produced a crash.
2017-09-19 10:14:24 +02:00
Hardik Patel 116aa22685 [FIX] web: reset offset to 0 when searching for records
Scenario: Go to any list or kanban view: go to next page and set a
filter that matches less that 'limit' record (e.g. less than 40),
but at least one. No record will be displayed, because the offset
is kept for the search_read.

This rev. ensures to reset the offset to 0 when a search is done
using the searchview.
2017-09-19 10:14:24 +02:00
Darshan Kalola 8ba10a3b9a [FIX] web: FormView: invisible='True' on x2many fields
Before this rev., it crashed if an x2many field had the
attr invisible set to 'True' in a form view.
2017-09-19 10:14:24 +02:00
Goffin Simon 875dd9221f [FIX] account, website_portal_sale: _generate_and_pay_invoice in other currency
When paying in other currency that the one defined  in the company, it
generates a payment which has to be in the currency of the transaction.
Otherwise it will generate an invoice which won't be completely paid.

opw:769278
2017-09-19 00:04:24 +02:00
Christophe Simonis a8d20e6804 [FIX] point_of_sale: correctly format date 2017-09-18 23:06:58 +02:00
Christophe Simonis b3d1a7f7cf [FIX] point_of_sale: format date correctly
Oversight of previous forward-port
2017-09-18 19:00:54 +02:00
Christophe Simonis 14145fe285 [MERGE] forward port branch saas-15 up to 50a440237a 2017-09-18 18:06:21 +02:00
Christophe Simonis 50a440237a [MERGE] forward port branch saas-14 up to b407d84401 2017-09-18 17:39:16 +02:00
Christophe Simonis b407d84401 [MERGE] forward port branch 10.0 up to 58c5b1cfd8 2017-09-18 16:27:42 +02:00
Géry Debongnie cebbee8929 [FIX] mail: prevent pos tour from sometimes failing
Here is what could (sometimes) happen in community:
- the point of sale tour is started by the runbot
- it loads the '/web' url
- this instantiate the mail client action (init)
- the tour sees that the POS link is in the dom and clicks on it
- the action manager destroys the discuss client action (before its
  start method is called)
- the destroy method from the client action is called, this.$buttons
  is not set, the destroy method causes a traceback
2017-09-18 15:39:06 +02:00
Géry Debongnie 8f02b16c27 [FIX] web: tests: mockserver should crash instead of log
When the mockserver handles an unimplemented route, it just log an
error.  This is annoying because it does not break the QUnit suite, so
if the developer does not look at the console, it will look like the
test suite pass.  However, the runbot will see that as an error.

With this commit, we throw an error to force the test suite to fail in
that case.
2017-09-18 13:48:51 +02:00
Géry Debongnie b3aa323919 [FIX] web: prevent crash sometimes when sorting one2many
Before this commit, there was a crash when sorting a one2many in a form view.
This is due to the fact that the event from the one2many bubbled up to
the main form view, which basically assumed that it was supposed to sort
some sub one2many.

It could be seen for example when editing a 'attribute' in a product
form view (need to activate variants), then sorting the 'attribute
values' sub one2many.

With this commit, we simply stop the event propagation at the correct
level.
2017-09-18 13:48:50 +02:00
Nicolas Martinelli 58c5b1cfd8 [FIX] payment: onchange partner
- Go in Accounting > Sales > Payment
- Fill the mandatory info, and create a "Payment Transaction"
- On the form view, change the Partner
- The Customer Details are empty, and saving is not possible since the
  country (mandatory) is not filled in

Closes #15708
opw-771753
2017-09-18 10:51:51 +02:00
Nicolas Martinelli 6b511f38c0 [FIX] point_of_sale: format date on receipt
The date printed on the receipt is not printed according to the language
settings.

opw-769862
2017-09-18 10:03:27 +02:00
Cedric Snauwaert 52c57b4f11 [FIX] account: reconciliation, stupid mistake when trying to open reconciliation for accounts
should take context.account_ids and not model.account_ids as model is not an object
2017-09-18 09:52:36 +02:00
Odoo Translation Bot f087bb021e [I18N] Update translation terms from Transifex 2017-09-17 07:07:45 +02:00
Odoo Translation Bot c2f2bea6c5 [I18N] Update translation terms from Transifex 2017-09-17 04:40:19 +02:00
Odoo Translation Bot c14eb9ae9e [I18N] Update translation terms from Transifex 2017-09-17 00:29:20 +02:00
Christophe Simonis 80f916e8e0 [MERGE] forward port branch saas-15 up to 27cd03e032 2017-09-15 16:45:53 +02:00
Martin Geubelle cb540c48eb [FIX] web: correctly display the enterprise label
The `upgrade_boolean` widget should display an `Enterprise` label next to it.

There is however an issue when a `label` is specified for this field. In this case,
the `Enterprise` label should be placed next to the field label (and not the field
itself).

The easiest solution would have been to instantiate the field widget with its label,
but this can't work because the field widget is instantiated before its label.

We thus re-render the widget after its label creation.
2017-09-15 16:36:40 +02:00