With:
Two companies 'Company A' & 'Company B'
Sequences for SO & PO for each company
so_from_po set to True on 'Compny B'
When:
Company A created a PO with Company B as supplier, and validated it,
An error is raised "Configure correct warehouse for company(Company B)..."
The field warehouse_id is required on the SO, so force the user to set one in
the configuration of the company
This revision is related to feb2ede0d6
When overriding an onchange method, the `@api.change` property,
that decides on which fields the onchange method must be triggered,
should be the same on the overriding and the overriden method.
Otherwise, the base onchange won't be triggered on the fields
it expected to.
opw-668049
In enterprise/web/static/src/xml/base.xml, the javascript template
ListView uses on each column (field) column.width() where width is
a javascript function. Then argument width cannot be use in tree view.
opw:667465
In a sequence, `range_year` is supposed to be the year
of the range beginning date:
```
When subsequences per date range are used,
you can prefix variables with 'range_' to use
the beginning of the range instead of the current date,
e.g. %(range_year)s instead of %(year)s.
```
Therefore, for a sequence with ranges configured as:
- 20150701 to 20160630
- 20160701 to 20170630
An invoice confirmed on 20160101 must have `2015`
as year when using `range_year`, and not `2016`.
If you would like the invoice effective date,
you must then use `year`, instead.
We add the `current_%` keys as well,
in case some users absolutely want the
`now` date instead of the effective date,
but it doesn't make much sense in the context
of accounting.
Besides, outside the context of the accounting,
`year`, `month`, `date` etc is the `now` date.
opw-649487
This is possible to unreconcile and then remove journal
items associated to `account.voucher.line`.
When it's done, the voucher is within a corrupted state,
with debits and credits lines without journal item, which
is required.
Because the journal item of this line is empty,
while required, this is no longer possible to use
the "Unreconcile" button, because the form is invalid.
In order to allow to unreconcile a posted customer/supplier
payments with missing journal items, we set
the journal items as required only when the payment
is within the `draft` stage.
opw-667232
The module system allow modules to return a deferred. When that
deferred resolves, the module is considered to have succesfully loaded,
and the result value is its value. Then, the boot.js code used a
setTimeout (via _.defer) to load all its dependencies.
This is not wrong per se, but it empties the call stack, which give
other code the opportunity to interfere. In particular, it is an issue
in phantomjs tests, because it causes a window between the
domcontentloaded event (which is a key event in website) and the actual
loading of all dependent modules. This execution window can be used to
start some tours, but the code of those tours is waiting the next tick
to load, so horrible crashes happens.
This commit calls immediately process_jobs to avoid those issues.
Before this revision, with a configuration setup
like this:
- Company A - Currency EUR
- Company B - Currency USD
- Public Pricelist- Currency EUR
- Product A - Company A - Price 100 (EUR)
- Product B - No company - Price 100
When a user set in Company B browses the `/shop`,
the pricelist applied is the public pricelist,
and, therefore, the prices are shown in EUR
(nothing wrong so far),
but the currency of the price set on the products
were assumed in USD, the user company currency, and,
therefore, the rate conversion from USD to EUR
was applied.
The product A, configured with a sale price of 100€
in the company A, was therefore displayed to 92€
(100€ * the USD-EUR rate).
The product B, without any company set, as well.
Meaning, two users from two different companies using the same
pricelist see two different prices in the same currency,
because their companies do not use the same currency.
This doesn't make any sense.
With this revision,
when setuping a sale price on a product, the currency
of this price is assumed in the currency of the company
set on the product.
If there is no company set on the product (the company
is not required), the currency assumed is then the currency
of the main company.
opw-666059
Because otherwise a user who has access to a view displaying
supplier_invoice_count will get an access error if he doesn't also have
access to purchase.order, even if that wouldn't have been displayed.
opw-666935
The dataset of an x2m could be set as changed on a focus event, but if
the form is currently not in editing, it could stay blocked in this
state.
This commit add a check so blur and focus on x2m are better coupled.
opw-665401
account.bank.statement.line has a journal_entry_ids field which is a o2m
to account.move. During confirmation of bank
statements (button_confirm_bank()) this o2m field is heavily used. When
a database has a lot of account.move records this lookup starts taking
up quite a bit of time. As an example, on a locally duplicated customer
database with ~700000 account.move records attempting to resolve
journal_entry_ids of an account.bank.statement.line record was observed
to take > 1 second. This index improves it to be < 5 milliseconds.
This is especially important when big POS sessions have to be closed,
because those will contain a lot of account.bank.statement.line records.
opw-665309
A partner can be associated to multiple users.
The condition checking the partner
user has enough karma should therefore
handle it. The previous condition expected
a singleton (only one user for the partner).
With the condition before this revision,
a partner with multiple users could
simply not post new questions on the forum.
opw-667894
The default behavior of session.rpc is to block the ui if it is not
completed in some short delay. This is not really good for various
types of rpcs. The discuss application is actually doing quite a lot
under the hood, and blocking the ui for some of those use cases does not
make sense (exemple: marking a channel as seen)
When editing a form with the arabic language, the date is formatted in
arabic. But the version of the Moment.js library we use for this had
inconsistencies and parsing the arabic date could not work.
Hence, saving would not work since date field values would be invalid.
This commit cherry-pick http://momentjs.com/ commits which solves that:
from version 1.8.4: https://github.com/moment/moment/commit/c9023b5
from version 1.9.0: https://github.com/moment/moment/commit/bd328d5closes#10634
opw-660453
When creating a XLS file with more than 256 columns, the library used
(xlwt) fail since it is targetted to support MS Excel 97 up to
Excel 2003.
But Odoo doesn't has no check and in this given instance (an error
happening in a controller generating a binary filte) the real error
message is lost.
This commit check if the to-be exported data has more than 256 columns,
and if this is the case display an error message without even trying
the export.
closes#10630
opw-660474
This commit does not actually fix qweb2.js, but it works around a
phantomjs bug. The problem with phantomjs is that in some situations,
the xmlhttprequests are dropped with a status 0. It is most likely
related to the issue:
https://github.com/ariya/phantomjs/issues/11195
In our testing framework, it seems to appear when requests sent before
the 'load' event of phantomjs are received after, and also when those
requests are listened with the onreadystatechange handler.
The bug does not appear if we use addEventListener with the 'load' event (at
least, not for a few builds)
This commit does not worsen qweb, and it is also a small improvement in
style (in my opinion).
When categories on the point of sale take too much height, the product
and overflown categories are not visible.
In those instance Odoo wizards would usually:
- use an option to have small categories without pictures,
- have a category "all" with all the product,
- do a custom change to reduce the size of categories or add a scrollbar
This commit add the last customization in stable.
If the category block is bigger than 60% of the page height, the
categories are cropped and a scrollbar is added.
closes#10588
opw-660383
This could allow a malicious flow that made the quotation available
via the website_quote module; allowing you to sign and confirm the
order without actually paying it.
When performing a stock valuation at date,
the stock valuation total wasn't equal
to the sum of each line of the report.
This is because the domain forcing the
date wasn't passed to the `search` call
when no group by was applied.
Indeed, when calling
`read_group` with a group by, the lines in the results
contains the domain used for each line, but when
there is no group by applied, this is not the case, the domain
is not included in the line dict returned by `read_group`.
In such a case, therefore, we must use the domain that was passed to
the `read_group` call.
opw-667761
The definition of "total" as a global variable is done too soon in the
JS. Depending on the order in which the JS modules are loaded, it is
very unlikely that the translations are already loaded at that moment.
opw-666577