Commit Graph
124195 Commits
Author SHA1 Message Date
Nans Lefebvre 01cd87794d [FIX] web: remove the report_layout from studio selectable widgets
Open studio to modify the widget displaying a relational field.
The report_layout widget can be selected, say, to display payment terms.
Obviously it doesn't make sense.

We remove its supported field, as the field is not generic
(indeed there is only one use for it in the codebase).

opw 1919369

closes odoo/odoo#30303
2019-01-17 10:19:23 +00:00
Lucas Perais (lpe) 15cd94b746 [FIX] base: merge contacts linked to by an o2m field with caps
Define a field on a model as:
- o2m to res.partner
- the field's column, hence its name, has capital letters in it
(studio does that)

create two objects of that class, each one linked to a different partner with the new o2m

merge the partners

Before this commit, the object linked to the second partner, was deleted
This was because merge partner sql requests did not quote the column name

After this commit, the second object still exists

OPW 1925060

closes odoo/odoo#30300
2019-01-17 12:30:20 +00:00
qsm-odoo 606bae9e92 [FIX] web_tour: ensure Tip template is loaded
The 500 page has `session.is_frontend === undefined` as it has its own
whole HTML template.
In that case, the ajax.loadXML is not done, making the tour crash when
visiting a 500 error page.

This is needed for #29957 that has a test tour on 500 error page.

closes odoo/odoo#30240
2019-01-17 11:53:09 +00:00
Lucas Perais (lpe) ba39efdfc6 [FIX] base: merge contacts linked to by an o2m field with caps
Define a field on a model as:
- o2m to res.partner
- the field's column, hence its name, has capital letters in it
(studio does that)

create two objects of that class, each one linked to a different partner with the new o2m

merge the partners

Before this commit, the object linked to the second partner, was deleted
This was because merge partner sql requests did not quote the column name

After this commit, the second object still exists

This commit is tested in v12.0 with PR #30300 only. In v10.0 it is not testable as
the model concerned is in CRM, and that no new fields in business modules can be added in stable

OPW 1925060

closes odoo/odoo#30301
2019-01-17 09:59:23 +00:00
Christophe Matthieu 586dc9e025 [FIX] web: can reopen ModelField selector widget
Before this fix, in studio when the user select the field then focus out
then focus in and selected a child field, an exception is triggered because
the last page is visible but the data are removed.

backport of 12.0's 9eef25ae0a

opw-1928453
closes #30277
2019-01-16 16:18:59 +00:00
Christophe Simonis 83cc046e9a [MERGE] forward port branch 11.0 up to 4c93e4be0d 2019-01-16 14:26:14 +01:00
Christophe Simonis ff2efcd1a9 [FIX] base: force label of ir.actions.server field crud_model_name
Avoid warning due to duplicated field labels.
2019-01-16 14:06:37 +01:00
Nicolas Martinelli 4c93e4be0d [FIX] event_sale: ticket
- Create a SO with an ticket for an event, confirm
- On the attendees wizard, click on 'Apply'

The event ticket is remove from the registration.

This is because the event ticket wasn't saved when creating the
registration line.

Complement of commits 7492c97bf4 and 0717bb6c0d

opw-1920464

closes odoo/odoo#30262
2019-01-16 10:47:40 +00:00
Jorge Pinna Puissant 6c47c68eb7 [FIX] hr_org_chart: undefined manager name in breadcrumbs
Before this commit, in the organization chart, when a manager that have too many
subordinates, and we want to view all the subordinates clicking the '...' button. There was
an error in the breadcrumbs, the text 'Undefined' was shown in the place of the manager's
name.

Now, the breadcrumbs shows the name of the manager.

OPW-1923990

closes odoo/odoo#30231
2019-01-16 09:35:35 +00:00
Nicolas Martinelli b876cb397d [FIX] website: null type redirection
Commit 68e9d5504c makes the redirection type mandatory, which is
logical. Since we can't add such a constraint in stable, we make the
field required in the view and assign a default value (in case the
module is not upgraded, which is very likely to be the case).

opw-1924983

closes odoo/odoo#30252
2019-01-16 07:51:53 +00:00
Christophe Simonis 952f784454 [MERGE] forward port branch 11.0 up to 4f2f299534 2019-01-15 17:48:36 +01:00
Denis Ledoux a409627602 [FIX] ir_ui_view: do not change view mode when just changing the inherit
Some views have the primary mode while having an inherit_id view
In such views, if the user wants to change the inherit_id,
the mode must remain primary.

The use case behind this is a user who want to change
the inherit_id view of the view
product.product.form (product.product_normal_form_view)
to another view.
This view is in primary mode while having an inherit_id
(product.product_template_form_view).
In such a case, the primary mode must remain,
otherwise the view will no longer be opened by default
when opening a product.
Indeed, when searching the default form view of a model,
it only searches for primary mode views for this model.

The `all` is there because this is an `api.multi` method.
We could consider adding a `self.ensure_one`,
but it breaks the API if someones calls this method with multiple records.
This is likely to happen, as this method is used
in `write` which is likely to be called with multiple records.

In my opinion, in master, this should be replaced by an
onchange so the user can see the change of mode
when he adds or remove an inherit_id for a view.

opw-1916324

closes odoo/odoo#30241
2019-01-15 16:43:08 +00:00
qdp-odoo c5a8e39758 [FIX] l10n_be_intrastat: adapt to new regulation for belgian intrastat
This is essentially a backport of module l10n_be_intrastat_2019 made for
Enterprise v12 + the refactoring needed on the original v10 module to
allow the changes to apply where needed.

Was requested by opw-1887019

closes odoo/odoo#30400
2019-01-22 07:22:59 +00:00
Christophe Simonis a909bb3391 [FIX] bus: correctly compute presence of partners with multiple users
closes odoo/odoo#30344
2019-01-18 10:39:00 +00:00
Christophe Simonis 4f2f299534 [MERGE] forward port branch saas-15 up to 3374ac805f 2019-01-15 15:08:01 +01:00
Nicolas Martinelli ae6545ccd5 [FIX] account: numerous reconciliation models
- Create many reconciliation models (more than 100)
- Try to create a manual reconciliation entry

The reconciliation models buttons are displayed on top of all fields,
making it impossible to encode any data.

We limit the size of the `div` to 54 pixels, which corresponds to 3
lines of buttons. All buttons are still accessible thanks to a
scrollbar.

opw-1890781

closes odoo/odoo#30212
2019-01-15 12:15:24 +00:00
Lucas Perais (lpe) 8e87075724 [FIX] sale: inline form SO contains price_total
When removing the editable attribute on the list view
of th o2m towards order_line, when adding a line,
the price_total of the line was neither computed nor sent to the onchange
of the sale order

now it is

OPW 1914740

closes odoo/odoo#30234
2019-01-15 14:28:01 +00:00
Nans Lefebvre 1e966452ff [FIX] l10n_be_invoice_bba: fix mail template
The field reference_type has been renamed invoice_reference_type in v11.
The selection value 'bba' for that field has been renamed 'structured'.
We update the template to reflect these changes.

Discovered thanks to a forward port of that field up to v12.

closes odoo/odoo#30224
2019-01-15 12:50:44 +00:00
Christophe Simonis 3374ac805f [MERGE] forward port branch saas-14 up to 28785f21e4 2019-01-15 11:45:44 +01:00
Christophe Simonis 28785f21e4 [MERGE] forward port branch 10.0 up to 6edfadbdd2 2019-01-15 10:48:11 +01:00
Julien (juc) Castiaux 357b374a7e [FIX] mail: URL with semi-colon
When posting a URL containing a semicolon, odoo stops the link
before the semicolon instead of continuing the link to the end
although it is a valid characters in URL (see RFC-3986)

e.g. the url "example.com&foo;bar" matches "example.com&foo"
     instead of the whole link

opw-1918367

closes odoo/odoo#30198
2019-01-15 09:02:12 +00:00
Nicolas Martinelli 180ace7b1b [FIX] product: unwanted attribute values in name
- Create the following attributes with values:
  Size: S, M, L, XL
  Color: Black, White
- Create a product template with the following attribute values:
  Size: S, M, L, XL
  Color: Black

The `name_get` of `product.product` returns `Name (SIZE, Black)` while
it should only return `Name (SIZE)`.

When using `attribute_id.value_ids`, the list of values contains all
possible values of the attribute, not only the values which apply to the
given product. In this case, it contains 'Black' and 'White', therefore
the condition `> 1` is verified and the attribute is kept for display.

We go back to the original filtering, and add `attribute_line_ids` in
the list fields read in order to avoid prefetching.

opw-1922140
opw-1922447

closes odoo/odoo#30273
2019-01-16 14:48:33 +00:00
Joren Van Onder 302d8a5264 [FIX] point_of_sale: allow refunds on non-cash journals
Cherry pick of 5b769650d6 in version 11.0

A customer can pay an order with a non-cash journal (e.g. a credit
card through a stand-alone terminal).

When this order has to be refunded later it should be possible to do
so on that same journal.

Some code prevented this from happening, notably a check in
order_is_valid which explicitly prevented this for an unknown
reason. There is no explanation in the
commit (4647f896a4) introducing that.

This commit allows the following:

1. input what you want to refund with a negative qty
2. click 'Payment'
3. click the Credit Card (type Bank) journal
4. (amount is auto-populated)
5. click 'Validate'

opw-805302
opw-1913731

closes odoo/odoo#30218
2019-01-16 14:19:13 +00:00
Nicolas Martinelli 614babd1e7 [FIX] account: bank statement with many AML
- Create a bank statement with more than 80 lines (therefore more than
  80 AML)
- Reconcile the lines
- Go back to the bank statement, and try to add a new line

An error arise:
"You cannot do this modification on a posted journal entry, you can just
change some non legal fields"

The error arise on the `move_line_ids` field on which the web client
tries to write.

Actually, this field is hidden since it is only used in the domain of a
stat button. We can make it read-only.

opw-1921138

closes odoo/odoo#30266
2019-01-16 11:09:21 +00:00
Iryna Vyshnevska 92e4c4c347 [CLA] signature for ivyshnevska
Backport to 10.0 of 3b14a7daa6

closes odoo/odoo#30090
2019-01-16 10:03:03 +00:00
Manuel Vázquez Acosta 6ac32c655e [FIX] survey: don't disclose the survey via print
To avoid bigger changes, only verify if the login is required.
A proper refactoring has been implemented in master at 9771fdfe8f

Closes odoo/odoo#30166
2019-01-16 12:51:43 +01:00
larisa 6edfadbdd2 [FIX] hr_payroll_account: correct account move lines creation
The super call of action_payslip_done executes the method compute_sheet.
Without this compute_sheet call, there is no salary lines and no accounting
move is created.

closes odoo/odoo#29737
2019-01-14 15:16:44 +00:00
Manuel Vázquez Acosta 9c6d969775 [CLA] Add Larisa to Merchise Autrement. 2019-01-14 15:05:40 +00:00
Nans Lefebvre 573ce17d0a [FIX] mail: keep attachments when switching between note and message
Start a message mail (respectively note) in the chatter. Attach a file.
Switch to note (respectively mail). The attachment is lost.

With this commit, we keep the attachments after the switch.

opw 1925588

closes odoo/odoo#30197
2019-01-14 14:54:47 +00:00
ougc27 8cba55ce31 [FIX] stock_landed_costs: cost account when dropship
- Set FIFO as costing method in product category
- Create a stockable product with the category configured previously
- Create a SO with the stockable product for 1 unit with dropship route
  and confirm the SO
- Confirm the PO created from the Sale Order to generate the delivery
- Process the stock picking
- Create a new Landed Cost with the stock picking delivered with a cost
  line with split method "Equal".
- Generate the valuation adjustments and confirm the landed cost to
  generate the journal entry

The debit account is wrong because the system takes the inventory
valuation account instead the expense account.

Odoo must take the expense account because the product never enter to
the company inventory, so is a cost of sale.

opw-1922633

closes odoo/odoo#29947
2019-01-23 10:59:11 +00:00
wan 017184331b [FIX] account: get credit and debit regarding to company
Detected with OPW 1920765

Reproduce : set multi-companies, install accounting. The due amount for all companies is the sum of the due amount for every single company

Cause : the context for company_id is not set in account.move.line:_query_get

Solution : set it in res.partner:_credit_debit_get in case _query_get is used elsewhere

closes odoo/odoo#30463
2019-01-23 09:15:17 +00:00
Nans Lefebvre 8ac0e8e447 [FIX] delivery: make the form view work from the Install more Providers action
Go to 'delivery methods', edit a delivery method.
Click on 'install more providers'.
You land on the 'Apps' app, already filtered on the 'delivery_' modules.
Click on 'more info' of a module: nothing happens.
It should open the form view of the module.

What happens is that the action doesn't contain 'form',
so the framework fails to open the form view from the kanban view.

opw 1928711

closes odoo/odoo#30437
2019-01-22 13:17:52 +00:00
Nicolas Martinelli ac270d63ad [FIX] stock_account: Average Cost
- Create a product where the associated product category has Costing
  Method "Average Cost (AVCO)"
- Create a PO. Order:
  2 units at 40
  4 units at 35
- Receive the picking

The cost of the product is set at 35 (or 40, depending on the order of
the lines in the PO).

Since we are in a situation where the available quantity is zero, we
enter in the `if float_is_zero...` condition, where the `qty_done` is
not set.

We should set it in all cases.

opw-1907328

closes odoo/odoo#30422
2019-01-22 09:28:34 +00:00
Nicolas Seinlet 15520c8e58 [IMP] sale: better use of the ORM
Search outside of the loop, use read_group, ...

closes odoo/odoo#29668
2019-01-22 12:00:47 +00:00
Jorge Pinna Puissant d79007cb09 [FIX] account: Date maturity in duplicate journal entry.
Before this commit, when the journal entry date was duplicated, the
maturity date (in the journal entry lines) stayed unchanged (it kept the
values of the original journal) and the user wasn't able to modify it.

Now, when the user duplicated a journal entry, the user can modify the
maturity date.

Note that, as is the case for the journal entry date, the maturity date
can't be modified after saving the journal entry.

OPW-1914706

closes odoo/odoo#30393
2019-01-22 10:29:35 +00:00
Nicolas Martinelli 79bfb23488 [FIX] website_sale_wishlist: new price
- Create a Public Pricelist without discounts
- Create a pricelist with a discount for all products, with 'Discount
  Policy' set to 'Show public price & discount to the customer'
- Assign the discount pricelist to the administrator partner
- Go to the eCommerce as public user (or any user with the Public
  Pricelist as default)
- Add a product to the Wishlist
- Go to the Wishlist

The discount of the admin pricelist is shown.

This is because the `product.wishlist` is browsed as superuser and the
computed field `price_new` depends on the user (ultimately through
`_website_price`)

opw-1912726

closes odoo/odoo#30358
2019-01-18 13:12:36 +00:00
Nans Lefebvre 102467ae23 [FIX] sale: add force_save on product_uom in views
Create a sale order. Confirm it. Add a new line. Change the UoM on this line.
The onchange is applied, modifying the unit price.
Save: the saved product UoM is the default one.

So for example if the user changes the UoM from day to hours,
he will sell one day for the price of one hour.

This is because the field product_uom is set to read_only if the state of the
sale order is confirmed ('sale') (as well as if the state is 'done' or 'cancel')
However it is still possible to change it when adding a new line.

opw 1923534

closes odoo/odoo#30420
2019-01-22 07:36:40 +00:00
José Francisco Martínez Salgado 16b873c771 [CLA] signature for xyvs
closes odoo/odoo#30372
2019-01-21 15:26:55 +00:00
qsm-odoo 6930f9c353 [FIX] web_editor: restore less files edition
Broken by https://github.com/odoo/odoo/pull/30186

closes odoo/odoo#30403
2019-01-21 11:38:32 +00:00
Xavier Morel cadefebd18 [REM] doc: outdated intersphinx mappings
ea6e7379a3 removed the few intersphinx
refs to sqlalchemy & django, so these mappings have not been necessary
in a year. This is especially annoying as the currently configured
sqlalchemy mapping has been very flaky / regularly failing.

Remove the mappings entirely.

closes odoo/odoo#30397
2019-01-21 10:11:32 +00:00
liweijie0812 0c2e168f8e [FIX] account: return ShowPaymentLineWidget widget
ShowPaymentLineWidget was unextendable

closes odoo/odoo#30268
2019-01-18 14:39:40 +00:00
liweijie0812 f965f3a861 [CLA] liweijie0812 signed CLA
Cherry-pick from odoo/odoo#30278
2019-01-18 14:39:24 +00:00
mreficent c45a4e8f83 [FIX] account: remove duplicated code
https://github.com/odoo/odoo/commit/42e74aae51904955e725e4a96e39eb2bd60f3019 was a backport of https://github.com/odoo/odoo/commit/7544c22de9a4cea028ff8fe63931bf68573e0821, and thus generated a duplicated code.

closes odoo/odoo#30318
2019-01-17 13:45:20 +00:00
Filippo Iovine 169843d8d3 [CLA] add Filippo Iovine to levelprime CCLA
closes odoo/odoo#29072
2019-01-14 14:51:23 +00:00
Jeremy Kersten 6e3661d53f [FIX] payment_sips: allow to customize key_version
Some sips provider don't use 2 as key_version.
E.g. mercanet uses '1' as production key.

Now we allow to override it in Ir Config Parameter for stable version.

Todo:
Need to make it customizable by end user into the configuration of acquirer.

Courtesy of BEK for reporting

opw-1916316

closes odoo/odoo#30185
2019-01-14 12:27:09 +00:00
Adrian Torres f3de712d76 [FIX] ir_model: add constraint on domain field
Previous to this commit, if one were to create an ir.model.field with a
poorly constructed domain (read: SyntaxError), the server would properly
send an error message stating that an Error occurred, however this would
be too late as the registry with the bad code would have already been
reloaded, this meant that the registry would be left in an unstable
state (read: crashed).

With this commit, a constraint on the domain is added so that we confirm
that the code in the domain field is properly constructed, thus no need
to reload the registry and therefore no crash.

closes odoo/odoo#30157
2019-01-14 08:30:56 +00:00
Aaron Bohy dec9f7c4ce [FIX] web: one2many list: quickly switch between pages
Before this rev., a crash might occur when the user quickly
switched twice between pages (e.g. go to page 2, then page 3) on a
slow network.

In the given example, when data of page 2 returned, the list was
re-rendered. Unfortunately, the offset of that list' datapoint was
already changed due to the switch to page 3, meaning that the view
tried to render a page that wasn't loaded yet, leading to a crash
if there were modifiers to evaluate, or to empty records being
displayed.

This rev. ensures that the view is rendered with the data of the
page it expects.

closes odoo/odoo#30150
2019-01-11 14:36:13 +00:00
Lucas Perais (lpe) c99e1facf9 [FIX] purchase: in a x2m fields in tree must be in form too
On the PO form view, change the order_lines inline view:
- the tree becomes not editable
- allowed modes are tree,form

Add a new order line, the form view of order_lines opens up
Modify some stuff, then save and new

Before this commit, it crashed because some fields were expected in the tree view
that were not defaulted in the form view by the JS framework.

After this commit, this flow doesn't crash because we make sure every field
in the tree view is present in the form view

OPW 1917111

closes odoo/odoo#30219
2019-01-15 10:26:55 +00:00
Andreas Perhab 9916c30da8 [FIX] web_planner: test should not assume url parameter order
test_web_planner throws errors like this on some environments:
AssertionError:
'/web#action=135&view_type=list' != '/web#view_type=list&action=135'

the urls in web_planner are created with a dict for the parameters to
create the urls. dicts are unorderd up to python 3.5. (see
 https://www.python.org/dev/peps/pep-0468/)

As the urls /web#action=135&view_type=list and
/web#view_type=list&action=135 are equivalent we now test if the
parameters are the equal in the url regardless of their order.

closes odoo/odoo#30138
2019-01-11 14:05:04 +00:00
Christophe Simonis e033114879 [FIX] sale_timesheet: correct test
Since 5efec7ccdd, ProjectPlan widget
expect actual html.
2019-01-10 18:54:48 +01:00