Task 40692
Various changes to import/export (mainly) UIs:
* default to excel & "full" (non-import-compatible) export
* auto-detect encoding of CSV using chardet
* remember column -> field mapping after having imported a file (useful
for repeated imports where auto-matching failed)
* better handle localised booleans & column names
* automatically select source list view's fields when exporting
* better integrate import templates feature and add a number of templates
This commit will replace the delivery carrier list choice by a single and more
discrete line bellow the billing/shipping section when there is only one
carrier available.
opw-1832976
The goal is to be able to more easily create section and notes on sale order, invoice, and quote.
================================
Problems of the existing feature
================================
The problematic part in the existing feature was that the same section had to be defined again and again for every line, instead of being defined only once where it needed to be. There was also no easy way to move them. Those concerns are solved here.
Moreover, due to the complexity of the feature, it was hidden by default, requiring a setting and multiple overrides. The new feature is simple enough that it will always be present.
==================
New implementation
==================
Sections are lines solely used for display purpose, there is no business logic attached to them. They will show as a nice header at the top of the section, and a subtotal at the bottom of the section.
We also take the opportunity to add notes, which are just like sections except they are displayed differently and don't include a subtotal.
=========
Reasoning
=========
We decided to implement it this way, as opposed to creating a proper section model, because it creates less changes in the code.
Creating a intermediary section model between the sale order/invoice/quote and their lines would have required to rewrite the entirety of the code associated to them. It would also have required to create a new JS widget to handle on the same view a double-level One2many (or a One2many + group by).
The current solution is much easier because it just requires adding 2 buttons, 1 simple field on the corresponding models which even has a NULL default value, and making some business checks (don't apply business to section/note).
We tried our best to impact as less as possible the existing models. Notably we didn't want to add any extra field if this was avoidable. This also makes the migration easier.
No matter the implementation choice the views/reports had to be updated to display the sections and notes correctly, which has been done.
===========
Limitations
===========
The current solution has several limitations:
* since the sections don't have business logic, it's not possible to make any reporting based on them
* any business related to sections has to be computed on the fly by browsing in order all of the lines, notably the subtotal has to be computed on the fly at every display
- when sections are moved (drag&drop) on the back-end, the following lines that are part of the section are not moving with the section
===========
Technically
===========
The commit will:
* update the models to add the display_type field (along with related sql constraints to guarantee integrity)
* add new buttons at the bottom of the lists to allow creating section and note, along with the existing add a line/product button
* add some business checks to not apply business to section/note (product_id and account_id became non-required fields)
!!! The most likely cause of potential bugs introduced in this commit would be to have forgotten to add those checks on some places where they would be needed. This is tedious to check but fortunately easy to fix.
* update the views to display sections and notes correctly, also made various improvements/fixes to those views (notably to apply B2B/B2C setting more consistently)
!!! This is the second likely cause of potential bugs: if the updated views are inherited in a way that is not compatible with the changes. Or if we forgot to apply the changes to some other views. Again this is tedious to check but fortunately easy to fix.
Task #53996
PR #25209
Since sale depends on account and not the other way around, it's better to have this setting inside account.
Functionally it will allow the user to benefit from this setting also if he uses only invoice without sale.
Technically it will allow us to remove all of the overrides that were previously necessary for this setting.
While we moved the setting, we also renamed the different variables so their name better convey their meaning.
PR #25209
The default "add a line" button creates a new line with the default values from the model. Sometimes we want to create a new line with different default values (or more generally a customized context), which is possible with this commit. Moreover it is possible to create multiple buttons for multiple default values/contexts.
This works both for in-line creation ("editable=") and dialog creation.
The new tags are:
<control> defines custom controls for the current view.
Does not support any attribute, but can have children:
<create> adds a button to create a new element on the current list.
This makes sense when the parent tree view is inside a One2many field.
If any create is defined, it will overwrite the default "add a line" button.
For more information and example, have a look at the Views documentation.
Technically, the commit will:
- parse the new XML tags (+ add appropriate validation)
- display the buttons based on the XML
- on button click/keyboard: pull up the additional context information from the button event up to the default_get
- add unit tests
- add documentation
PR #25209
Currently, using the shortcut "tab" inside a list will crash if the list has no input field (ex. if it has only a textarea field).
This commit prevents the bug.
Also moved the test for the orderedResIDs crash in the correct module.
PR #25209
With this commit, when we perform a close action, we can provide infos to
the `on_close` handler, so that it can handle different cases that caused
the close action.
Purpose
=======
A demo data is declared in an incorrect module.
website_sale_comparison declares the model and website_sale_options does not depend on that one (it works on the runbot by chance)
Specification
=============
Move the demo data to product and add its category in website_sale_options.
Task 1856935
Currently, if installing a module's demo data fails (because the
module was uninstalled and some were left over and can't be
reinstalled, or because they're broken, or…) the installation of the
module fails and further installations are skipped (?).
Since demo data are non-essential (though required to run tests),
rather than fail everything if they fail just roll them back and
notify the user.
This change generates a warning log *and* shows a notification popup
to the end user.
Try to remove cr.commit (and rollback) from module and db install:
* put a savepoint around test data loading
* remove a bunch of commits sprinkled throughout
* remove rollback on data loading failure (assuming it bubbles up, the
entire module's installation should be rolled back)
* add commit right before the tests are run, so they can run isolated
and still see whatever was done when installing their module
* convert a few explicit closing to context managers
* having a special case for session expiration seems unnecessary when
the CM specifically supports hooking on the exception name
* and properly implement the special handling of HTTP 504 (Gateway
Timeout) from #24854 using that same hook
The error handling in get_file has always been somewhat problematic
(sarcasm ho!). Pending PR #24854 attempts to add special handling for
gateway timeout aside from its base stuff, and that's really quite
terrible due to get_file's limitation of only being able to read the
content of the document loaded in the iframe (no proper access to status
codes & al).
That was the occasion to look up modern API and see if we could do
file downloads in JS without iframe crap.
Turns out we can: xhr2 is well supported so we can POST, get a blob
back, and create a "local download" for that in-memory blob using either
a[download] (most browsers) or msSaveBlob (IE10+, that's actually a
convenient-to-great API and it's a shame there's nothing like it in the
standard).
The changes are not trivial but save ~30LOC and most of the overhead
is replicating the old/weird error handling as that requires
additionally decoding the blob to a string & parsing that string to
a document before being able to get the content (whereas before we'd
just access to the document loaded in the iframe).
OTOH we can now properly forward non-200 status codes to the
crash manager (as name) which will allow using regular CM hooks to
provide custom warning and error messages.
Note that this requires two libraries:
* a stripped down version of the content-disposition NPM lib, as
download file names are provided via that header and parsing the
header is decidedly non-trivial
* the download.js library as it handles the various edge cases from
different browsers, I'm don't think all of it is necessary for our
use case but the library is not that big so no real point in trying
to strip it out and potentially break it in the process
According to RFC 6266,
content-disposition = "Content-Disposition" ":"
disposition-type *( ";" disposition-parm )
disposition-parm can't be an empty string, and thus a ; in terminal
position is not legal, even though browsers apparently work around it.
Method `_analytic_compute_delivered_quantity` does not exists anymore.
The bug this patch resolved is not present in saas~11.2. Patch not
needed.
This reverts commit 371a92fb30.
* Update demo data sheet for barcode
* Modify product "Book: Office Renovation for Dummies:
- Name: "eBook: Office Renovation for Dummies"
- Image:
- Internal category: All/Services/Saleable
* Tips internal reference
* Product 10.0 % Discount =
- Name : "10.0% discount on total amount" (no space between 0 and %)
- Internal reference : 10PERCENTDISC
* Free product - large cabinet
- Should be a stockable
- in category All/Saleable/Office Furniture
- Name : Free Gift - Pencil Holder
- Picture
* Desk Customizable :
- Change its website sequence (should be displayed first in the shop)
* https://github.com/odoo/odoo/pull/25263
* Need to clean attributes and attribute values and attribute categories :
- Attributes, keep : Brand, Color, Dimensions, Legs, Weight
- Attribute Category : Rename Storage into "Material"
* Events
- Suppress Functional Webinar and Technical Training
* PoS Categories :
- Suppress
- Create PoS Category : Desks (put desks in it)
- Create PoS Category : Chairs (put chairs in it)
- Create PoS Category : Miscellaneous (and put all other products in it)
* Products available in PoS
- Remove : Air Flight, Car Travel Expense, Bpost domestic bpack 24h pro, Bpost World Express Pro, Customer Care, DHL USA Delivery, DHL USA -> International, Deposit, Expenses, Fdex International, Fedexs US, Hotel Accomodation, Restaurant Expenses,
* Product:
https://drive.google.com/a/odoo.com/file/d/1KjxcB88aDfe8qAzIpFlkBmMj5ekA9eIf/view?usp=drivesdk
Timesheet : description to update https://docs.google.com/spreadsheets/d/1nB8l8pFcRXRFnudgDJVyZZp3McaHNovlyvY0jE1ZZ54/edit?usp=sharing
* Project : less projects, more tasks
Remove "Internal - GAP Analysis", "Internal Projects"
Rename Support into After-Sales Services
Task to rename: Data import + Doc ==> Office planning
Move the task Internal Training from "Support" to "Office Design"
* AGR Project : add the following tasks and link it to the right SO line
Decoration : SO Line ==> Senior Architect
Planning : SO Line ==> Senior Architect
Furniture SO Line ==> Senior Architect
Furniture Delivery : not linked to an SO line
* Marketing Automation
Partnership offer ==> to rename into "Commercial prospection"
Steps to rename:
Offer free trial ==> Offer free catalog
After 7 days (if not yet partners) ==> After 7 days (if not yet customers)
Message for sale person ==> keep the same
* Mass mailings:
http://nimb.ws/zrKsZ9http://nimb.ws/CbNpwd
* Events:
Suppress Functional Webinar and Technical Training
Tracks to update : https://docs.google.com/spreadsheets/d/1sKkJrltXY3Gz7ue3mVysZxaWGybKpx5fIhgUBnhbNDs/edit?usp=sharing
* Helpdesk
Rename team into Customer Care
Create 2 tickets in default team
Urgent : Kitchen collapsing (assigned to admin) : link to the task SO053: [SERV_585189] Customer Care (Prepaid Hours)
No pririoty : Where can I download a catalog ? (not assigned). Ticket type = question
Set the rounding method to Round Globally
Create a tax A with rate = 1.1040 %
Create a bank statement with one line having amount = 1153.960
Go on to reconcile that bank statement
Reconcile with a new line on which the tax A applies
Create the write-off
Click on Reconcile
Before this commit, an error was thrown by the server (Move unbalanced)
This was because the amount of the write-off line sent by JS (which is the tax amount)
was 12.7397
The server though computes the taxes by forcing the rounding and gives off a tax amount of 12.74
Hence the error
After this commit, the JS will fetch the amount of the taxes by forcing the rounding there also
And the reconciliation process goes well
This fix is already present in v11.0 at 6fce298d70
OPW 1859939
closes#25733
In a search view, write text in the input, then hit enter to select
the facet.
Before this commit, the search view was detached and then reattached
when the control panel was refreshed. This led to loosing the focus
momentarily and erasing any supplementary input one might have typed
*during* the rpc call.
After this commit, if the search view is the same as before, we don't
detach it in the first place. Thus, the input is conserved in this
situation.
OPW 1861941
OPW 185614t
closes#25546
Steps to reproduce the bug:
- configuration on sale:
- Unit of measure: Some products may be sold/purchased in different units of measure (Advanced)
- Sale Price: Advaced pricing based on formulas (discounts, margins, rounding)
- Discount: Allow discounts on sale order lines
- kg as the Reference UOM for weight
- create an uom 10 kg
- Category: Weight
- Type: Bigger...
- Bigger ratio: 10.0
- create a product P
- Sale price: 100
- Unit of measure: kg
- Purchase UOM: kg
- create a pricelist "My pricelist"
- Discount policy: Show public price & discount to the customer
- Items : All products - 10% discount
- create a SO with "My pricelist"
- create a SO line with P, the unit price is automatically 90 with 10 % of discount
- change the uom of the line with 10kg
Bug:
The unit price of the line didn't change and the discount on the line disappeared.
In function product_uom_change, the uom of the SO line has been set in the context
of the product(like in function product_id_change). So in funciton _get_display_price,
the function _get_real_price_currency must be called with the uom of product in the context.
In this way, the lst_price will be fetch on product with the right uom without any bad conversion
(because uom.id == product_uom with uom from the parameters and product_uom from the context).
But with function get_product_price_rule, no need to call this function with the uom in context as
it is already set in the product(check "if uom_id: ... else ..." in this function).
The same logic has been applied in function _onchange_discount
opw:186385
If the user send an email with a '/web/content' or /web/image' link in
the body, the attachment are not send by email to not to increase the
size of the email unnecessarily.
Before this fix, the attachments are don't save to the record and are
remove with the wizard. We can't add the attachments to mail.message
(like 'mail.compose.message') because it's auto_delete/unlink and the
attachments are removed before the recipient can read it.
Before this fix attachmentThumbnailToLinkImg is not called for
style-inline options. The mail received does not have thumbnail and the
user can't click on the invisible link.
opw-1863659
Display the address of the partner_id when available rather than using the partner id of the movelines. Important when the partner is changed after the movelines are created.
support ticket : 1857582
- When clicking on the invoices stat button on payment transactions via
the form view a traceback is displayed.
This is due to the fact that the code is trying to access to a
member/field named "id" on an integer.
"invoice" is an integer, not a record/object.