The system cannot create two inventory adjustements in state 'in Progess'
with the same product, with the same location, same package, same lot and
same owner.
Example:if two adjustments(ADJ1, ADJ2) are created with the same product(P)
and with the same location(L), let's say:
qty_available for P is 10
in ADJ1: Theoritical Quantity=10 and Real Quantity=20 => a quant with +10 is created
in ADJ2: Theoritical Quantity=10 and Real Quantity=30 => a quant with +20 is created
When ADJ1 is validated then qty_available for P is now 20(that 's ok)
When ADJ2 is validated then qty_available for P is now 40(that's wrong because
the Real Quantity is expected which is 30)
This is why this fix is required.
opw:660658
Methods get_formview_action can be called by sudo() so for knowing the
real user they should prefer context['uid'] to uid.
Without the action `/web` can't figure out that e.g the view we want is
the one for portal user and not the default one.
With this fix, portal user (not in base.group_user) get to the intended
view with the intended menu when clicking on a invoice/sale order portal
mail link. As for other user there is no change.
closes#10681
opw-666260
The system cannot create two inventory adjustements in state 'in Progess'
with the same product, with the same location, same package, same lot and
same owner.
Example:if two adjustments(ADJ1, ADJ2) are created with the same product(P)
and with the same location(L), let's say:
qty_available for P is 10
in ADJ1: Theoritical Quantity=10 and Real Quantity=20 => a quant with +10 is created
in ADJ2: Theoritical Quantity=10 and Real Quantity=30 => a quant with +20 is created
When ADJ1 is validated then qty_available for P is now 20(that 's ok)
When ADJ2 is validated then qty_available for P is now 40(that's wrong because
the Real Quantity is expected which is 30)
This is why this fix is required.
opw:660658
According to PEP302, the signature of `Finder.find_module` should be
`find_module(fullname, path=None)`.
Ever since it was introduced in 64ec5f36df the addons import hook
defines the second parameter as mandatory, which is an issue for
systems relying on the specified behaviour (and not needing to
provide a path) like the stdlib's `pkgutil.find_loader`.
fixes#10670
Borrowing a cursor each time you access `field.digits` may be costly, because
of the connection reset. Moreover, in most cases, the cursor is not used at
all, since the decimal precision are kept in cache.
For the installation of module `product` with its demo data, the number of
cursor allocations was reduced from ~1500 to about 50!
Usually when setting up a POSBox you want it to have a static IP. The
best way to do that is by configuring whatever DHCP server is
used (usually just on the router) to always assign the same IP to a
certain MAC address (naming depends on what is being used, sometimes
it's called static DHCP but it's also known as DHCP reservations and a
bunch of other names).
The process of setting this up is complicated for a non-technical user,
and this attempts to make it a little bit easier to do by immediately
giving them the correct MAC address they should use. To avoid confusion
this only prints the MAC addresses for interfaces which have an IP
address.
With 003d85b instead of getting the name of the relation
field_relation we get field_relation/id which will get us an xmlid
instead.
But the data about related fields are not gotten all at once when
opening the export modal. They are gotten by clicking on the arrow of
the related record.
It is in this data that the /id will be appended for the field, but when
getting a saved export list, this data may not be available.
This commit immediately add the `/id` when a field is put in "Fields to
export" column, so this inconsistency is no more.
closes#10640fixes#10327
opw-665994
When editing a line, leave the buttons visible.
Also remove the 3px gap between fields so that readonly field texts
does not move when entering the edition mode.
When the user clicks on the stat button "Invoices", then creates a new
invoice, the default currency of the new invoice will be based on the
default account journal. If the default account journal is not in the
currency of the PO, this will lead to an invoice which is not in the
same currency than the PO. This is not a bug in itself, but most of the
time, the user will want to create an invoice in the same currency than
the PO.
If no invoice is linked to the PO, the fix sets a default account
journal in the currency of the PO, as long as one can be found. If an
invoice is already linked to the PO, it uses the same account journal.
opw-667743
* Fix the grid display of images (use the column property)
* Use Dialog class
* Allow removing a cover image
* Add image selection before choosing it (or double click to choose)
+ add less mixins in web for columns property
Traversing new records in a different cache requires that all new records on
the path are copied across caches. Make the copy across caches recursive when
the first record on the path is a new record.
When a vendor bill is created, no source document is added
automatically. Moreover, since the field is hidden when empty, there is
no way for the user to fill it.
The fix fills in automatically the source document field from the list
of PO.
opw-667055
Copy the structure of the sale order report regarding the
partner, invoice and shipping address.
Besides, on a repair order, this is possible
to set a shipping address without setting
an invoice address (if no invoicing is set).
In such a case, the `Invoice address:` must be hidden.
opw-666506
When an account move line is reconciled with debits and credits, both are
subtracted from the original amount. This is not logical, since if the
line is a credit (debit) we should subtract (add) the debits and add
(subtract) the credits.
opw-667137
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