To keep the same behavior as in 11.0, you can only add a purchase order to a vendor
bill when the vendor bill is in draft. Afterwards it is not longer possible.
opw:803068
Add the inventory value in the pivot view. Indeed, the Unit Cost
displayed is the cost of the quant, which is not what is expected in
case of standard costing method.
opw-785872
The report 'Leaves by Department' only counts full days-off, instead of
taking into account the actual number of days.
This commit fixes the total number of days per employee. However, there
is still a limitation on the display: a day is either fully colored or
not at all.
opw-801061
Before this commit, in the event that the admin user has set the language
to english, but the COA's target company had a different language,
the admin user's language had been taken instead of the copany's one
for the translation of journals and other coa intialization stuff.
This is wrong as the CoA is more connected to the company, than to the
user, which could be a functional support user that just happens to prefer
the english version over the local one.
Now, we ensure in two neuralgic places, that the company's language is passed
to the context and therefore picked up by the translation's GetTextAlias.
Signed-off-by: David Arnold <dar@xoe.solutions>
Routes created when creating companie were not set to the correct company.
Steps to reproduce:
- Go to Settings > General settings: Activate Manage Multiple companies.
- Go in Inventory > Configuration>Settings: Click "Manage several Warehouses,
each one composed by several stock location". Click "Advanced routing
of products using rules".
- Go in Settings > Users > Companies: Create new companie "ThisNewCompanie"
- Go in Inventory > Configuration>Routes: Open Routes named ThisNewCompanie.
Bug:
All the routes created automatically by creating the company "ThisNewCompanie" are
not set to the company "ThisNewCompanie". They are set to the company of the logged
user when "ThisNewCompanie" was created
opw:787229
Purpose
=======
When you create a budget, the field analytic account on the budget line is not mandatory but if you don't set one, it doesn't work, the practical amount always stays at 0 even if there are journal items in the accounts defined in the budgetary positions
The field `price_subtotal_signed` contains the price converted in the
company currency. However, we should make sure to use the exchange rate
of the invoice date for its computation.
An use problematic use case is the creation of a deferred revenue from
an invoice (commit 7fe89d08b3).
opw-702352
As admin every tax is loaded, which is wrong anyway.
When the admin opens a session a change the cashier in the POS interface,
every order is made with every tax ever (on the product)
which could lead to major faulty records
See the case on OPW 786803 which is critical
[FIX] mail: delete leftover followers
Previous to this commit, if during the unlink of a model which inherits
from mail.thread an exception is raised before mail.thread's unlink() is
called, followers for such model won't be properly deleted from the
database.
This commit changes this by overriding ir_model's unlink and deleting any
followers whose res_model is not installed.
Partial back-port of 3614193Fixes#21462
OPW 786790
Before this revision,
Assigning a user for which its partner is inactive
was sending the assignation notification email to the `partner_id`
of the object.
e.g. Assigning a task to a user for which its partner is disabled
sent the assignation notification email to the customer of the task.
opw-787659
Discarding a new record triggers the 'history_back' action. This makes
sense if the record was discarded from a normal form view, but not so
much when in a modal, where the expected behaviour is to close the
dialog.
This commit overrides the function in the action manager which handles
the switch to the previous view. It checks whether a dialog window is
open, in which case it simply closes it.
note: 10.0 backport from 11.0 33aa89edcloses#20405
opw-786866
closes#21792
When a user was closing a POS to go into the backend, and click on "Reprendre",
there was an error which prevent him to reopen the POS.
There was a confusion between object <datetime> and <datetime.datetime>, as
the previous code was trying to use the function timedelta() from datetime.datetime
instead of datetime. As a result, the error states that datetime.datetime has no
function timedelta.
opw-801523
- Activate Work Orders
- Go in MRP > Reporting > Work Orders
The status filters ('Ready', 'Pending'...) do not work.
This is because the action forces the domain to `[('state','=','done')]`
instead of using one of the available filters.
opw-788043
The stock_history view is generated from by grouping of move from
sources and move to destinations which depending on the request and
number of request can be rather slow.
This fix replace a possibly high number of request by a slower number.
On a production instance, doing an inventory at a choosen date:
- with 300 stock moves, went from 4 minutes to 4 seconds,
- with 130 000 stock moves, went from 66 minutes to 10 minutes
opw-765793
closes#19594
The web planner specified no language for frontend so the website
planner on the frontend was never translated.
This commit add a specialized fallback for this use case so the planner
on the website is in the language of the current user.
The code is the same that get_context from web_editor.base but requiring
that would possibly adds delays (for dom_ready) that we don't want.
note: this is for 9.0 up to not including 11.0, in 11.0 another solution
is used and in master a bigger change is being worked on.
opw-781727
fixes#20829closes#21004
Before this commit, one could choose the App Switcher as his Home action.
and arriving on /web would trigger an infinite loop at startup
After this commit it is not possible to choose the App Switcher as Home action anymore
OPW 800323
Commit 74e4130f5f makes sure to make the accounting date prevail on
the invoice date when it comes to currency conversion.
However, the choice of date is not universally recognized. Softwares
(and accountants) might use either the accounting date or the invoice
date.
Therefore, we provide a hook se the behavior of the software can easily
be changed if necessary.
opw-783372
When an user goes to its cart and removes all the items, the checkout
button is hidden so that the user cannot start an order with no product.
This behavior was not working in languages which are not the default
language of the website, as the button was found in JS relying on the
fact it started by "/shop/checkout", while it can be something like
"/fr_FR/shop/checkout".
Closes https://github.com/odoo/odoo/issues/21722
When the unit price of a kit is computed in anglo saxon accounting, the
average price of kit parts is not multiplied by the quantity of this
parts in the bom.
E.g.: a kit of 2 prod1 and 1 prod2, when the price is computed, it only
take into account the cost of 1 prod1 and 1 prod2 to compute the kit
cost instead of 2 prod1 and 1 prod2
opw-786268
- Create a MO which generates WOs
- User 1 starts working on it
- User 2 starts working on it
The field 'Real Duration' only displays the time spent by the user
connected. It means that there will be an inconsistency between the
field 'Real Duration' and the list of durations shown in the `time_ids`
field.
We want to keep 'Real Duration' limited to the current user, because it
should represent the duration updated in real time (done in widget
`mrp_time_counter`). However, we also want to see the total real
drations for all users. Thereofe, we simply update the view to show the
total in the list view.
opw-784456
Depending on the speed of the runbot, errors may appear if one tries to
use a template that is not yet loaded. Templates are being
loaded and we add new template to read, the ready function does not
take into account new additions.
The kanban view uses a template which comes from the server, already
translated. Before this commit, it tried to retranslate again the
template in qweb.js, which may be a problem (in addition to the useless
work): if some english string A is translated in B (french), but B is
also a valid english string which is translated into C in french, then
we will have a wrong result.
In this commit, we simply add a flag to disable the translation process, which
should also slightly improve the kanban view rendering performance.
Avoid texts to be translated twice if some modules have the translated
value corresponding to the English source term.
To reproduce: create a translation for static xml (comment 'openerp-web')
with 'Modifier' translated by 'Tadaaa'. In french context, the 'Edit'
button in forms is translated by 'Tadaaa'.
Don't translate template in web_editor if we are in the backend because
the translations of all the modules have already been loaded and applied.
On a tree view:
- Add a button returning an `act_url` action; e.g.:
```
@api.multi
def open_google(self):
return {
'type': 'ir.actions.act_url',
'url': 'https://google.fr/',
'target': 'new',
}
```
- Click on a button
The action call works only once because the button is never re-enabled.
The button is actually enabled only at view rendering. Therefore, we
call `on_close` in order to reload the view.
opw-784587
Take account of the user timezone to compute the price for
pricelist rules with start / end date.
Before this revision, the date used to compare to
the dated pricelist rule is always the date of today
in UTC.
For instance:
- If a user is in timezone UTC +12
- The 10% discount on the pricelist starts on December 19
- It's currently December 18 13:00
The user did not have the discount,
because it was consdiered December 18,
while the user was already in December 19.
With this revision, we take account of the context
and its timezone to compute the date of today
and return the correct price according to the
dated start and end datetime.
opw-785203
- Sell a Product A
- From receipt screen, scan the barcode of Product B
- B will be in tab along with A
- Pay and validate
- Close the session
Only an order with Product A is recorded in the session (order 1).
When performing this set of actions, a new order is not created: the POS
simply reuses the current order. However, `create_from_ui` (called in
the receipt screen) discards an order if the reference already exists.
This means that the first order is correctly synchronized at validation,
while the second order is silently discarded.
Closes#16781
opw-766459
Purpose
=======
Unbreak consistency check:
- on creation (check not done)
- when applied to a record set of several sheets belonging to different employees (reporting spurious errors)
Specification
=============
- self.something() in a api.model method does not make sense, so I replaced it with a call on the newly created sheet.
- Iterate on sheets instead of mapping all the lines
Purpose
=======
Employee must match on sheet and lines
Since the employee_id field of hr.expense.sheet is modifiable in submit state, there is a possibility to modify a sheet in such a way that the employee does not match on the expense sheet and expense lines. This commit fixes this.
When no input line is found in get_payslip_lines, the input line with
amount_python_compute = 'result = inputs.ARS.amount', the function __getattr__
on BrowsableObject returns 0.0 for ARS and raises an error for amount because
a float has no attribute amount.
Inspired from 9a6e7799fe
opw:785033
- Added taxes for year 2018 of sales and purchase with percentage 3.7 and 7.7
- Added tags to show newly added tax in VAT report(enterprise branch) for Switzerland
Was PR #20851. Was task 39082.
Summernote uses `document.execCommand` to apply most styles when
editing, leveraging the implementation to the browser.
Summernote is configured to use HTML styling (`'styleWithSpan': false`),
and in this case, browsers such as Firefox use HTML attributes for
styling text align, while Chrome still uses CSS for that. In fact,
`document.execCommand` is browser-inconsistent... but so is the
`styleWithSpan` option. Indeed, setting the option to `true` will make
Firefox use CSS property for alignment too... but not Internet Explorer.
So we might consider changing this option's value but this would not
solve the current problem.
Indeed, any CSS `text-align` style in Firefox takes precedence above
the element's `align` attribute, so when users were trying to align text
on stuff that was pre-aligned, they were unable to do so.
We can better explain the situation with this example:
A user tries to left-align in Firefox a `p.text-center` element, and
produces this:
```html
<p class="text-center" align="left"/>
```
(`align` attribute is ignored because of the `text-center` class)
On Chrome, this would be produced with the same steps:
```html
<p class="text-center" style="text-align:left"/>
```
With this patch, we actually make that HTML look like expected by the
user, no matter the browser he's using, by forcing the editor to use
the text-align CSS property. Note that the implementation is quite
ugly but had to take care of compatibility.
See https://github.com/odoo/odoo/pull/20900
(thanks to @Yajo for original PR)