Steps to reproduce:
- Install hr and base_address_city
- Edit an employee
- In private info, set a private address
- Open private address form from the employee form
Traceback because parent_id is undefined.
The base_address_city module override a part of res.partner
view form to change the city readonly modifier.
This override adds a domain in which appears parent_id,
but the field is not present in the view.
Related commit 526bfca3afclosesodoo/odoo#32172
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
Without this patch, you have to redefine the field to be able to override this field.
closesodoo/odoo#33049
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit is a few small improvement/fixes to the web framework:
- allow placeholder attribute on input tags in form view
- only bind click event handler to buttons managed by the framework, not
custom ones
- _onExecuteAction method in action manager properly fails if event
cannot be properly handled
closesodoo/odoo#32458
Signed-off-by: Géry Debongnie (ged) <ged@openerp.com>
Purpose: improve UTM definition and propagation in sale and account
applications, as well as in event.
Specifications
* inherit from utm mixin in sale for SO and invoice;
* propagate UTMs from SO to invoice when invoicing;
* add utm fields on registration model;
* remove website_sale_link_tracker module and inline its content in sale
and website_sale;
Merge linked to task ID 1929272
closesodoo/odoo#31260
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Replace the font selection UI by a dropdown. Make the system generic
so that a dropdown can be used for any set of options.
task-1942241
closesodoo/odoo#32437
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
This commit fixes a bug introduced when migrating
from jquery deferred to native JS Promises (ab56e63).
Steps to reproduce:
1. Go to the Expense app
2. Create a new expense
3. Click on "Attach Document" and upload a file
=> crash and infinite loading spinner
After loading files, the `attach_document` widget is
supposed to call a callback action with attachment ids
as argument.
Currently, attachement ids are not correclty retrieved.
They are retrieved via the `arguments` object but since ab56e63
`arguments` refers to the arguments of the Promise callback
function and no longer to the handler function `_onFileLoaded`
arguments.
closesodoo/odoo#33048
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
- added the campaign parameters on event_registration.
- added the campaign parameters on sale_order and move the same parameters to the invoice generated for that so.
Task-1929272
Currently, when some add token for s2s payment, dummy transaction of
1 unit was performed and it was frautrating for customer.
So added option on acquirer's settings that check if you want's
to validate the transaction or not.
If 'verify Card validity' is ticked on payment acquirer then and then
it will verify with dummy transaction otherwise it will not going to verify
the card details.
Task-1903170
closesodoo/odoo#29595
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Merge commit for PR: #31811
The main goal is to keep the image ratio on resize (instead of adding a white border).
The opportunity is taken to also clean up the image tools.
See individual commit messages for more information.
Functional:
- Remove the white border from all images (never resize to square, keep aspect ratio)
- Prevent some images from being 3px shorter than expected
- Resize the website favicons appropriately, always encode them as ICO, add a default favicon to new websites
- Secure images going through the tools by returning an error when non-image content is given
- Incrase the max image filesize from 42e6 to 45e6 to fit some of the biggest images we might get from Unsplash
- Always return the correct mimetype/Content-Type for images
- The avatar placeholder was white displayed on top of white, now it's grey so we can actually see it
Technical:
- make image tools more consistent by merging the tools and removing duplicate code
- add tests for the image tools
- remove uncessary parameters
- remove the "ghost border fix"
task-1958000
Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
This allows to more easily customize each method, and it gives more flexibility
regarding which operations to apply and in which order.
task-1958000
PR: #31811
Previously the image that we uploaded as a favicon of the website was not
resized, so it could be extremely excessive in size and resolution, and it also
was not guaranteed to be a square.
Now we always resize it appropriately and save it as an ICO file.
The default favicon is now applied to all websites instead of only the first.
task-1958000
PR: #31811
Since the images are not guaranteed to be square anymore, the kanban image had
to be adapted to better handle the different image ratios.
Also the placeholder has been moved into the actual image div instead of
being a separate div that acted differently.
The avatar placeholder was white... displayed on top of white. Now it's grey
so we can actually see it.
task-1958000
PR: #31811
* = website_profile, website_slides
Before this commit, the returned Content-Type was not always correct, for
example if the image tool was changing the format, which happens when given
a BMP (converted to PNG), or other types being converted to JPEG.
The previous method `force_contenttype` was too specific and it wasn't available
in every controller. It didn't even need to be a controller method because it
didn't use self.
Now we create a generic helper to ease updating headers.
The Content-Type is only updated when it is safe to do. It is especially unsafe
for example for SVG files.
task-1958000
PR: #31811
* = hr, im_livechat, mail, payment, purchase, web, web_editor, web_unsplash,
website_profile, website_slides
Since the merge of all image tools into one function, the intermediary functions
are not needed anymore.
task-1958000
PR: #31811
Make the image tools more consistent and easier to maintain by having a single
function handling all the cases, instead of several functions doing more or less
the same thing with obscure differences.
Also introduce a new function to guess the size based on a field name, to be
used in the following commit.
task-1958000
PR: #31811
Following commit: 6801baa662
Crop is always used when we know the target size. Therefore there is no point
to pass a ratio argument. However size is required now.
Also "center" is always used, so make it the default type.
task-1958000
PR: #31811
* = website_partner, website_profile, website_sale, website_slides
Before
======
Since commit: 2e3848b394
The images that are resized have additional borders if the target ratio is
different than the image ratio. Those borders are transparent if the image
format supports it, and are white otherwise.
With that current solution, if the background where the image is displayed is
another color than white, it is looking really bad.
Moreover, most images are stored resized like this, so it is not even possible
to decide if it should have borders or not depending on the context, the
original image and ratio is forever lost.
It is also inconsistent because if the image is already smaller than the target
size then it doesn't include borders. In that case it keeps the original ratio
instead of the target ratio. So it isn't even guaranteed that the target
ratio is going to be respected.
After
=====
This commit will solve all of those problems by always keeping the ratio of the
original image.
This implies the views should be taking care of adding borders when necessary.
task-1958000
PR: #31811
There is a mix in the variable names: before this commit, what is called
`image_base64` is actually not base64 encoded, and what is called `content` is
actually base64 encoded.
The variables have been renamed to avoid further confusion.
task-1958000
PR: #31811
This commit introduces the possibility to resize and to select the quality when
optimizing an image for web.
This will be used by the media dialog in a future commit.
The arbitrary resolution limit of 42e6 has been increased to 45e6 to fit some
of the biggest images we might get from Unsplash, and this value has been moved
into a variable so it can be customized.
The mimetype computation has been moved after the image processing because in a
next commit the operation could return the image in a different format than what
was originally given. Eg. BMP -> PNG, or unsupported format -> JPEG.
task-1958000
PR: #31811
The image tools were accepting an encoding parameter but it was never used.
Indeed the given images are always encoded in base64.
`image_colorize` was the only method not taking base64 directly, so it has been
modified for consistency. This allows to change the code in partner to not
base64 decode the image in some case just to be base64 encode it again after.
`crop_image` and `limited_image_resize` have been slightly refactored to account
for this change, but in this commit their behavior was kept.
task-1958000
PR: #31811
Purpose: pre-merge of small code cleaning and tests improvements for
task 1853147.
Includes: fetchmail code cleaning, fix in mail and improved tests for
mail gateway.
closesodoo/odoo#32974
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
This commit add some tests related to the mail gateway: more bounce management
tests and some additional thread formation tests. Some test asserts about
bounce / blacklist management are commented as they are not completely working
currently. This will be improved in master soon.
Some cleaning in also done in all mail gateway tests. Notably some call to
tool methods are cleaned / simplified, duplicate tests are removed. Some
low-level checks are removed.
A new test model is added for mail gateway: mail.test.gateway. It is a
chatter model with blacklist enabled on it. It allows to tests the
various blacklist-related overrides and features as well as all basic
mail gateway features.
Sub-part of task 1853147 (pre-cleaning before implementing mail gateway
improvements)
Linked to PR #32974
Purpose: fix crash when removing someone from followers through UI.
Sub-part of task 1853147 (pre-cleaning before implementing mail gateway
improvements)
Linked to PR #32974
Purpose: small cleaning of code linked to mail.mail model in order to
avoid unnecessary overrides
* create mail: default_fetchmail_server_id in context should be sufficient
as it is the base mechanism of default_get;
* write: unused in codebase. Anyway we should not write on mail and if it
is the case giving fetchmail_server_id directly should be the correct
way of doing it;
In case of a clean_context use we might loose default_fetchmail_server_id
key. It is used notably for tracking message generation. In that case
this information could be lost. However the whole concept of propagating
a fetrchmail_server-id from incoming mail server to outgoing emails (as
mail.mail is used only for sending email) is strange and does not require
so much specific code.
Sub-part of task 1853147 (pre-cleaning before implementing mail gateway
improvements)
Linked to PR #32974
Before this commit:
If the user was GeoIP located and it's pricelist (property_product_pricelist)
was not allowed for it's GeoIP country, that pricelist would still be return.
This issue was detected as a test `test_get_pricelist_available_geoip2` was not
working since forward ported in master (only on theme runbot or local..).
Before master (saas-12.4), `property_product_pricelist` would not be recomputed
once set, so the test was actually not working as expected.
Since master, reading `property_product_pricelist` just after setting it goes
through the compute method, resulting in different value than in previous
versions.
closesodoo/odoo#32961
Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
Stages modification through the clickable statusbar wasn't very intuitive.
By fixing default behavior through states (and corresponding buttons), default user experience is simplified.
3 static states available : draft, open, closed
Form view: navigation through states with buttons
Kanban view: disabled modification of survey state
Task ID : 1949110
closesodoo/odoo#32325
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
As original timezone is not taken into account when computing recurrent event
time of a given recurrency change depending on the DST. This commit fixes that
behavior by correctly storing the event timezone and using it when computing
recurrency datetimes.
Related to task 30388
closesodoo/odoo#32950
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
When a product's name is too big, in the structure & cost report, the
product's name line go to the line automatically.
Before this commint, the indentation applied on the products in the
report was only applied on the first line of the product's name.
Now, the indentation is applied on all the lines of the product.
opw-1966440
closesodoo/odoo#32945
Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
This commit synchronises the editable tree view and the form readonly view of
the following objects:
- account.invoice.line
- purchase.order.line
- sale.order.line
- repair.line
Task-1912608
Closes : #29566
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
While printing the reports using boxed layout, the font-size is bit smaller
and the report does not look so good. This commit improves the boxed layout
by slightly increasing the font-size.
Task id: #1931768closesodoo/odoo#30497
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
Tour steps on m2x widgets are now consumed only when an actual record
is selected (not on random click on the widget).
closesodoo/odoo#21625
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Co-authored-by: qsm-odoo <qsm@odoo.com>
* barcodes, calendar, partner_autocomplete, web_settings_dashboard
Make the notification system better, using bootstrap toast component,
and make it available in the frontend.
The toast component allowed to remove some JS code and made the
component customizable by themes but it had to be reviewed/fixed to make
it functional (maybe bootstrap will review its work in next versions).
This work should still be improved because there are still too many
ways (deprecated and not deprecated) to instantiate toasts in the
backend. The goal here was however to make the toasts more modern and
make them available in the frontend.
This work is needed for some tasks. @kig-odoo and @fja-odoo made a
pre-work to instantiate toasts in the frontend for their respective
tasks. This commit unifies the system.
Part of https://github.com/odoo/odoo/pull/32793
task-1970731
closesodoo/odoo#32793
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
Just reorganize the files by alphabetical order and group them by
folder (core / services / ...) and move the libs on top.
Part of https://github.com/odoo/odoo/pull/32793
task-1970731