Commit Graph
111542 Commits
Author SHA1 Message Date
Géry Debongnie ae4501da9c [FIX] web: do not lose onchange info in some rare cases
Here is a situation where we had a problem:
- a form view with a one2many field, which has no inline views
- the (non inline) list view has a field A, and is not editable
- the (non inline) sub form view has fields A and B, with an onchange on
  B which modifies A

In that case, the user could do this:
- go to edit mode
- click on 'add' a new one2many line
- change the value of B in the form view, this changes the value of A
- click on save to close the modal form view
- click on the new o2m record to reopen the modal form view
- rechange B
=> the onchange does not work

The explanation is that when we reopen the modal, we update the known fields
information, but we had to perform a fieldviewget to fetch the list
view, so we have a full knowledge of the fields.  However, the code did
not update the fields info (because it uses _.default), which means that
the onchange information contained in the form view is lost.

Note: the test system had to be adapted to more closely simulate what
actually happens.  In particular, the onchange flag is no longer added
by the mock server, since it should be done by the data manager, like
'real' code.  This change broke the basic model tests, which had to be
modified accordingly, by setting manually the onchange flag.
2017-11-09 14:03:35 +01:00
Adrien Dieudonne fe4f63d325 [FIX] web: create in editable grouped list views
Before this commit, an issue occured when you tried to
create a new record in a editable grouped list view.
A new line was created with an undefined group.

Editable grouped list views are not supported.
So now, we have to switch on the form view when
you click on create. This behavior is already implemented
when you open an existing record.
2017-11-09 11:45:04 +01:00
Thibault Delavallée a25358eae3 [REM] hr: remove unimported file
Leftover of 78ac6de52d code about mail gateway was moved to
mail_alias.py but mail_thread.py file was not removed.
2017-11-08 12:55:33 +01:00
Thibault Delavallée 20d8025036 [FIX] mail: followers alias check on models not inheriting from alias mixin
You could try to check followers on a model not inheriting from mail alias
mixin. In that case current code would check followers on a void mail
alias mixin record, meaning no followers found. Instead we now
differentiate the class method from the method checking record properties.
2017-11-08 12:51:13 +01:00
Thibault Delavallée d6a5c126e7 [FIX] mail: correctly return and log error message when checking aliases
Mesage should be message otherwise it is not displayed in the logs.
2017-11-08 12:47:12 +01:00
Géry Debongnie 9e97ad8dce [FIX] web: prevent useless discard dialog from showing up
Here is a scenario that could cause an issue:
- open a form view with a many2one
- click on edit button
- click on small external button for many2one. this opens a modal form
  view
- click on save in the modal (without changing anything)
- click on save in the main record
- exit form view. this opens a discard dialog

There were two issues here:
- saving the modal dialog automatically marks the many2one field as changed.
  This was necessary to force reloading the data, because editing a sub value
  in the modal form view could have changed the display_name of the manyone
  field.  However, this is not necessary when no change was done.
- when saving a record, the _isDirty flag was reset to false only if an
  actual rpc was done.  However, it may happen that the flag is set to
  dirty (for example, when modifying a value inside a many2one), but the
  main record has no changed fields.

In this commit, we also remove the on_save handler in the
formviewdialog.  This is a small refactoring in a stable version, but no code
currently use it, and I believe that it will make the code much easier
to maintain (the previous code was really awkward), so I think that the
tradeoff is acceptable.
2017-11-08 10:50:12 +01:00
Lucas Perais (lpe) 324d4bfb56 [FIX] web: fields set in fieldDependencies should have their "options" set
Bug brought by f45edfb

Before this commit, the debug manager crashed when clicking on "set defaults" on a view fetching a fieldDependency.
This was because the "options" key on the field was not set when the field originated from the fieldDependency of a widget.

After this commit, the data_manager ensures that key is present

OPW 780071

closes #20730
2017-11-08 10:21:32 +01:00
Aaron Bohy 0f638b3c63 [FIX] web: correctly evaluate domains and contexts in dialogs
An error occurred if the domain or context applied on a view
opened in a dialog needed to be evaluated (e.g. if they contained
something like [['some_field', '=', uid]]). For instance, create
a custom filter with such a domain for the Contact model, then go
to Contact, create a new one, and on the parent_id many2one, click
on search more. Before this rev, no eval context was given so the
domains and contexts couldn't be evaluated, and it crashed.
2017-11-07 15:33:23 +01:00
Martin Geubelle 255478acbd [FIX] web: clear m2o input at creation cancel
After entering a value in a many2one, if one clicks somewhere else, a popup
is opened to suggest the user to create (or not) a new record with the entered
value.

Before this rev, closing this popup resulted in an unclear situation where the
input was still set with the entered value but the new record hadn't been created.

This commit fixes this by clearing the input value if the record is not created.

See task#36055
2017-11-07 14:12:18 +01:00
Jeremy Kersten f8bf66b6de [FIX] website_crm_partner_assign: assign opportunity to the commercial_partner_id
Before this commit, an opp created from a contact via the portal was assign to
himself instead of the commercial_partner_id.

So the saleperson was not assigned to the opportunity, and the opp created was
not for the company but for the contact only.

That make sense to share the opp to the company and assign the saleman directly.

Thanks to GBR for the reporting.
2017-11-07 11:38:12 +01:00
Christophe Simonis 5f9c3f51a8 [MERGE] forward port branch saas-15 up to db4886d511 2017-11-07 11:01:14 +01:00
Christophe Simonis db4886d511 [MERGE] forward port branch saas-14 up to 928a284b11 2017-11-07 10:59:45 +01:00
Christophe Simonis 928a284b11 [MERGE] forward port branch 10.0 up to 08ab28a66c 2017-11-06 16:00:15 +01:00
Nicolas Martinelli 08ab28a66c [FIX] sale_expense: fields consistency
Use case to reproduce:
- Set a product to be expensed
- Set the expense_policy to something else than no
- Do a delivery order with a picking
- Validate the picking
-> Delivered quantity to 0 and impossible to create an invoice
if the invoice_policy is delivered_quantity

It happens due to this commit 48ea59d
What does it do:
- The move could be generated by an expense.
- If the move has 'no' as expense policy thus we won't add it in the invoice
Problem we can't guess if the move come from an expense or not (limitation).

This commit add an onchange on can_be_expense is order to set the expense
policy back to 'no' when the user uncheck it.

Courtesy of amoyaux

opw-777139
2017-11-06 13:05:37 +01:00
Christophe Simonis 88c641e6dc [MERGE] forward port branch 10.0 up to 6c1c1f6e9e 2017-11-06 12:42:56 +01:00
Odoo Translation Bot 6c1c1f6e9e [I18N] Update translation terms from Transifex 2017-11-05 01:11:44 +01:00
Christophe Simonis bf102b4cbc [MERGE] forward port branch 9.0 up to 6c996723b2 2017-11-03 14:36:22 +01:00
Lucas Perais (lpe) 4b72944bba [FIX] point_of_sale: fix invoice download and receipt printing
When opening the POS in this specific case:
- Under Mozilla Firefox
- auto printing the receipt is True
- invoicing is True

Before this commit, when issuing an invoice for a customer, a Traceback was thrown to the user and the invoice was not downloaded.
This was because the invoiced parameter resolved before the printing action was.

After this commit, we constain the invoiced parameter to be resolved when the action returns.
There is no traceback, and the invoice is downloaded

OPW 777647

closes #20570
2017-11-03 14:27:24 +01:00
Christophe Simonis 5fa577a14d [MERGE] forward port branch saas-15 up to 8ec60550a7 2017-11-03 13:36:41 +01:00
Nicolas Martinelli 6c996723b2 [FIX] point_of_sale: wrong variable name
`tax_amount` is not defined here, making it impossible to remove an
order line...
2017-11-03 13:16:15 +01:00
Nicolas Martinelli f85c8843c9 [FIX] account, point_of_sale: tax with fixed amount
- Create a tax:
  Fixed amount: 10
  Price included
- Add it by default to a product costing 100
- In a SO/PO/Invoice, add 2 units of the product

The total price is 210 instead of 200.

opw-779696
2017-11-03 12:57:34 +01:00
Denis Ledoux 8360daa057 [FIX] sale_stock: failing sale_stock.tour according to the modules installed
The `sale_stock.tour` failed in the case the admin was not
part of the group
`product.group_stock_packaging`
or the group
`sale.group_mrp_properties`

because then the sale order was working with the editable list,
which does not open a dialog,
while the test was relying on the dialog to be opened,
in order to close it.

The fix is simply to pass the fact to close the dialog if
there is none.

opw-779308
2017-11-03 12:51:09 +01:00
Christophe Simonis 8ec60550a7 [MERGE] forward port branch saas-14 up to d8888bdbae 2017-11-03 12:50:21 +01:00
Christophe Simonis d8888bdbae [MERGE] forward port branch 10.0 up to aaa7566141 2017-11-03 12:10:41 +01:00
Christophe Simonis aaa7566141 [MERGE] forward port branch 9.0 up to 455b5aaff8 2017-11-03 11:42:39 +01:00
Nicolas Martinelli 15310c4d66 [FIX] web_editor: upload without optimization
In Enterprise:
- Go in Settings > Technical > Mail > Templates
- Edit a template
- In the editor, upload an image
- Choose "Upload image without optimization"

You are sent back to the app switcher.

opw-778918
2017-11-03 10:19:47 +01:00
Nicolas Martinelli 95747685f7 [FIX] stock: group by in Packages
Location and Company are non-stored fields. Therefore, grouping by these
fields leads to a traceback.

opw-779564
2017-11-03 10:05:59 +01:00
Miquel Raïch f993ca8ce7 [FIX] point_of_sale: adapt test for multicompany
Only products without company can have taxes of different companies

Closes #20256 
Fixes #20250
2017-11-03 10:02:43 +01:00
Nicolas Martinelli 0e7f3be6b6 [FIX] stock: incorrect decorator 2017-11-03 08:57:27 +01:00
Martin Trigaux be7927d629 [FIX] payment_buckaroo: remove bad link
The link does not work anymore.
Even when it was, it did not provide any information as can be seen in
https://web.archive.org/web/20160608025556/http://www.buckaroo-payments.com:80/business/customers/online-payment/

Fixes #16987
2017-11-02 16:34:11 +01:00
Simon Lejeune 50a6f50df1 [FIX] mrp: production chained to a done or cancelled move
Do not try to run `action_assign` on the next move if it is done or
cancelled. The issue is that `action_assign` will first unlink the
existing pack operations before creating new ones, and the system
forbids to unlink these ones.

To reproduce this issue:
1. Create a product, routes manufacturing and MTO
2. Create SO with that product
3. Go to DO and force assign then cancel the delivery
4. Go to Manufacturing order created and produce

opw 778897
2017-11-02 14:02:18 +01:00
Laurent Smet 455b5aaff8 [FIX] account, point_of_sale: fix rounding issues with taxes computation (#20573)
Suppose a tax of 20% with price_included = True and apply this tax on 399.99:
- base = 399.99 / 1.2 = 333.32500000000005
- tax_amount = base * 0.2 = 66.665
- round(base) + round(tax_amount) = 333.33 + 66.67 = 400.0 (!= 399.99: WRONG)

-opw: 777925
2017-11-02 14:02:04 +01:00
Xavier Morel e134dde867 [FIX] base: make partner.company_type properly writeable
In 7eab8e26d3 res.partner was converted
to the new API, at that point company_type was changed from a stored
field manually synchronised with is_company (through create/write
overrides) into a proper computed field.

However to make it "editable" it was simply marked as
"readonly=False", which means even though UI-wise it looks editable
editing it does not actually do anything (things work in the partners
form because there's also an onchange which updates is_company on the
fly).

Fix by implementing an inverse function and actually do this
correctly.

Fixes #20623
2017-11-02 13:14:59 +01:00
Nicolas Martinelli 75b7f62783 [FIX] maintenance: default supplier
- Go to Maintenance Requests, Create
- Go to 'Equipment' field, 'Create and edit'
- Go to 'Product Information' tab
- Click on 'Vendor' field, 'Create and edit'

'Is a Vendor' field is False

opw-779200
2017-11-02 11:51:24 +01:00
Olivier Dony ec00c27ca3 [FIX] auth_signup: correct leftover from 6d16915d39
The /web/signup controller was also supposed to get the special frame
header, like all sign-in/up pages.
2017-11-01 23:38:56 +01:00
Christophe Simonis 810b6aa760 [MERGE] forward port branch saas-15 up to d1fcca1504 2017-10-31 15:25:01 +01:00
Richard Mathot b9b6deff8e [FIX] l10n_br: wrong & pointless field redefinition
Fields `amount_type` on `account.tax` and `account.tax.template` are
already defined in the `account` module.
Redefining them here (with the same parameters) breaks every other
module that would have used `selection_add=` on those fields.

Actually, it is the case in `account_tax_python`, and thus, all the
localizations/customizations that depend on it were broken by this one.

~ Old API backport of 5d0d80afa5 ~
2017-10-31 13:21:16 +01:00
Stefan Rijnhart 5d0d80afa5 [FIX] l10n_br: wrong & pointless field redefinition
Fields `amount_type` on `account.tax` and `account.tax.template` are
already defined in the `account` module.
Redefining them here (with the same parameters) breaks every other
module that would have used `selection_add=` on those fields.

Actually, it is the case in `account_tax_python`, and thus, all the
localizations/customizations that depend on it were broken by this one.

(issue spotted by 11.0-nightly)

Closes #19812 #20596
2017-10-31 13:13:16 +01:00
Christophe Simonis d1fcca1504 [MERGE] forward port branch saas-14 up to a0157f104f 2017-10-31 12:36:47 +01:00
Christophe Simonis a0157f104f [MERGE] forward port branch 10.0 up to dcce040a63 2017-10-31 12:07:15 +01:00
Christophe Simonis dcce040a63 [MERGE] forward port branch 9.0 up to f41690538d 2017-10-31 11:47:35 +01:00
Raphael Collet 2c61c54ffa [FIX] models: nonsensical special case in CSV export (#20499)
Remove weird special case: when the first field of the first line of a one2many
is empty, replace this first field by the comma-separated names of the lines,
and discard the other lines.
2017-10-30 17:12:45 +01:00
Goffin Simon 6e06c54c8e [FIX] product: Inventory at Date does not show the correct valuation
Fine tuning of this commit: 51d072db44

When clicking on the group of the Inventory at Date, the
product.price.inventory must follow the same order as the
read_group in stock.history.

opw:747857
2017-10-30 17:02:38 +01:00
Géry Debongnie 3c55407f11 [FIX] web: allow dropdown selection in m2o
Before this commit, many2one fields were not (fully) usable in a list view: if
the user wrote some text, then when a dropdown with various choices
opened, pressed the 'down' key (to select a choice), the down keypress
caused a navigation move to the next line, which cancelled the
selection.

In this commit, we make the assumption that if the many2one dropdown is
opened, then navigation moves are not what the user wants.
2017-10-30 16:04:43 +01:00
Nicolas Martinelli bb8f41d2a6 [FIX] account_asset: do not create move
- Create an asset, post one line.
- Go back to the asset => the button is green
- Click again on the line => the button is orange

There is no protection to prevent the user to post the same entry
several times (a new account move is created every time it is clicked).

We fix the JS widget, but we add an extra layer of protection at the
Python level.

opw-778756
2017-10-30 12:21:19 +01:00
Vailiy Korobatov f476d069f4 [FIX] doc: correct view reference
Closes #20556
Closes #20557
2017-10-30 11:56:24 +01:00
Lucas Perais (lpe) ce8b51d867 [FIX] point_of_sale: keep keypress handler on body (barcode usability)
Commit b131e9b0ef changed the way the keypress event was bound from vanilla JS to JQuery

In the pos, since it cleans up every jquery event for performances' sake, this binding was cancelled.

This commit cleans up the cleanup process of event at pos startup and rebind the keypress event to the now clean body.

OPW 778565

[FIX] point_of_sale: barcode bindings other strategy

closes #20535
2017-10-30 11:29:42 +01:00
Lucas Perais (lpe) 8e95ee6843 [FIX] website_sale: website_public_price computation not necessarily depends on a request
Before this commit, when trying to access website_public_price from the backend (when adding this field to a view for example), a traceback saying that the website attribute on the request object was non existent was raised.

After this commit, we control for this and the field displays correctly

OPW 778586

closes #20536
2017-10-30 09:35:22 +01:00
Lucas Perais (lpe) f41690538d [FIX] point_of_sale: date string ECMA 5.1 in Date()
Before this commit, when opening the POS in IE11, then the customer list, the list was empty.
This was due to condition that was wrongly evaluated as false due to the fact that IE11 apparently only wants ECMA5.1 to deal with constructing Date() from a string.

After this commit, we construct the Date() object with the right string, and the list of customers doesn't disappear.

OPW 776463

For reference:
http://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.15

closes #20468
2017-10-30 09:25:29 +01:00
Odoo Translation Bot 76408ecdd7 [I18N] Update translation terms from Transifex 2017-10-29 04:30:55 +01:00