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
ORM will show lines in production.move_lines even if done (which the domain should avoid)
when processing the production (as they are probably still in cache). We explicitly skip those lines.
When producing more with lots in consumed and produced, we added the consumed_for link as
the lot tracking requires to have this link between the consumed and produced moves.
The extra move of the produced goods should also be confirmed and not created as confirmed immediately.
That way it can still apply the push rules. (Gabriel Demmerle)
The test for account followup use UTC time, but the default `date_maturity`
and `date_due` of an account invoice come from fields.Date.context_today`.
One failing test for project_timesheet also used `today` instead of
`context_today`.
So depending on the test user timezone, an error of one day (if UTC time
and user time are on different day) occured which failed the tests.
For example:
* user has GMT+1 timezone, test fails 0:00am–1:00am (11:00pm-0:00am in UTC)
* user has GMT+3 timezone, test fails 0:00am–3:00am (9:00pm-0:00am in UTC)
This fix removes UTC use in the tests.
when a customer invoice is created directly,
if a product variant is selected,
it now computes the price from the product variant and
not from the product template.
opw: 629285
After discussing with jco, we decided to keep it simple and have a coherent behavior between different versions, we then changed the behavior from the one of jbefficient PR at 92adf673f7.
The menu was not present in 8.0 when going back from the mass mailing email
composer to the backend. This fix adds the current action id as a return_action
query string parameter and return to the correct action.
fixes#5591
opw-629526
When a message had no author (this is accepted),
a recipient without full_name, name and email address
was added to the suggested recipients of the thread,
leading to a "(no email address)" within the suggested recipients,
which is not really useful.
opw-629797
This patch hopefully solves an annoying issue with the search view:
when the user types really fast (or uses a barcode scanner for example),
the resulting search string was (sometimes) missing the last few
characters. I'm unclear on the exact reason why it happens. From the
code, I can only guess that it happens because the scanner use a TAB
key instead of ENTER (TAB is handled in keydown event, ENTER in keyup),
or that the key events aren't in a correct order (if the user press a
key A, then press ENTER, then release ENTER, then release A, it results
in an empty key).
Anyway, the way this patch probably solves the issue is by using the
keypress event for triggering the search view. I hope that in every
case, the keypress event are correctly ordered. It leads to some code
I'm not really proud of this patch, but the key event handling are
quite messy. Also, I need to handle the search string also when the
keyup event is fired, because it might change the search (for example
backspace trigger a keyup, but not a keypress).
When a user's karma is driven to a negative value
due to repeated abuse or the posting of spam,
automatically hide all their posts from public
view.
This will reduce the effectiveness of their abuse,
and simplify moderation and cleanup.
For public-facing HTML content provided by the user,
`<style>` tags and `style` attributes should be stripped
automatically, as they can easily be abused to deface
pages for abusive users and spammers.
<style> tags were already stripped, the optional `strip_style`
for fields.html enables the automatic stripping of style
attributes.
This is opt-in because custom style attributes are still
desirable in trusted HTML fields.
In manufacturing bom lines, digits_compute is set
to the precision 'Product Unit of Measure'.
It should be the case as well in the produce wizard,
otherwise you won't be able to change the quantity
within this wizard to the according product quantity precision
opw-629657
BOM Lines are ordered by a sequence field,
the "handle" widget makes even possible the lines reordering.
The order was respected within the mrp.production
(in o2m products to consume and consumed products)
but not within the mrp.product.produce wizard
opw-629629
When comparing a float value to 0.0,
it can happen the float value is very near to 0.0,
but not exactly 0. This is the point to use float_compare,
```float_compare(qty, 0, self.pool['decimal.precision'].precision_get(cr, uid, 'Product Unit of Measure'))´´´
will compare qty to 0, with the product unit of measure precision (0.01 by default).
So, if qty is equal to 0.00001, this means the qty is regarded as equal to 0.0.
(float_compare will return 1).
During the delivery of a picking the procurents in exception or canceled are
reset to confirm state.
As the list of picking was a list shared in the loop, other procurements may be
reset to confirm as well.
Allows exporting fields whose string is a non-ascii *byte*string (rather than unicode).
backport of 7286f4e424 fixing #773 to branch 7.0 by request of @flotho
When changing e.g. from 3-step to 2-step, we would like to deactivate a location,
but maybe the user still wants to use that location e.g. in a rule on the product, so do a check
if it is not used in some route not related to the warehouse.
This issue is related to
http://bugs.jqueryui.com/ticket/8656http://bugs.jqueryui.com/ticket/8749d693ce5324
When opening a form view, scrolling down,
and opening a many2one dropdown menu,
the dropdown menu wasn't directly under its input.
It could be really problematic when the menu was not even
visible on the current browser page (when you had to scroll down
a lot to access the many2one input).
The issue was resolved as soon as you opened the dropdown
menu a second time, and did not happen if you didn't scrolldown.
But, on initialization, the dropdown menu wasn't at the right position.
Fixes#5603
opw-629601
Amount in payment order is not correct if the account move
line has already been paid by another way. The right amount is
in the residual field related with move_id to the account invoice.
opw:628903, 628428
Text fields, or char fields having widget="text",
were not sized correctly when the field was not
visible by default, ans was set visible thanks
to attrs and other fields values.
opw-629394
Before this revision, the overdue payments report contained all payments due,
including the ones in the future, that are not actually due yet.
opw-628874
Order of attributes matter in QWeb and due to unexpected evaluation order
<span t-field t-fi /> will not works while <span t-if t-field /> do.
Since v8, the ORM will no longer crash to resolve foo.bar.name if bar is not
defined. The t-if clause is then not necessary and can be simply remove instead
of inverting the order of clauses.
When setting a partner on the lead,
the on_change_partner method retrieves
the various partner field values.
title & function fields were omitted, without obvious reasons
opw-629374
Closes#5388
It wasn't possible to create a new dashboard,
as a user other than SUPERUSER_ID,
using the "Create board" menu specifically
Reporting > Configuration > Create Board
(Technical Features & Administration > Settings groups required)
Because it creates a new menu for this dashboard,
which lead to the automatic creation of an "ir.values" record
which is prevented for other users than SUPERUSER_ID
opw-629367
Choosing a currency different than the purchase order pricelist is allowed.
Therefore, the purchase order report must display the currency
of the purchase order, and not the currency of the pricelist.
opw:628767
Fixes#5443
-Website.tours must be loaded after the translation data:
"website.ready" before the tour ensure that the translations are loaded.
-Translations for qweb templates not applied:
Translate all text nodes in qweb templates when translation data
are loaded.
-Add some translations in website tours.
opw:619786
When generating the list of all needed variants, the attributes are sorted based
on the order in field attribute_line_ids while, when comparing with existing
variants, the order of the attributes on the product.product is the order
on the field attribute_value_ids. As both order could be different (no direct
relation), variants could be wrongly recreated instead of keeping existing one.
Make sure the attribute lists are always sorted.
Fixes#4361
When having a long, non-breakable, content
within a report column,
e.g. an invoice with a very long, pipe-separated, origin,
the content overflowed on other columns.
Set word-wrap: break-word; prevent this behavior,
and is not considered dangerous regarding the possible
side-effects on the design in the reports layouts.
In fact, we should even consider applying this change
on the webclient itself. A similar issue happens in the form view
when having a field with a long non-breakable content,
e.g. a long, pipe-separated orign in an invoice. Nevertheless,
we should avoid taking risks in stable releases,
and this change in the webclient should therefore be done
carefully in master release.
opw-629352
Rewrite relativedelta.__add__ based on dateutil 2.4.0
* completely remove any hint of supporting time deltas (could be
implemented in the future, but not currently asked for and lots of
code to implement)
* implement weekday support (ordinal only)
* probably better leapyear support
* remove relativedelta.__sub__ (only works between relativedeltas)
* add relativedelta.__neg__
fixes#5089
inherited from main CSS, would prevent from scrolling body and thus from
seeing all the test cases and test case contents (e.g. error messages
and stack traces)
When providing an args of ``null`` (or ``undefined``) and a non-empty
kwargs, the kwargs would be removed/ignored.
While explicitly providing a null args is not necessary, it's perfectly
valid.
When creating a request for quotation from a call for bids, the suppliers
taxes where not present in the quotation. Since a product `taxes_id` field
is a many2many, the unused triplets syntax caused the issue.
fixes#5307
While having a product list with 20+ products,
If more than two attributes were set in the shop filter,
going to the next page kept only the first filter.
opw-629188
In order to do that, we change the theoretical quantity into a functional stored field.
Therefore the on_change changes, but the old still work.
The UoM of the inventory line is also taken into account
[IMP] Manual selection, no theoretical qty compute on import, comments
Warnings on pickings no longer worked, while it was possible
to set them in the partner form.
The problem comes from the fact onchange_partner_in no longer exists
on the picking form, by default. It was therefore never called,
on the warning never displayed.
opw-628956
When creating a request for quotation from a call for bids, the suppliers
taxes where not present in the quotation. Since a product `taxes_id` field
is a many2many, the unused triplets syntax caused the issue.
fixes#5307
This is possible to assign a sales team to a supplier invoices
Supplier invoices must be rejected in the invoiced count
of sales team (in the kanban view of sales team).
The invoiced amount must be the customer invoices amount minus
the customer refund invoices amount
opw-629105
In a timesheet, when a sign in is added, and a sign out
is not following, the current time is took as sign out value.
Rev. dbb2a669f4 corrected an issue
regarding the worked hours summary not taking into account
the employee timezone.
This timezone has to be applied on the current_time also.
e.g: For an employee being in timezone UTC + 1
If the current_time is presently 12:00 (UTC+1)
If the employee set his sign in to 10:00
and do not entered a sign out
The hours summary table displayed 1:00 of worked hours,
based on computation (11:00 - 10:00)
11:00 being 12:00 but in timezone UTC
Besides, another issue was present when entering
a sign in at midnight exactly without a sign out:
If the employee set his sign in to 00:00:00
and do not set a sign out, worked hours displayed 0 worked hours
whatever the current time.
Fixes#5379Closes#5378Closes#5503
The priority widget did not handle the readonly concept
It was therefore possible to set the priority of
an issue (for instance) even if the field was marked
as readonly.
opw-628960
Adaptation of afe4a97d03, but we properly unlink the timesheet lines themselves instead of going for the account.analytic.lines like the original commit proposition did. Actually, the unlink method of hr.analytic.timesheet already unlinks the corresponding acount.analytic.line, but those records were previously deleted via ondelete='cascade', which didn't trigger the unlink method at all, so the associated analytic lines were not deleted accordingly.
Fixes opw 628256.
The natural order was discarded when merging results with a set,
and this was actually un-necessary as the second search()
excludes the previously found `ids`.
In the rare places with a m2o field to product.template
(e.g BoMs), it is necessary to be able to search on product
codes, EAN, etc, the way it works on product.product.
This is done by delegating the name_search to product.product
and then returning the corresponding templates.
This has a small penalty of executing name_get() twice,
but is simpler and more robust for future changes.
An alternative would have been to extract the name_search()
method into a mixin and mix it on both product.product and
product.template. However this would be more brittle and
only work as long as the name_search implementation strictly
uses fields that are present in both tables.
OPW 626662
When accessing an existing record in form mode directly (enter the url or refresh a page), the daterecord has not been initialized yet. This means that the value of actual_mode will be set to 'edit' before loading the current record (method _actualize_mode() called from do_show()).
This was problematic for one2many fields that we loaded in edit mode, showing add/delete icons/buttons in readonly views. (opw 607910)
Backport of 7ec7f1ba40 for 7.0 and saas<6. (opw 627885)
It looks like it was possible to pass vals['date']
in date format (!= datetime format) to _create_analytic_entries.
This rev. is a retrocompatible patch for 73f7a2ba35.
In addition, it solves the same issue than the rev.
73f7a2ba35, but in the case the project is
set on the task after the work hours are created.
See ab5ecef476
opw-628729
When the number of records n and the limit l were such that n%l = 0
(e.g. 16 records total, 8 displayed per page), clicking on the
previous button on the first page, or on the next button on the
last page produced a bug because the total number of pages
computed for this edge case was incorrect.
When selecting a product in a sale.order, the asked quantity is verified against
the available quantity.
If the user changes the UoM or the onchange from super call changes it,
the context should be updated accordingly.
Fixes#2559
In ir_ui_view.py, in method render (line 132 atm),
the values passed to the rendering engine is a merge of the context
and the values.
Therefore, if at this place, the language is rightly set in the context,
the report lang will be as well in the values.
In abstract_report.py, the values passed to the render method is the
wrapped report localcontext in which are added some key/values
(docs, doc_ids, doc_model).
By default, the lang in the localcontext is False
See __init__ method of rml_parse class in report_sxw.py.
If setLang method is not called, the lang in the localcontext remains False.
In this rev., we avoid to overwrite the lang from the context by the lang
of the localcontext if this one is False, so the lang of the report is set
with the current context lang.
Forcing the lang of the report to False had as side-effect to prevent the
editing of report using the website editor(e.g. playslip_report)
opw-628720
- Translations lookup normally uses the namespace of the current
QWeb template, after merging all inherited views.
But when a QWeb template is "cloned" by a child view using
inheritance with `primary` mode, the translations are more
likely to exist for the original (parent) template, and would not
be found when using only the "child" namespace.
This patch adds support for looking up each translation
also in the parent namespace in this case, if none was found
for the child template in the first place.
- ir.translation's _get_source() now supports a list of res_id
to search for, in addition to a single res_id
- Also moved the logic of routes /website/customize_template_get
and /website/get_view_translations to the ir.ui.view model where
it belongs.
opw: 615241
Closes#5325
The tasks list view "act_project_project_2_project_task_all"
always displays inactive tasks ("'active_test': False" in context).
Both the link in the kanban and the button in the form
leading to this list view should therefore counts both
inactive & active tasks.
opw-628672
When having account installed, but having as only
access right "Contacts creation", it wasn't possible to
display the partner form.
Setting the "groups" on the button itself has as effect
to hide the button, but not to prevent its value computation.
If you did not had the access rights required to compute the
buttons values, it leaded to security issues.
Put the "groups" on the view instead prevent the button to be loaded,
and its value to be computed. It therefore avoids both
a useless computation (computing the value of a hidden button
is not really useful), and prevent any access rights warnings.
Besides, 3 different groups were needed to display the
three buttons:
- account.group_account_invoice
- account.group_account_user
- analytic.group_analytic_accounting
Not having one of these tree groups could lead to security
warnings. We therefore split this view into three sub-views,
with each one a group set (and a button)
opw-628668
In calendar, using recurrent events leads to the use of
virtual ids, which are strings.
It wasn't possible to change the message subscriptions
for recurring events,
neither for the user himself, neither for the other followers
opw-627895
The precision 'Product Unit of Measure' was defined after the declaration of kg.
Since fc85a7ee, the precision of kg is set in data to 0.001.
As the Product Unit of Measure was not defined yet, the rounding was stripped to
(16,2) precision, so getting a rounding of 0.0 for the kg unit of measure.
[FIX] product: the declaration of decimal precision was done after
the declaration of uom precision, preventing uom precision from going above
the default decimal precision. + made the Kg unit precise up to grams by default.
27a48f8026 introduced the use of self.dataset
It appears it is not always defined.
Few lines above, self.getParent().dataset is used,
and looks to be always defined.
We therefore now use this dataset in order to get the context,
to correctly pass the current session language.
Closes#5416
When a delivery order is confirmed, pass the user language to the
procurement creation so the messages in the chatter are now translated
in his language.
opw 627002
Traceback because id was not casted: AccessError: ('AccessError', u"Database fetch misses ids (u'1') and has extra ids (1), may be caused by a type incoherence in a previous request")
default_get method of mail.wizard.invite model uses
the key 'default_res_id' to retrieve the res_id of the record
to add the followers.
In the case of recurrent events, virtual ids are used, and
the conversion from virtual ids to real ids is needed.
Pass the context, with the language setting, when the record is read to
fill the google drive template. That allows to translate the name of the
document and all the informations inside.
opw-626675
This rev. reverts partially 1d76586a1b
This rev. is related to #3462
Regarding addons/web/controllers/main.py
---
name of model ir.actions.actions is not translated
it's the name of server actions, client actions and window actions
that are translated.
Meaning the name of the ir.actions.actions will always be in English,
even when passing the user language within the context.
Regarding addons/web/static/src/js/views.js
---
There is no reason to pass the field values within the context
of the /web/action/load call: The read methods of actions are
not overidden to use the field values. Besides, it pollutes
the context of the action, leading to unwanted behavior, such
as the translation of the action name within the lang available in the
fields of the form view (e.g. the partner form).
Initially, the field values added in the context has been added
within the rev. 542928adde
Indeed, sidebar_context (or sidebar_eval_context nowadays), contains
the field values, and the additional_context passed to /web/action/load
is an extension of this sidebar_context.
We are not sure the reasons why the sidebar_context was passed to the
/web/action/load, but we believe it was to pass the session/user context
containing the lang, timezone, and so on, not to pass the fields values.
The delivery module overrode the method _create_invoice_from_picking
to add the shipping costs according to the invoice and the shipping.
The issue is that the method _create_invoice_from_picking creates an empty
invoice, without any line. The lines are added afterwards, using the method
_create_invoice_line_from_vals, within the method _invoice_create_line.
So, after having called _create_invoice_from_picking, the invoice is indeed
created, but without lines, and therefore without the amount total value.
Adding the shipping costs there will thus prevent the shipping costs
based on the total price of the invoice (e.g. free for an order of 500€)
This rev. overrides the method _invoice_create_line instead, as, after
the call to this method, the invoice will be completely set, with all
its lines, and with a correct amount total. The side effect
is that we need to recompute the taxes a second time, using button_compute.
This is not the cleanest way to solve this issue. Indeed, a cleaner patch
would be to change the method _create_invoice_from_picking so it creates
the invoice along with its invoice lines, using the ORM command
(0, _, values) to creates the lines directly within the invoice creation:
invoice['invoice_line'] = [(0, _, values) for values in invoice_lines_vals].
Nevertheless, this is a bigger change, that will probably require API changes,
and therefore should be done in master.
opw-626226
opw-628517
Many trivial changes to journal items, such as the
"blocked" flag for litigation (follow-up), do not affect
the balance of the whole entry. These should not cause
the account.move to be (re)validated.
For example it should be possible to change trivial
fields even on journal entries recorded in a closed
fiscal period.
Setting an expense with a tax included with a negative base code sign was
getting the wrong amount (tax line as a credit instead of debit). So leading to
a total for the accounting entry superior of the total of the expense (should
not happend as the tax is included).
Add test to verify this scenario.
Fixes#4260, opw 618531
The quick creation and account record opening in the sheets are not useful.
Besides, restricted users (simple employees) have no read access on account.account.
opw:626989
In the website editor, the translations are loaded using
the route 'get_view_translations', which returns the translations
of the templates loaded by the website (t-call calls)
The thing is, report templates use the 'translate_doc' method
to actually load the report, translated in the partner language,
and the templates loaded by this method are not seen by the website,
therefore, when calling 'get_view_translations', those report
templates were just ignored, thus their translations are not loaded.
This rev. injects the templates loaded with translate_doc
when rendering the report into the method 'customize_template_get'
(which is used by 'get_view_translations' to retrieve the loaded templates).
The translations of the reports are therefore now loaded corretly when
hitting the "translate" button in the website editor for reports.
Besides, this rev. has as (good) side-effect to add the template,
in the template selection input when editing using the HTML editor.
opw-620713
Without this, if the user creates a second line (or more) with another search query and presses tab (or clicks somewhere else) quickly, it will take the previous search result instead of the new one because the new one did not occur yet.
With this fix, if the search did not have time to process, the Create a product modal appears, just like it already did for the same behavior on the first line.
Fixes 620679.
As of January 1rst, 2015, telecommunications, broadcasting
and electronic services sold within the European Union
have to be always taxed in the country where the customer
belongs. In order to simplify the application of this EU
directive, the Mini One Stop Shop (MOSS) registration scheme
allows businesses to make a unique tax declaration.
This module makes it possible by helping with the creation
of the required EU fiscal positions and taxes in order to
automatically apply and record the required taxes.
This module installs a wizard to help setup fiscal positions
and taxes for selling electronic services inside EU.
The wizard lets you select:
- the EU countries to which you are selling these
services
- your national VAT tax for services, to be mapped
to the target country's tax
- optionally: a template fiscal position, in order
to copy the account mapping. Should be your
existing B2C Intra-EU fiscal position. (defaults
to no account mapping)
- optionally: an account to use for collecting the
tax amounts (defaults to the account used by your
national VAT tax for services)
It creates the corresponding fiscal positions and taxes,
automatically applicable for EU sales with a customer
in the selected countries.
The wizard can be run again for adding more countries.
References
++++++++++
- Directive 2008/8/EC
- Council Implementing Regulation (EU) No 1042/2013
Closes#5229
When you try to load calendar_demo.xml, the loading of demo event
`calendar_event_1` fails with fr_BE locale (and probably some others).
This is due to the rendering of the mail template
`calendar_template_meeting_invitation` (which is used when you create
an event).
This template used a method `get_interval()` in calendar.py, which
does not always return Unicode strings. Furthermore, these strings
are dates and should be formatted according to user locale.
PS: Yeah, we love Python2's management of encodings and Unicode...
Since all the lines in a partial reconciliation share the same state and the same amount_residual, we need to keep only one 'result' line.
It was the first line found that was kept ; now it's the line whose amount is greater than amount_residual, whiwh most likely is the significant one.
Fixes#5129
Module 'Warning' overwrites onchange_product_id method of purchase.order.line
The signature in the warning module had 'notes', while there isn't any 'notes'
parameter in the original method, in the purchase module.
The super call was also wrong, ignoring the optional fields, which
were therefore always set to the default value
The name must be changed when changing of product,
but not for other changes, quantity for instance.
The 'or not uom_id' is just for retro-compatibility concerns
uom_id being False actually means we just changed of product,
and the name must therefore be changed
name as been set as False in the onchange call in the view
for the product_id field, in this rev.,
so the name being False now means th change of product
Nevertheless, existing databases for which the view
is not up to date won't have this change
and we therefore have to rely on something else to know
when the product has been changed or not.
fixes#5295
opw-628138
When having several databases in the login form (not monodb mode),
when switching from one database to another,
if the company logo was different,
the company logo could be the logo of the database you came from.
fixes#5291
opw-628131