The onchange handler is doing a weak comparison between the values received from
the onchange() method and the current field value, which leads to a falsy value
such as "0000" being treated as equal to False.
This patches changes the operator to enforce non-coercive equality.
Fixes#6405
Ensure correct sequence of bank statement action views.
As the views are sorted based on the sequence, make sure the tree is selected
before the form view.
Fixes#6413
The previous filters didn't take timezones into account, and
returned stringified naive datetime values in local browser
time. Those would then be interpreted by the server-side as
UTC date, and depending on the current timezone offset vs UTC,
yield partially incorrect results.
By returning directly a datetime.datetime object instead of
a stringified version (see previous commit 76881fb),
we can get the expected result regarless of the timezone.
Fixes#2972Closes#6229
opw-621282
This fix adds the toJSON() method to datetime.datetime,
so domain expressions can use datetime values directly,
without having to compute the stringified version
with convoluted strftime() and timezone calculations.
The datetime results are sent down to the JSON-RPC
level where the JSON.stringify() serialization will
convert them to UTC string, to be deserialized
properly as UTC datetime values on the server side.
Thanks to this we can use the browser's local midnight
timestamp in a filter expression, for example like this:
`datetime.datetime.combine(context_today(), datetime.time(0,0,0))`
and get the expected result regardless of the user/browser's
timezone.
related to issue #2972 and pull request #2914 and #6229
(Next commit will fix them)
opw-621282
Correctly creates menu and add implied groups.
Since the conversion from res.portal to res.group, we lost the field
parent_menu_id so a search is needed to find parent menu.
To add the access of existing users to the new groups, implied id rules are
needed. opw 612594
When automatically generating invoices, contract should browse the fiscal position by calling
the function get_fiscal_position of the account.fiscal.position class instead of checking the
property field on the partner
Previously, there was an exception when exporting unordinary table (e.g:
reports) coming from the export of the xml_id.
With this change, if the table is not ordinary, the xml_id is not
present in the exported file.
closes#6428
issue #6336
opw-633066
Fix stock warehouse column on purchase report,
we need to join stock_picking_type and stock_warehouse
in order to have the warehouse itself
Closes#6409
Double list comprehension is a nice try but does not work in python.
prod_ids was a list containing only the first variant, so getting the
product-specific pricelists only for the first variant of the first template.
Fixes#2900
When opening the list of meetings from an opportunity, show only the meetings
linked to the current opportunity.
Use search_default_ to be able to remove the filter if not needed.
Remove context on meeting button as it's ignored in action_makeMeeting (and
there is no field attendee_id linked to a crm.lead anyway)
opw 614039
When canceling a bank.statement.line of a bank.statement
ready to be closed
(all lines reconciled,
reconcile button hidden and close button visible)
The form wasn't reloaded, and the reconcile button
was not displayed after having cancel the statement line
opw-632063
When a many2one field of a searchview was selected
by default, through a default_*_id within the context,
the many2one value name wasn't translated.
e.g. with Spanish loaded (and l10n_multilang installed),
translate a project.project name in Spanish.
Then, while being in Spanish, in the project.project kanban,
click on the Tasks link of a project (tareas),
then, notice the value of the project name in the
search bar.
opw-632818
If a product as only one variant, using the product.product or the
product.template in the pricelist configuration should have the same effect.
This is particulary important for the ecommerce where template without variants
do not show the product. Having a pricelist for that product had no effect on
the price used in the e-commerce.
Fixes#2900, opw 615153
Currently (since commit e6a2d222d6), the domain of a search view field tag
is dropped.
This previous change was done since some of these domains refers to a
field not available in the javascript.
This fix drop the domain only if it can't be evaluated in the javascript
side.
opw-632030
Prior to this fix, when you clicked on Publish or Not Published, the
effect was immediate, but the button disappeared instead of just
updating itself to the new value.
Fixes opw 614561.
Before this commit, it was only visible by the admin user.
I used the crm.phonecall.report rules as an example, but I don't
think either of those or the opportunities ones are actually
used in the case of group_sale_salesman, because the submenu
Sales of the Reporting menu is only visible to the Sale Manager.
Fixes opw 615048.
If there is not a dedicated salesteam for the current user, this fix sets the
sales team to the one dedicated to a customer if there is one.
opw-633134
As event_obj._length doesn't return the number of days when the selection spans
multiple weeks, the test was wrong when the selection ended on the first day of
a subsequent week.
This fix was originaly written by rha-odoo at 95d344b, but I rewrote it a little.
I would have liked a cleaner way of finding how many days there were between the
two dates, but I couldn't find anything better, considering I didn't want to
create new objects just for that test.
Fixes opw 614703.
During the creation of an invoice, the partner returned by "_get_master_data" depends on inv_type.
inv_type = "out_invoice" is for customer invoice
inv_type = "in_invoice" is for supplier invoice
opw:632392, 632583
If a onchange is set on a binary field, the name of the file (filename attribute
defined in the view) is still the name of the previous file.
Fixes#2427, opw 617109
When setting a value to a field binary, a char field can be set as 'filename'
that needs to be recomputed to specify the new file name.
Before new api, the _internal_set_value method would trigger a onchange but it's
no longer the case now (so onchange on filename field was no longer executed).
Instead, manually set the value using set_value method which do trigger the
onchange.
Fixes#2427, opw 617109
The action_confirm function losses the context when called by a workflow.
To have the right translation, the lang of the user must be written in the context.
opw:632873
When opening a task through a modal, like
when opening the task field of an issue while
being in edit mode, the priority stars
had not the same design than in the
regular task form.
opw-633426
Prior to this, even if your suggested or optional products were variants,
only the name of the template was shown.
Fixed GitHub issue 2746 and opw 614776
By default, the point of sale awlways uses the rounding method per line.
But the accounting configuration allows to use the globally rounding method,
this is why the point of sale must consider this configuration.
Inspired from the compute_all of account.tax model within
addons/account/account.py.
opw:632537
The outgoing server of a mail template is not used when sending a mail.
This fix propagates the mail server the same way it's done for auto_delete.
opw-633005
Partial backport of 4d912af without the group by partner part. Do not forward
port above saas-6.
The generation of invoices from analytic lines was messy and mixed the
description of lines (e.g. redundant message when same product is invoiced twice
with different user, see opw 633047). Grouping was not consistent.
In 4d912af, grouping by partner was added with a refactoring of the grouping
method. Backport the second part only to get cleaner grouping and avoid mixing
messages.
The box "Tax on children" was ignored in the pos, leading to 100% taxes for these
taxes (as amount is 1.0 on these taxes).
Add child tax fields when loading the pos to be able to correctly compute
recusively the tax amount on children.
Courtesy of Jean-Nicolas Brunet
Fixes#1515, lp:1231574, opw 622143
On a sale order for a customer A where the invoice address is the address of the customer B,
the payment term, the receivable account and the fiscal position must be set from customer B
which is the partner invoice.
opw:630962
When doing a manual reconciliation, the current filter could restrict the
visibility of move lines and show empty results for some partners (e.g. filter
the lists on only one partner will show empty list of moves for other partners).
This is also the case for multicompany restrictions.
Integrate the current filter to the search to only get results for displayed
lines.
Fixes#3817, opw 618134
Fixes#5221, opw 632095
The name field contains the refund reason.
The reason is filled when you create the refund
from the refund wizard available when
pressing "Ask Refund" on a supplier invoice.
As this field wasn't visibile on the supplier
invoice form, this wasn't possible to change
the reason on draft supplier refunds after
having created them through the wizard, while
you could change your mind or having done a
silly mistake in the wizard, that you could
edit since the invoice is stil draft.
This was also not possible to set a reason
when creating the refunds without going through
by the wizard.
This was also not possible to change the reason
when you duplicated your supplier refunds.
opw-632756
closes#6301
When converting a lead to an opportunity, there is a difference in
context than when going to an opportunity via the interface.
This leads to a difference when displaying a kanban view.
This commit adds what is needed in the context.
opw-632640
Taxes can be applied on the repair fees.
The field was defined in the model, it was just missing
in the view.
In addition, the product_id_change worked already for the
taxes.
opw-632898
When creating a chained picking, the first move has no sequence, this is because
there is no sequence for stock.picking.internal.
Set the sequence before the chained move so that the sequences are in the right
order. opw 621261
Fiscal year is created when a chart of account is installed on the company.
If no chart of account is installed, setting dates will have no effect in the
accounting configuration wizard.
Fixes#3547
When the session is closed, the date used is the date of the session start instead of the
system date. This is necessary when the server is not on the same timezone than the user,
opw: 631497
Reasons:
- the currency conversion is done assuming that the cost price currency is the company currency
- we support only one price type per field. Defining several price types on the same field using
different price types is not supported.
Create a new stylesheet for IE9 and less custom css.
The issue #6198 and #6201 is present in IE9 since a div with height 100% inside
a table-cell (i.e: td tag) element only take the minimum height possible for the
content.
For issue #6198: in IE9 a kanban tile could not be moved to an empty kanban,
this fix sets a minimum height for a empty column (80px, the size of two empty
tiles) so now a tile can be moved in the 80px in the top of the column.
For issue #6201: graphs took the minimum height in IE9, this fix set a fixed
height to improve the situation.
For issue #6200: in IE9, the list view could wrongly not go the next line
even if its width is 100%. For the given case, the display CSS property of
these listview is set to value "block".
opw-632415 opw-632417 opw-632416
Before this rev.,
if you had two child categories with the same name, e.g.:
- Chocolates / Orange
- Fruits / Orange
In the product list, searching for category "Fruits / Orange"
also returned the products from category "Chocolates / Orange",
because it fetched all products which had "Orange" in the category.
This rev. corrects this (in the above example, it returns
only products from category "Fruits / Orange".
The code is particularly complex. A proper solution would be
to store the complete name field (but this cannot be done in
stable releases, such as 8.0).
Besides, it handles the fact a product category child can have
' / ' directly in its name (it's not only the category tree separator).
e.g., you could have a category name called 'Fruits / Orange' directly
not only in the complete name.
opw-628793
product_taxes_rel is the many2many table between
product.template and account.tax
product_id on the POS order line is a product.product.
Therefore, the join on product_taxes_rel should
be done using the product.template id of
the product on the pos order line, and
not directly the product.product id.
opw-632720
VAT error shouldn't be displayed as it doesn't look deep enough for information.
It is better to raise this kind of exception at the creation of a VAT than at its use.
opw:631769
Backport of 8.0 code, rev f61339b
Create a new journal item with an tax included, the automatically created tax
line had the amount computed as tax excluded.
Fixes#3731, opw 618305
When changing the fiscal position of a sale.order, the taxes are recomputed
which means that total amounts may no longer be correct (need to press 'update'
button).
Reset the amount_* fields to force the recomputation at write.
Fixes lp:712772, opw 618419
Each time a product is added in the cart, the qty of this product must be checked to
adjust the price if there is a rule (with min qty) in the partner's pricelist.
opw:630049
The `find` method will get the current accounting periode according to the
user's timezone while time do not. This means that it is possible that users
get a move with a date belongign to a different period that the one returned by
`find`.
Fixing b101808, linked to #4147, courtesy of Graeme Gellatly
contracts_count function field
&
journal_item_count function field
used for the "contracts" and "journal items" buttons
in the partner view are computed by the same
method.
But, this is possible that you have access to
one without having access to the other.
e.g., Project users not being salesman nor accountant
must have access to the contract counts,
but not to the journal items.
Besides, these buttons are added to the partner form
by two separated views, applied to analytic accounting group
& accountant group, respectively.
We therefore avoid to compute the journal items count when
not needed, when not loaded in the partner view.
We therefore prevent the access right issue, and provide
a performance improvment at the same time. Yay.
opw-632454
This module brands a view adding fields on the partner
form, after the field 'last_reconciliation_date'.
This field is added by the view
account.view_partner_property_form,
not by the view
base.view_partner_form
So, if the user do not have access to the view
account.view_partner_property_form, then
the field last_reconciliation_date wasn't in the view
and the inheriting view could be applied.
This inheritance worked only because
account.view_partner_property_form,
had no group applied, and the sequence
was lower.
opw-632454
- Support negative costs by creating reverse valuation move,
and undoing the quant computation.
This may or may not produce the exact reverse effect on
the quant, as it depends on the rounding of the unit
cost, which uses decimal precision 'Account'
- Hide 'compute' button when cost is not draft
- Forbid cancel of posted cost
- Forbid deletion of cost if not draft
If the default language of the visitor is not the default
language of the website
(If the default website lang is en_US, and the visitor
browser is configured in nl_NL, the default language
visitor will be nl_NL),
the go to cart button in the option modal was no
longer working.
This is related to revision a696913364
opw-632490
When generating the accounting entries, to compute the name, the invoice
reference (e.g. origin purchase order name) was first used before the supplier
invoice number. To facilate reconciliation of bank statements, the supplier
invoice number makes more sense.
Fixes#3839, opw 618765
The context wasn't defined in the below methods:
- action_production_end
- action_in_production
while it is defined in the base methods, in the mrp module.
This doesn't lead to any issue in standard
modules, but it prevents to correctly
override these methods within custom modules
when mrp_operations is installed.
opw-632425
Changing the unit does not modify past entries generated (too dangerous) however
this was not clear of the effect of the field.
A better fix (for master) would be to add a unit field. opw 618804
When the margin is calculated, the purchase price is calculated using the currency of the price
type 'standard_price' instead of the currency of the company, since they can be different.
opw: 631884
The state 'Quotation Sent' was not visible on the sales analysis report (e.g.
group by Status). Add the missing state to the report to correctly disaply it.
opw 619748
Detect most of bots/crawlers to avoid auto redirect. Most bots fetch
with lang en_US, so even if default website lang was not in en_US,
googlebot was redirected to en_US page.
Now we keep also the language selected by user into a cookie.
If cookie exists but lang not in url, we redirect the user into
his preferred language.
Manage special case to allow to change the lang in url to set the
default lang at fly in url and set the cookie...
Many routes are not specified as multilang=False but should be.
With the auto redirection, we need to update these routes to avoid
useless redirects !
The accounting entries generated (during confirmation of moves on real time
products) were based on the move date. This is correct but the creation of the
entries (from quants_move) is done before the change of state of the move
(which set the date of the move to now).
Instead of using the date of move that is changed a few steps laters, use
directly the current date for account move date.
Fixes#4147, opw 619902
Check that url is setted before to use it (avoid traceback with startwith).
Field is not required because website.menu are using to create tree/sub menu
Change the behavior of new_window.
Use _blank and not blank... for links.
Blank has no sense in this context.
The page has a note saying this page can be disabled but has no option to do so.
Adding one in the customize menu.
Hide the technical informations to the non-technical users, keeping only
the list of applications (not modules) for public users.
Fixes#3546
In IE9 there is a "dy" attribute of tspan svg elements which may be wrongly not
set to 0. These elements may then be lower than they should (and thus may
eventually not be seen at all if they are outside of the svg view area).
This fix adds IE9 in the range of browsers to which the "dy" must be set to 0.
This issue don't happen in the last official release (http://www.justgage.com/)
thanks to either a fix since RaphaelJS 2.0.2 or an update in justgage.
When opening entries are generated, the reconcile_id field is updated in SQL
(probably for performances reasons) but the computed and stored field
reconcile_ref is not recomputed by the ORM.
Force the recomputation of the field by calling ORM method _store_set_values.
Fixes#4267, opw 620369
In IE9 the title of a folded column is rotated two times. The writing mode
"tb-rl" already rotate the bloc then the "-ms-transform:rotate(90d)" rotates it
a second time.
This fix set the writing mode to the initial IE9 value (with a CSS hack so
it doesn't impact other browser).
Access rights on messages are derived from the
access rights on the documents they are attached
to. Due to the karma-based nature of the forum
access rights, these do not automatically reflect
on messages, because they are not implemented as
access rules.
The check_mail_message_access() needs to be
overriden to achieve the same effect.
+ allow calling super().check_mail_message_access()
from new API (useful in forward-port)
On internet explorer 6, 7, 8 and 9, the limit of CSS rules in a stylesheet is
4095 (http://blogs.msdn.com/b/ieinternals/archive/2011/05/14/10164546.aspx).
This commit breaks down a CSS bundle in several pages for these IE versions.
To do this, the CSS tag added is of the kind : /web/css.0/{xmlid}/{version} in
which there is:
- the whole CSS if there is no more than one page,
- a list of @import pointing to the multiple pages.
note: if a modification lowers the number of page, an old page may stay in
ir_attachment (e.g: go from 4 to 3 pages, the old 4th page of another version
will not be deleted untill the number goes again up to 4).
Note: the method css(self) previously returned an unicode variable (the first
time) or an str variable (the following times, if already cached), the fix
also correct this so an str variable is always returned.
fixes#5050
opw-627116
In the function start_end_date_for_period, in the "else" clause, the case considered for the period
is "once". In this case, start_date and end_date are either False or in string format.
opw: 631941
Do not check float_is_zero for float fields with
digits specifically set to 0, it means
the rounding precision is infintie for those ones,
and tmp === val is enough.
When printing the general ledger with "With Currency"
checked, two currencies were displayed in the colum
"Currency" when an amount was set, one time the company
currency, one time the move line currency. Only
the move line currency should be displayed.
Besides, the total of currencies amount
for each account should not display the currency symbol
at all, as the total may be composed of multiple currencies.
opw-632086
This rev. is related to 489a96c257
It wasn't possible anymore to perform an import of
a product.template field in a model
(e.g. mrp.bom), while it should be the case.
In the context of an import,
the operator of the name_search is '='.
Therefore, in this super call, the operator was '='
and the name was '' (empty).
In such a case, ('name', '=', '') is added
to the search domain by the base name_search method
(in models.py),
leading to the domain
[('id', 'in', template_ids), ('name', '=', '')]
which will lead to no results.
Forcing 'ilike' as domain is correct, as the actual
name_search, with the correct operator,
has already been performed in the lines above, the
point of this second name_search is to get
the right order along with the right name_get.
opw-632089
When clicking on the Transfer button on a picking the packoperations should
always be recomputed.
If the pack operations are only computed the first time, the picking could be
modified (e.g. notice wrong quantity) and still display previous operations when
reloard the transfer button. opw 620636
When creating a pickign from a purchase order, do not use the schedule date
('date_planned') to specify the creation date ('date') of a picking.
There is already field called Scheduled Date ('min_date') and Max Expected Date
('max_date') that can display this information, this is redundand.
Fixes#4352
Measures added to the Task Analysis report were not kept when saving the filter.
This is due to the lack of 'col' type field in the view definition (the parser
in 8.0 needs at least one).
This does not need to be forward ported (no bug in next version) but it's anyway
a good idea to filter by user by default.
Fixes#2835, opw 621468
Relax the constraint on BoM to allow to have two different lines with the same
product. As the error message says, the purpose of the constraint was to forbid
having the manufactured product as one of the components but had this side
effect.
Such scenario of the same product twice makes sense when using the date
attributes on the lines (e.g. changing quantities)
opw 621468
1) Activate pricelist + multi currency - Main currency is EUR
2) Create a pricelist in USD (named "test"), no specific rule is applied.
3) Go to website < shop < select a product < buy it.
4) On the page /shop/cart go to customize and make sure "coupon code" is ticked
5) Enter "test" in the coupon code field
--> The prices are changed according to the exchange rate of the currency of the pricelist.
This is not correct: the coupon should only affect the amount according to the discount,
not convert the amount in the currency of the pricelist. In the specific example, the price
displayed should not be affected.
opw: 630670
The time zone was not applied for
the day name, day number and month name in
event invitation emails.
So, if the starting time of the event
was close to the previous/next day
(e.g starting date at 04/09/2015 00:30 in UTC+1)
The day number/name was set to the previous day
(e.g. Wednesday 8th instead of Thursday 9th).
opw-630165
Previously, when updating subscribers of a mail.thread, the default_{key}
arguments could override a {key} in the values.
e.g: for an new opportunity, the salesperson was overrided by the default user_id
This fix gives the priority to the values over the default_ in context.
opw-631741
In the partner ledger wizard, you can check
a boolean to display the amount within the
currency the amount has been invoiced.
This feature was simply no more working
in Odoo 8.0.
opw-630268
The number of sale order on a partner form view only counted the given customer
and not the ones of eventuals child_ids. Hence when clicking on the widget, the
result sale order tree view (which take account of child_ids sale order) is
inconsistent.
This fix adds the sale order of a child company to the sale_order_count.
opw-630249
This rev. is related to rev. 89093a2
If several account analytic lines where defined for a same date
within a same sheet, the report totals were multiplied by
the number of occurences of lines of the same day.
Before the above rev., only `Diff`, `Total`, `Timesheet`, were wrong
After, other totals were wrong as well.
The point of the above rev. was to gain a real performance improvment
when there was a lot of timesheets / analytic lines entered
in database. This rev. keeps this performance improvment.
opw-629857
When going to logged calls through opportunities,
and no logged calls were listed,
the mail alias of opportunities was displayed
within the placeholder help message,
wrongly, as we were in the logged calls list.
This was due to a context propagation, due
to have defined empty_list_help_* keys within
window actions. It was the case in several
modules.
Besides, we do not find the usefulness of the
custom_context passed to the get_empty_list_help
method: indeed, none of the methods get_empty_list_help
overriden in modules need any other keys than
'default_type', which do not require an evaluated
context.
We therefore remove the whole code regarding this
custom_context, and we therefore get rid of this
useless context evaluation thing within one of
the most accessed method of the web client.
opw-630673
Actions button on the work order lines can change the state of the manufacturing
order. As for the product lines, reload the form after actions.
opw 625424
When an mail alias for catchall domain was assigned, some checks were not done
and a empty list help was wrongly displayed. Thus two arrays and some inconsistent
messages were displayed.
This commit correct this behavior so only one arrow is displayed.
Another part of the issue, was an erroneous propagation of context which should
be solved by a futur commit.
opw-630673
The report generated by this wizard considered all the partners without taking into account
the filters and target entries set.
To show the right partner the function _set_context
must consider the "self.query" which sets the period, the dates, the states, the accounts and
the journals of the sql query used to give the demanded partner.
opw:631649
The working time unit can either be hours or days. In case of days, should
replace the references to hours in the view to days. In case of days, use float
field instead of float_time.
Using the string 'Hours' as a way to determine the unit is too weak as:
1. it does not work in other language than english
2. if the unit is renamed (*cough* 1626eca *cough*), it will fail as well
Using the object with context to compare strings in the user language.
lp:1080191, opw 595397
When setting a task as done, the state is done and the progress written to 100%.
If this task is reopened, the progress was not resetted as the stage is changed
but not the state (still done).
Partially backport behaviour of 8.0 (8fbfc997) by using the fold attribute
instead of the state to reset the progress.
opw 597688
If a customer changed of company while having
account.move.line records in the former company he was in
It wasn't possible for someone else than the admin
to print the partner ledger report including this partner.
opw-631800
In the form view of a unit of measure,
if the unit of measure was of type
"Bigger than the reference unit"
The help in the tooltip of the ratio field was wrong
Besides, this help message was contradictory
with the formula written just below the field.
opw-631672
This wasn't anymore possible to open the Lead/opp
form of a planned call if it was of type opp.
Regression introduced during rev. 81f56c9eda
opw-631807
On an invoice, tax lines are generated in tax_line field. When modifying
manually the tax amount, the recomputed tax_amount field was incorrect in
multicurrency environment, leading to an entry with different tax amount and
debit value.
opw 611474
Apparently, browsers decide how they want to style readonly inputs,
and it seems like Firefox is greying them out while Chrome doesn't.
We use an opacity: 0.5 rule to grey them out ourselves in Chrome,
but in Firefox they are not dark enough to read easily because of
the double greying. I checked with the designers but they don't
have any better fix for that.
When writing a message via the chatter with a template being in auto_delete
False, the notifications emails are always in auto_delete True.
This fix propagate the auto_delete option of a mail.template to these
notifications emails.
opw-630010
If a purchase order is created with free goods (e.g. 5 units offered if 100 are purchased),
the price_unit of stock.move and the cost of stock.quant were set to the product cost price
instead of zero. This would lead to inconsistencies in the 'Current Inventory Valuation'.
opw: 630593
Commit 540b753bf8 introduced
support for resources stored as ir.attachment records in
asset bundles too.
This is specifically useful for customizations.
However the HTTP route for reaching those resources
when they are *not* in a bundle was originally created
in the `website` module (as a special handling for
404 requests)
This means that these dynamic resources would only
be partially supported when `website` is not installed,
causing various problems:
- missing resources in debug mode where bundles are skipped
- errors when trying to define new client-side Qweb templates
via XML resources - which are loaded with a direct request
- ...
This commit moves back the supporting code to the web module.
The `mimetype` column is not present in ir.attachment without
the `website` module, but sniffing it based on the attachment
name works fine at serving time too.
Closes#6002
When showing a kanban, there is differences between dataset of types:
* DataSetStatic: self.view.dataset===self.dataset, their ids attributes are the entire ids list,
* DataSet and DataSetSearch: self.view.dataset.ids are the already in the view ids, self.dataset.ids are the last gotten ids.
Hence with DataSetStatic dataset, when self.view.dataset.ids.splice(0) is done
self.dataset.ids is also emptied. And in the read_slice function, the slice is
done on that (now empty) array.
This fix removes the splicing of this ids array (which doesn't change a thing
since the array is overwritten latter), a _.difference is used to remove
eventual duplicates since in the DataSetStatic case, the same array is being
concatenated to itself
opw-630654 opw-617090 opw-619563
The implementation of `ormcache` does not work on methods that take a `context`
parameter. Because of the decorator `decorator`, the arguments of the call are
passed positionally to the method `ormcache.lookup`, and positional arguments
are used in the cache key.
The fix consists in removing the `context` parameter from the faulty methods,
either directly, or by caching a private method called by the public method.
"Invoiced" stat button on the res.partner form view must not include cancelled and draft invoices.
The button triggered an action which shows a tree view with invoices where:
type in ['out_invoice'] and all states.
Now the button triggers a tree view with invoices where: type in ['out_invoice' , 'out_refund']
and state not in ['draft', 'cancel'].
opw:472318
If you try to import a file with a header 'Parent_id/id'
_match_header will not match Parent_id with parent_id
because it was comparing with case sensitive.
It's not a bug, but in most cases this new behaviour (non
sensitive case search) is what the end user was expected.
Hate Excel and the auto correct capitalization !
In BOM, when performing an advanced search
on "BOM Lines" contains "a name"
all lines were returned, whatever the lines content.
This was due to the simple fact no field 'name'
was set on the mrp.bom.line model.
We set "product_id" as _rec_name, it seems the more
logical choice.
opw-631335
On a line write in a account.move.line tree view, the on_write return all the
sibling move lines of the written move line. The lines are then displayed even
if they do not match the current search domain.
This fix adds the context on the given on_write callback request, and in
on_create_write use a on_write_domain in this context to filter the returned ids.
fixes#3161, closes#5727
opw-630093
In the ecommerce, when adding a product to the cart
while having website_sale_options installed
the product was added in the cart within the
website default language, not in the current
language of the visitor. The description of the product
was in the default website language (for instance, English)
instead of being in the visitor language (for instance, French).
The reason is quite simple: With website_sale_options, routes
are called in javascript, and these calls do not include the
website language within the url to the route
(e.g., call to '/shop/modal' instead of '/fr_FR/shop/modal)
and the language in the request context is therefore
the website default language.
The solution proposed here is probably not the cleanest possible,
a cleaner solution would be to define a new utility
JS function within website javascript to perform
Ajax calls, automatically adding the language to the url path
according to the current visitor language.
Another solution would be to set the lang of the session context
to the visitor language, and to use this lang instead of the
lang within request.context.
Nevertheless, none of the two above solutions can be performed in
stable releases, such as 8.0, to avoid any risks.
opw-631400
Skip the creation of the corrective valuation entry
when a negative quant is reconciled with an incoming
shipment, when:
- the cost has not changed, so the journal entry would
be useless (credit/debit = 0)
- or, when the accounting period for the move causing
the negative quant is already closed, and must not be
updated (presumably the valuation was manually
set before closing that period)
After commit 0ed63d73a6,
the hack used to detect fields.function is not supported
anymore. Using `isinstance` is safer and cleaner anyway
(performance is not a concern here).
When switching an applicant to another stage,
there is the possibility to send an email template,
according to the given stage.
The attachments defined in the email templates should
be sent as well.
opw-630768
When auto subscribing to a message
(For instance, change the ```user_id``` field on a record,
like an invoice)
The new user is notified of the last message of the thread.
He must be notified of the parent message as well,
to have access to the first message of the thread,
to prevent access rights issues to the thread.
This mechanism is applied in the _notify method
of model ```mail.message``` as well, for the same reasons.
opw-630286
The timezone of hr_analytic_sheet should be the timezone
of the employee as well, so sheet analytic lines and attendances
lines are grouped within the same timezone, the timezone
of the employees, so the time difference between the analytic
lines and the attendances lines can be properly computed.
Fixes#5809Fixes#5379
Related to rev. 3bf1615ad4
The computed value of parameter digits is no longer stored into fields and
columns; instead the value is recomputed everytime it is needed. Note that
performance is not an issue, since the method `get_precision` of model
'decimal.precision' is cached by the orm. This simplifies the management of
digits on fields and saves about 300Kb per registry.
QWeb templates can be translated, javascript code
included. Nothing prevents you to translate
the javascript reserved word "undefined", for instance.
Preventing the livechat JS snippet to be translated
prevent translations mistakes, like translate
```undefined``` by ```Niet gedefinieerd```
opw-630335
The BBA communication is now only checked when provided as input
(created or modified).
Avoids useless check for uniqueness when it's not modified, and
prevent errors when several invoices are modified in batch.
opw: 629649
Closes#5700
The same holds for the inverse history_ids relationship. When an object is copied,
the many2many fields their links are copied.
When we copy a done move as is done in the return wizard to create the reverse, it copied also
the relationship with the quants. This is problematic as this field indicates the quants that
were transferred by the move and the new move will think it will have returned all the quants
even before it is done.
In the accounting settings, we prevent having gain and loss accounts that are linked to a
different company than the one selected for the chart of account.
opw: 630494
Currently, the view_form search_count doesn't propagate the context, so when
searching on a translated field, the count can be different than the one we
would expect and get with a search in a current language different than en_US.
opw-628792 opw-630212 closes#5825
`product_qty` field is not recomputed at record creation.
Force field recomputation at any change
Removing the trigger on `product.product` should not be a problem as
product uom can't be changed once there are move lines.
opw:629650
The sequence for new items in some models is simply set to a constant 10.
Hence if 3 items had after reordering sequences 10, 11 and 12. If a new item is
added, it would get after saving at the second position.
This fix set the sequence of a new item to the maximum+1 or minimum-1 sequence
of current items sequences (max if tree has editable="bottom", min if tree has
editable="top").
opw-627830
This temporary patch was used to simulate the presence of a
`display_name` field in all models. It is not needed anymore
as of version 8.0, which comes with the actual magic to make
`display_name` work everywhere.
Improve commit bf31ab6718a8b9c8afdd29120e5056533b0a2ade:
- do not use the product.product name_search() when there is no
search term (it's only useful with a search term
- do not use the product.product name_search() when the extra
domain (args) has a criterion on IDs - these will be *template*
ids, not *variant* ids, so the results would be wrong
- Since templates and variants use a different natural `_order`,
perform an extra name_search() on templates after gathering the
ids to return, to apply the proper sort ordering. Increases the
penalty by doing 2 name_search() calls.
This issue could be seen e.g. in the breadcrumbs where the
display_name variable is displayed for templates, and indirectly
relies on name_search() due to an old hack in call_kw in order to
implement the "future_display_name".
a6eac0f08e introduced a new `res.groups`
belonging to the "Sharing" category.
As this group has the flag `shared`, it is ignore when generating the
group's user view (and its virtual fields).
When updating `mail` module, the `share` module (which depend on mail)
is not loaded yet. This mean this new group is taken into account when
getting the `res.users` virtual fields.
As this group belong to the same category as the `share.group_share_user`
group but dont have an inheritance link between them (`implied_ids`),
they are generated as `boolean` instead of a single entry `selection`
field. This create a missmatch between the fields and the previously
generated view, which forbid inheritance application.
Force view regeneration, to avoid it.
Also change the group's category as this group is purely technical and
must be hidden anyway.
When the theoretical_qty of the stock is calculated, we should only consider the location itself, not its children.
That way you can have correct inventory for e.g. iPads that are both in Stock and Stock/Shelf 1
During the creation of a Sale Order containing a product for which 'Make To Order' is activated
in the Procurements, two procurements are created:
- one for 'Partner Locations/Customers' location
- one for 'WH/Stock' location
If the Sale Order if cancelled, the user must first cancel the picking (delivery order).
This will trigger the cancellation of the procurement with the 'Partner Locations/Customers'
location.
The new behavior is to cancel the procurements linked to the Sale Order, which will trigger
the cancellation of the picking.
opw: 630170
issue: https://github.com/odoo/odoo/issues/3805
If "Group Journal Items" option is checked, the generated accounting entries may get an invalid tax amout.
This will happen when several entries for the same product do not use the same tax amout (e.g. discount).
Avoid grouping products with different taxes under the same line by creating one line per tax_code_id.
opw 626695
The result of the residual amount of an asset is : asset.purchase_value - amount - asset.salvage_value
where purchase_value and asset.salvage_value are in the currency of the asset. Amount is the difference
between debit and credit of an account move line expressed in the currency of the company.
This is why the amount must be convert in the currency of the asset.
Since commit 0167acb, the template used in translate_doc are added to the list
of template when we are editing a report with the html editor.
It's nice, but we don't have all the dependicies from this one.
Now we recompute the list of template, to have all the related templates:
the external_layer* and all templates which overload this report.
It is possible, if the user created a new country by himself, to have a country without a code, we then need to check that.
Fixes opw 629891, where the customer wrote "Belgie" trying to find "België", didn't find it and created a new "Belgie" country without code.
The inventory should work with packs. If a pack is not indicated
in the inventory line, it means we correct the quantity for the product
that is not in a pack.
Also, when the lot is False, it should not behave as normal stock moves.
It should correct for the quantity that has no lot.
We try to reconcile the negative quants in the pack also.
Only when the picking is partially available, the system will only show the amount of products available.
That way, when working with paper, the warehouse operator will only get what is available. This is the case
where we did not launch the bar code interface or the transfer wizard.
It is very cumbersome to define routes which have 2 step in on production for certain products with
procurement rules (e.g. Stock > Raw Materials Location > Production), when the
products are MTS elsewhere. That is why we add the possibility, which might be elaborated in the future,
to define rules e.g. from Stock > Production, which you can put on the product / product categories. These
rules will only define the procure_method for now.
The domain on the partner field in the bank statement lines
was too restrictive: You should be able to select partners
that aren't either customer or suppliers. For instance, your
employees.
opw-630017
This patch removes the asynchronous code that was
still used to open the autocompletion drawer.
Even with the setTimeout delay forced to 0, the
asynchronous handling meant the final ENTER
keyUp event could be processed before the opening
of the autocompletion drawer related to the last
key pressed. This would trigger the search with
the search string of the previous autocompletion
popup, missing the last few keys.
Also handle ENTER at keyDown, because in some
rare cases a barcode scanner may emit only
the keyDown event for ENTER, without the
corresponding keyUp, causing a merge of two
successive scanned barcodes.
Based on many tests conducted with different
barcode scanners, the only thing that
is guaranteed is the correct order of the keyPress
events for all regular characters, and the
fact that the ENTER keyDown and/or keyUp will
always be sent after them.
All other events can be mixed or simply missing
if you make a rapid succession of scans, especially
if done with a long series of barcodes.
Scanners tested (with 1ms data transmission delay):
- Honeywell Eclipse MS5145
- Dacomex Slim 50mm CCD scanner