Commit Graph
126256 Commits
Author SHA1 Message Date
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
Christophe Simonis d11dc31e7a [MERGE] forward port branch 11.0 up to 617652bbfe 2019-01-10 17:59:26 +01:00
Romain Derie b5fe23055d [FIX] website: handle COW'd views during module install/update
Since multi-website, we COW (copy on write) views when editing a view on a
website.
This is causing 2 issues related to module install/update:
1. During a module install, when creating an inherited view, it will create
   that view as expected on the generic tree.
   But that generic tree may not be used on website(s). Indeed, if the view
   was edited, we are now using a copy of the view instead of the original
   XML view (with an xml_id).
   That copied view won't get the new inherited view in its view tree.
   Now, we correctly copy the new view under every specific view tree (if
   exists).
2. During a module update, when updating a view, it will only update the view
   having the xml_id, so the generic one.
   But most of the time, the generic view is not used as it was usually COW'd
   and the specific view now replace the generic one.
   Now, we also apply the update on the COW'd view. Note that only unmodified
   field will be updated, this behavior basically mimic the noupdate behavior
   on view's ir.model.data.

Step to reproduce for bug 1:
  - Install website_sale module
  - Go to a product page and then enter edit mode
  - Make a modification to trigger COW, eg edit the information area under the
    price "30-day money-back guarantee".
  - Now install website_sale_comparison module
  - The product page won't have the comparison button as the comparison view
    inheriting the product view was created on the generic tree and not copied
    on the specific tree (COW'd before the comparison module install).

Step to reproduce for bug 2:
  - Repeat first 3 steps of bug 1
  - Now make a modification in a view from the XML file in
    website_sale_comparison module and update the module
  - Only the view with the xml_id is updated, not it's COW'd views. This mean
    that only the generic view is updated and not the specific one(s) really
    used on the website.

task-1920487

closes odoo/odoo#29956
2019-01-10 16:19:35 +00:00
Christophe Simonis 617652bbfe [MERGE] forward port branch saas-15 up to 9878db14f5 2019-01-10 17:00:16 +01:00
Christophe Simonis 9878db14f5 [MERGE] forward port branch saas-14 up to a449b063b0 2019-01-10 16:59:00 +01:00
Christophe Simonis a449b063b0 [MERGE] forward port branch 10.0 up to 5f12e244f6 2019-01-10 16:58:38 +01:00
Laurent Smet ec25b9d01b [FIX] account: Prevent crash when having custom coa
- Create manually an account.payment after having created manually some journals
(without installing a coa).
- Install a module containing a coa and calling try_loading_for_current_company or depending
of other module doing such things.

=> Crash because company.chart_template_id is not set.

-opw: 1921711

closes odoo/odoo#30117
2019-01-10 13:53:14 +00:00
Nans Lefebvre a7cbac305e [FIX] web: reset offset in the search more view dialog
Start on the modal obtained by a "search more". The offset is never reset.
So suppose you are on page 2, looking at record 81-160.
Do a research that gives less than 80 records.
The result of the search is nothing, since is has been done with a 80 offset.
It should be reset to 0 when we do a new search.

opw 1920826

closes odoo/odoo#30109
2019-01-11 15:07:40 +00:00
Nans Lefebvre f8e953fdd6 [FIX] base: set related crud_model_name on the correct field
Create an automated action that creates a new record (of target crud_model_id).
Try using a link_field_id: nothing appears to be selectable, even if some fields
satisfy the intended conditions.
The issue is that the crud_model_name field was related to crud_model_id.name,
instead of the correct crud_model_id.model (note the apt naming).
Note that in the onchange the value of crud_model_name was correctly set to
crud_model_id.model, adding to the confusion.

opw 1910671

closes odoo/odoo#30145
2019-01-11 08:56:02 +00:00
Christophe Simonis 5f12e244f6 [IMP] base: compute implied groups in SQL
SQL improve the speed of the implied group
VS the orm version.

closes odoo/odoo#30108
2019-01-10 13:48:40 +00:00
Christophe Simonis 96e800703b [MERGE] forward port branch saas-14 up to 390d8594b0 2019-01-10 13:22:07 +01:00
Christophe Simonis 390d8594b0 [MERGE] forward port branch 10.0 up to b131658966 2019-01-10 11:33:40 +01:00
Christophe Simonis 3390fec761 [MERGE] forward port branch 12.0 up to 744c073abb7
closes odoo/enterprise#3394
2019-01-09 15:35:00 +00:00
Lucas Perais (lpe) b87879c1f6 [FIX] web_editor: icon widget complies to api
the search method should return a Deferred as explicit in MediaDialog

OPW 1919549

closes odoo/odoo#30077
2019-01-09 14:32:04 +00:00
Romain Derie 20e9d77be8 [FIX] website: correct order when copying view children on COW
Before this commit, a generic view tree could be valid but impossible to copy
on a COW specific tree.

This was because when looping through inherit_children_ids to copy them, they
would be sorted by the ir.ui.view sort order (name, priority, id).
Indeed, when applying view inheritance and reading a view arch, children are
sorted by (priority, id).

Thus, if sorting the children by (name, priority, id) was different than
sorting by (priority, id) and the children view would conflict in that new
order, the COW would raise an error "can't find DOM element"

Step to reproduce:
  - Create a parent view with just a DIV in arch
  - Add a child view that add something inside that DIV
  - Add another child view with a name alphabetically lower than the other
    child and that replace the DIV by something else, like a SECTION
  - Everything works as expected, when reading the parent view arch, the first
    child is inserting something into the DIV and then the second is replacing
    the DIV
  - Now try to trigger the COW on the parent view by writing something on it in
    a website context
  - It will crash as the child views will be copied in another order, sorted
    firstly by name.
  - Indeed, when reading parent view, the second child will be copied first as
    it's name is lower than the first, it will then replace the DIV by a SPAN.
    When trying to copy the other child view that is supposed to insert
    something into the DIV, the DIV will not be found and it will crash.
2019-01-09 13:09:26 +00:00
Nicolas Martinelli 3ad5748cef [FIX] purchase: auto-complete order
When using the 'Auto-Complete' feature of a vendor bill, oldest vendor
bills are suggested first.

This is because the `_order` uses the `vendor_bill_id` and the
`purchase_order_id`. In the view, we have a mix of positive, negative
and null ids, therefore this can't work.

We sort on the date and the name instead, which gives a more reliable
result.

opw-1925910

closes odoo/odoo#30299
2019-01-17 09:41:41 +00:00
Martin Trigaux 766da2017c [I18N] l10n_be: update chart of account translations
To reflect the latest accounts and taxes
Update nl.po files to help translators
A future commit will translate the missing entries

closes odoo/odoo#30297
2019-01-17 09:17:07 +00:00
Pierre Masereel 27cc1fb3af [FIX] snailmail: background layout footer
In the background layout footer, it happens that the content is over a
zone that must stay blank. That's why w've added a left-padding to the
footer.

OPW-1928366

closes odoo/odoo#30296
2019-01-16 15:17:14 +00:00
Sébastien Theys 13b104bf9e [FIX] sale,sale_management: prevent traceback on get_access_action
The field `sale_order_template_id` is only defined on `sale_management`, so
calling that method without `sale_management` would crash (traceback).

The method was in `sale_management` in the first place but commit
34c47eecd3 happened and some mistakes were made
that day.

PR: #30000

closes odoo/odoo#30294
2019-01-17 08:16:11 +00:00
Sébastien Theys 9df7d244a0 [FIX] tests: fix chrome headless to work with any local HOST
Before this commit, changing the value of the HOST variable didn't work because
it wasn't correctly used everywhere.

Moreover, the `web.base.url` was not correctly set: it is set during
authenticate, but when calling it from the console instead of from a request,
which is the case for tests, it is not able to grab and set the URL as needed.

PR: #30000
2019-01-17 08:16:11 +00:00
Christophe Simonis 2d824a5b7a [FIX] test_mail: bump expected query count
The prefetch hell patch [1] generate one more query.

[1] a07a076c45
2019-01-08 15:35:34 +01:00
Gert Pellin 9246375b25 [fix] point_of_sale: payment screen backspace
before the fix if hitting the backspace in point of paiment screen would
triger the keypress event twice.

removed the double eventhandler

resolves https://github.com/odoo/odoo/issues/29911

closes odoo/odoo#30031
2019-01-08 13:17:16 +00:00
Jorge Pinna Puissant 13e47f508f [FIX] payment_authorize: customer profile without email
opw-1920083

Before this commit, an error arrived when creating a customer profile
without email.
Now, if the email don't exists we send an empty string to Authorize.

closes odoo/odoo#30075
2019-01-09 13:44:06 +00:00
Gert Pellin 313b133878 [FIX] point_of_sale: Correct move amount lot
Before this fix, if 2 or more sale lines have the same product with different
lot-numbers the amount for each move will be set to the total amount of the
product.

This fix resolves this problem and will only count the amount sold of
each lot.

Resolves https://github.com/odoo/odoo/issues/30006

closes odoo/odoo#30019
2019-01-09 11:31:42 +00:00
Romain Estievenart 5efec7ccdd [FIX] sale_timesheet: responsive table
On small screens, when we click on the overview of a task
inside the "project" app, the displayed table doesn't fit the screen.

This commit only add missing parent "div.table-responsive" to add
responsive support.

A better fix has been merged in master, see:
https://github.com/odoo/odoo/commit/dc017d17e9170d3fc0a5104ab9dc84f748bc097a

opw-1907877

closes odoo/odoo#29971
2019-01-08 14:25:37 +00:00
Nicolas Martinelli 3929e419ff [FIX] stock: assign partner
- Create a SO with a stockable product, validate
- On the corresponding picking, change the partner
- Print the 'Picking Operations' or 'Delivery Slip'

The partner printed is the partner of the SO, not of the picking.

This was reported many times in the past, and is quite confusing. It
happens because the partner on the `stock.move` remains the partner set
on the SO.

We shouldn't change the reports, nor automatically propagate the change
since it might cause issues, e.g. in case on dropshipping or manual
creation of the picking.

Therefore, we add an action which allows to set the partner on the stock
move manually.

opw-1917851

closes odoo/odoo#29939
2019-01-08 13:41:07 +00:00
Jorge Pinna Puissant b131658966 [FIX] account: error in Base amount tax
opw-1917605

Before this commit, when accounting is set to global rounding, the base
amount per tax is not correctly calculated.

Now, the Base amount per tax is calculated adding the rounded lines.

To test this issue, you need to set to global rounding and create a
customer invoice with the following lines :
line 1 = Qty:40; unit price:2.27; tax:15%; discount: 10%
line 2 = Qty:21; unit price:2.77; tax:15%; discount: 10%
line 3 = Qty:21; unit price:2.77; tax:15%; discount: 10%

When the invoce is printed, you would notice that the amount is 186.43
and it should be 186.42.

closes odoo/odoo#30021
2019-01-08 13:13:36 +00:00
qsm-odoo 42230ed22e [FIX] website_sale: make eCommerce animations work in all browsers
The eCommerce sometimes animates product images when they are put in
the cart / wishlist / comparison panel. Those animations did not work
on Firefox and IE and made strange scrollbars appear instead.
2019-01-08 14:02:01 +01:00
Christophe Simonis b50883d17b [MERGE] forward port branch 11.0 up to c07b7200b2 2019-01-08 11:52:15 +01:00
Christophe Simonis c07b7200b2 [MERGE] forward port branch saas-15 up to e1c7fefe89 2019-01-07 18:19:25 +01:00