The variants on a product in the ecommerce can appear:
- naturally, not a list, colored square for color, ...
- in a list of radio button.
To have the second kind, we need to enable the "List View of Variants"
customize option.
One part of the code was not the same which cause an issue when saving
the image of the variant, it was saved on the product.template instead.
This commit add an "update_product_image" function which is now called
in both scenario.
first half of:
opw-654279
forward port note: in 9.0 website/image -> web/image
These onchanges were needless since it was already done by the
BufferedDataSet when we use alter_ids to add/remove ids/virtual ids from
the recordset.
The onchanges this commit remove were introduced with 6b907bb4d in
juliet 2012 whilst the onchange in the BufferedDataSet when using
dataset alter_ids was with dd747c096 in october 2012.
closes#8273fixes#7595
opw-644706
Partial backport of master (-> v9) commit 059230512.
for the issue when removing an invoice line from an account.invoice,
three onchange where triggered:
- ListView account.invoice.line unlink the line id from its dataset,
[[first onchange]]
-> the line id is removed from the dataset which trigger an onchange
after this is done (and the onchange is finished), the following
onchange happen:
-- remove each record of the Collection of the ListView
-> this remove the id of these record from the ListView List dataset
[[second onchange]]
-> this trigger an onchange albeit the dataset is not changed
(since it was already removed before the first onchange)
-> this trigger an onchange on the one2many_list of the ListView
which has the same dataset as the ListView
[[third onchange]]
-> so an onchange is called yet again.
this commit removes the second onchange in this case where we remove ids
already removed from the dataset.
closes#8273fixes#7595
opw-644706
<% are automatically escaped as soon as the wysiwyg tool
is used to edit the template.
The wysiwyg tool is not compatible with Jinja, and
it isn't expected to be.
To avoid to have this problem everytime when
editing the portal email templates, we use
a Jinja syntax compatible with the wysiwyg,
as a workaround.
opw-654223
When importing a module, if an error was raised
during the import, the traceback wasn't displayed
anywhere, making harder the debugging.
While it make sense to not display the entire traceback
to the user, in the web client, this is useful to
diplay the traceback in the logs, for debugging purposes.
opw-653882
For these function fields, bypassing the ORM, using a SQL query,
improves the execution time by 100 for a set of 80 timesheets
in a database with
- 250K `hr.analytic.timesheet`
&
- 250K `hr.attendance`.
These function fields depends on a one2many field which use
the SQL view `hr_timesheet_sheet_sheet_day`.
When performing `sheet.period_ids`, two SQL requests are performed,
- the first just to know the ids in the sql view matching this sheet
- the second to read the fields `total_attendance` & `total_timesheet`
and the request is performed on the entire set of lines of this view
(~250K lines in the observed use case)
while, when replaced by this SQL request, only one request is performed,
on a restricted set of lines, speeding up significantly the computation
of these computed fields for smaller sets of sheets.
opw-653447
As everywhere else, dates & datetimes must be formatted according
to the format defined in the `res.lang` of the user, and within
the timezone of the user.
Before this revision, when adding a datetime field to a calendar view,
the raw value of the date was displayed, for instance:
`2015-01-01 10:00:00`
instead of
`01/01/2015 11:00:00`
for a user in English(US), in UTC +1.
fixes#5324
opw-653625
Closing a task associated to a sale order line requires
the write access to the according sale order line, that
a user who is only a Project > User does not have
by default.
Fixes#9286Closes#9352
When clicking on button "add_to_cart" for a product with several options,
the user must be redirected to the product page. In this way, the user can
choose the options, he wants to buy with the product before adding the product
in the cart.
opw:653356
Add ACL on resource.calendar.attendance for HR Officer
according access right on resource.calendar
Otherwise, this isn't possible for HR officers to
manage Work Details (`resource.calendar.attendance`),
while they can manage Resource Calendar (`resource.calendar`)
Closes#9330
The messages dates in the groups pages
- /groups/<model('mail.group'):group>/
- /groups/<model('mail.group'):group>/<model('mail.message):message/
Did not take into account the user timezone, and always displayed
the date in UTC time.
opw-653508
When we had things like or & in a text we want to translate,
the translation system would save it unescape (so \xa0 and &).
So in this instance, the traduction would not match the real source
which was not subjected to this unescaping.
opw-653173
note: fix is courtesy of dle (no need to forward port after saas-6)
When a selection field with widget="radio" is False, the form view display the previews value for this field.
1 - Create a selection field (ex: [("1", "1"), ("2", "2")]), and display it on a form vue.
2 - Go to the form view (all the record have False value for this field).
3 - Change the value of this field for one record.
4 - In readonly mode, all other records now wrongly display this value (still False in DB or when "edit").
#opw-652002
People sometimes have an open POS client (/pos/web) which is associated
to a closed POS session. This causes multiple issues. The most important
problem occurs when a user closes the session and opens a new session
without refreshing the POS client. When doing this new POS orders will
become part of the old, already closed session and no new accounting
entries will be generated.
In order to fix this we make sure to check that the session that's
associated with the order that we get from the client is still open. If
it isn't we'll try to find a new, compatible session and add the order
there. If we cannot find a compatible session we'll create a new one
based on the old, closed one. When creating this new session we bypass
the opening_control phase which normally takes care of opening cash
control.
opw-652356
This is possible to have a child menu without URL.
The condition checking if the `active` class
must be added or not must take that into account.
opw-653132
The currency of the delivery method should match the currency of the
company. Indeed, the price specified in the corresponding product is in
the currrency of the company and does not depend on the pricelist.
opw-652716
v13 of the POSBox image is vastly different from all the previous
versions. On top of that it contains a lot of new features. Because of
this a lot of the POSBox documentation had to be rewritten. While doing
that, we also decided to move the documentation to
odoo.com/documentation/user instead of keeping it here.
If the main object is not set, the default object used is 'ir.ui.view'.
One of the consequence is that website SEO metadata will be stored on
'ir.ui.view' instead of the correct model, in this case 'blog.blog'.
This will cause the SEO metadata to be the same for all the blogs.
opw-651898
This is not impossible to have a submenu without URL.
The condition to set the menu item as active or not
must therefore take that into account.
opw-652688
In a real environment with a big dataset,
the query reponse time decreased from 750s to 6s,
by using a join on the sub-select instead of redoing
the select for each line.
Fixes#8812Closes#9128
Using BIGINT id instead of Text
- This doesn't change the behavior, just the variable type,
while being much more efficient.
Using `UNION ALL` instead of simple `UNION`
- This doesn't change the behavior either,
as the ids of each sub select cannot collide
Closes#9197
opw-650598
The URL for the Google Spreadsheets slightly changed
It's now `docs.google.com/spreadsheets/`, and no longer
`docs.odoo.com/spreadsheet/`
The domain is therefore changed to support both cases
opw-651847
When confirming the portal access management wizard,
the invitation email was sent to
users already having access to the portal,
while it should be sent only to
the users for who the access has just
been granted.
opw-650357
Set no_recompute to True
in order to speed up barcode picking UI
This is done for the same reason than
7b306fc17a
merged through #6754.
The remaining quantities will be computed in the
`do_transfer` method, thanks to the call
`picking_recompute_remaining_quantities`.
There is therefore no need to recompute
the remaining quantities for each pack operation.
Closes#9142
opw-645883
In a multi-company environment, you might not
have the access to the stock location
`stock.stock_location_stock`,
in such a case, you should not set it as default value.
This is a regression of revision 9bf6f0310e
opw-652387
To avoid running procurement in exception or cancel state.
Before the fix:
After cancelling a MO, when recreating the delivery order linked to the sale order in state
"Shipping Exception" the system generated 2 more copies of MO (1 Extra) instead of just one
for the cancelled MO.
After the fix:
Just one MO is recreated for the cancelled MO.
opw:650395
Follow-up of 5ac77c9 which solved the issue when an association was
selected, but not when "All Members" was choosen.
Before this commit, the displayed membership lines would only be the
paid ones, if an association (membership product) was selected. With
this commit this is also the case when no such association is selected.
This commit also correct the member counts in the "country" list :
* with "All members" the free members were not in the counts,
* with not "Free member", the counts didn't took the eventual current name search.
closes#9083
opw-648627
When reading the view
`account_analytic_analysis_summary_user`,
through the function fields using `_analysis_all`,
it could lead to an
`integer out of range` if you have a bunch of
`res.users` and or `account.account`. Casting
the multiplication of the integers to a double
solves the issue.
opw-652152
This reverts commit bd9cbdfc41.
The above revision solved the SQL constraints not being
translated when raised. They were not translated because
the context, containing the lang, was not located as expected
in the `kwargs` dict.
While it solved this issue, it had as side-effect to raise
`current transaction is aborted,
commands ignored until end of transaction block` errors more
often when using the web client.
This can be explained by the double check, when the first
check raised this error
- which can happen, e.g. when the cursor is closed,
there is a retry mechanism in such cases -
and by the fact the transaction was not rollbacked.
This issue could have been solved as well by rollbacking
the transaction, but it is regarded as not-so-clean.
Therefore, to solve this issue, while still having
the SQL constraints translated, we apply the
second patch proposed in bd9cbdfc41
commit message, which is not-so-clean as well, but
which is a proper solution.
opw-651393
'state', 'in', ('draft') is an invalid definition, ('draft') is not a tuple
should have been ('draft',)
Replacing by simpler 'state', '=', 'draft'
Fixes#8115Closes#9016
When delivering partially a picking in which the moves
had an owner (`restrict_partner_id`) set,
the owner were not kept in the backorder moves.
Closes#4693
In the landed cost types form view
(landed costs types being nothing else than `product.product`),
we force users to choose an account of type `other`,
in order to prevent them from entering wrong data,
other types of accounts,
or receive an error message when setting a view account type.
This domain is actually the domain already applied in the
regular `product.template` and `product.product` form
view, thanks to `account.product_template_form_view`
Closes#4719
To reproduce use a form view with a one2many editable list and create a lot of lines. Then click a few times quickly on the delete.
If the user click at least two times on delete of a same record, the dataset add the id in "to_delete" the virtual id because "to_create" doesn't contains the virtual id of the record deleted previously.
E.g.: create a "Customer Payments" and select a "Customer" and "Payment Method" who generate a lot of "Credits" lines.
Double clicking on the confirm button was actually possible and could confirm the orders multiple times (which could be problematic if some action are linked to the so confirmation)
Before this fix, it was possible to validate then cancel a quote (or the other way around) simply by using two tabs in your browser. From now on, we only validate/cancel a quote if it's the 'sent' state and advise the customer of the situation if he tries to abuse the process.
Initialise quant_dict inside for loop as doing outside loops
renders to be a quadratic write of quant object due to the fact that
previous quants are kept each time a new valuation line is read.
In case of posting a Landed Cost record with a huge amount of cost_lines
and huge amount of stock_move having several quants would result in a
extra overhead.
Closes#9005
Since we're not duplicating work items when duplicating tasks during
project duplication, it doesn't make sense to duplicate the
likely correspondingly adjusted remaining hour.
Behave as if the planned hours had just been set/reset and set the
remaining hours of the new task to that instead.
fixes#8985
Sometimes it's useful to ssh into a posbox to quickly troubleshoot an
issue. Talking customers through port forwarding is very difficult
however. We use ngrok to solve this issue.
This implements an interface that allows a user to enter an ngrok
authentication token. After this, ngrok can be started and we should be
able to remotely connect.
Note that ngrok does NOT run by default on the posbox. It can only be
started manually by the user.
Every time the posbox boots it would say something like:
This raspberry pi is not configured, please run raspi-config
Which is a leftover from the original raspbian image. Raspi-config is
removed on the posbox because we don't need it.
This allows people to connect the posbox to networks using a wireless
network adapter.
When plugging in a USB Wi-Fi adapter and no network cable, the posbox
will boot and host its own Access Point called "Posbox". Users can
connect their device to this network and can then connect to the posbox
the usual way.
An interface for has been provided that also allows users to instruct
the posbox to connect to a different Wi-Fi network. This is useful when
the client is not running Odoo locally.
It is also possible to make this configuration persistent. With a
persistent Wi-Fi network configuration, the posbox will always try to
connect to the specified network after a reboot.
Attempts have been made to make the Wi-Fi connection as robust as
possible. Upon connection loss, the posbox will automatically attempt to
reconnect.
The current default values leads to standard proposals of 6 digits
account numbers and in many cases wrong default tax settings. The fix
prevents most users to apply manually the right settings of digits and
default taxes.
Closes#8837
We search for USB devices that identify as a printer through their
DeviceClass or one of their InterfaceClasses. The issue is a lot of
printers use vendor-specific Device/InterfaceClasses.
Apparently the Epson TM-T88IV is one of those devices. So in order to
work around this, we now first look for a USB device that identifies as
a printer. If those do not exist, we pick the first Epson device, if
those do not exist we pick the first Star device.
Perhaps we should instead start using some kind of probe-based approach
to identify ESC/POS compatible devices.
The code used the key vals['company_id'] while it was not checked it was present
in the write call (and it should not necessary).
If a key is not present, browse the record instead.
Fixes#8906
Users not belonging to the project user group can not access the model
project.task.history.cumulative
Hide the dashboard for them
Fixes#8606Closes#8607
Fixes#8902
In order for the payment wizard to work, the accounts in invoice header, account_id, should have reconcile=True.
In l10n_br the accounts are, amongst others, "Clientes" and "Fornecedores", a the chart of account should make them by default as reconciliable.
Previously, if there was a sale_order_id but it was wrong,
like when the sale order was deleted for example, the function
didn't return a sale order, even with force_create=True.
It used to pass the first 'if' as sale_order_id had a value, so
no new sale order was created. However, as sometimes the id was
referring to a non-existant sale_order, a sale_order.exists() test
was used later, resulting in the function sometimes returning None,
even with force_create = True.
Proposed solution is to test the existence of the browse record with
the given id earlier, instead of testing the existence of the id itself.
The field timesheet_ids (hr.analytic.timesheet) and analytic_account_id
(account.analytic.account) should not be accessible by the portal user.
Fixes#8338Closes#8354
The user creating the event should be by default in the attendees (to see the event
he just created in his calendar) and the contact on the logged call
should also be in the attendees by default.
opw:650556
Use the parameter zoom as in `google_map_img`
Change the default value to 10 to avoid changing the behaviour for existing
links (zoom was not used anyway).
Closes#8318
When duplicating a user, an email was sent to a user at the email of the
previous user (as the create is called before changing the email).
Closes#8754
The `account.account` `name` can be translated
as soon as `l10n_multilang` is installed.
Not passing the context in the calls to
the `search` method prevented to search
on the translations of this name.
Closes#4511
When selecting the contacts to recieve a massmailing, restrict to the ones
available for mass-mailing to be consistent with the menu 'Mailing List
Subscribers'
Fix#8463
During reconciliation wizard, the wizard tries to find the best match with
exisiting unreconciled lines.
When more than one line could be reconciled with the bank statement line, the
oldest line was not selected.
e.g.
- statemement line: 10€
- invoice 1: 10€
- invoice 2: 10€
- invoice 3: 5€
The statement line was reconciled with the 5€ invoice instead of the first one.
This was due to the domain not matching when the exact same amount was found.
Sign CLA for compassionCH
Closes#8767
Commit e0c1f54fd7 was supposed to prevent the message fetch in the
inbox view. However, self.is_log refers to the type of message: internal
note or message. This properly checks if the page displayed is the inbox
view before fetching the messages.
Related to #7596
opw-650208
To show the website_sale.modal, the product_variant_ids must be in the DOM
because all the prices are computed with the product_variant_ids.
From commit 0ff26cf
opw:650167
The domain for the analytic account in the `reconcile with writeoff` wizard
should be based on the `type` field, which must be `view`,
not on the `parent_id` field, as it's done everywhere else
(e.g. in the supplier invoice form).
`[('parent_id', '!=', False)]`
and
`[('type', '!=', 'view')]`
is almost the same, but the second domain is more appropriate.
Closes#4562
When creating the invoice of a sales order, from the sales order
(`Create invoice` button on the sale order),
the journal used for the invoice was forced
with a specific domain. Besides, the only reason the journal
is forced is to check there is a sale journal for the
quotation company, and raise a warning if not.
This check was added in 1578c2858d.
This prevented to use the user defined defaults,
(`Set defaults` in the `debug` menu)
to set a different default journal per user.
Using the `default_get` instead solves this issue,
as it uses first the user defined defaults. Besides,
if no user defined defaults are set, it then uses
the default value set in the field definition, which
in this case returns the same journal then the forced
domain mentioned above, the domain used being the same.
There is therefore no change of behavior, while giving
the possibility to use the user defined defaults.
Fixes#8786
`qty` is the quantity in the product default uom.
`move.price_unit` is the price unit of the product
in this move, for the specific uom of this move.
The quantity to use is therefore the quantity
in the move uom, `move.product_qty`
Closes#4555
This revision adds the possibility to use the key
`default_category_id` in the context to set
the UoM category when quick creating a new UoM,
like it's the case everywhere else with the
`default_*` keys passed in the context.
Closes#4407
Users subscribed to creation of records (new leads in a sales team, new
tasks in a project, etc.) are never notified. The reason is that users
were subscribed after the record creation notification.
Introduced in 43915a8721Closes#8723
When ordering on the ecommerce,
if a payment transaction was found in the session,
this transaction was used as transaction for the current order.
Nevertheless, if the transction is no longer linked to
the current order, we should not use it.
This happened, for example, when the quotation
was deleted while the customer/user didn't close
its browser, and the transaction id was therefore
still in its session.
opw-650417
This revision is related to:
- 503820acb6
- 3b02e3d63d
The taxes used to define the price must be the product taxes
of the company of the order.
Closes#8759