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
In a SO, the unit price of the suggested products must be computed with
the pricelist linked to this SO. Inspired from function 'product_id_change'
in model 'sale.order.line'.
opw:650168
For report with duplicated named headers, several columns could get
squashed together.
This fix check if a value is a duplicate or not, and if it is a
duplicates postfix an number allowing to differentiate the two headers
(for the human and the javascript).
This is the exact same solution than #6722
Backport of 5cff8fbb7c70a372cb5116c2fb98fd622c4d4358
opw-650000
This change avoid to display the tasks
that a user is not permitted to see
in the reporting view 'Task analysis'
Closes#4399
Courtesy of jkei
https://github.com/jkei
This is possible that changes happen
during the loop in the multiple pickings:
an update in a picking could update another
picking. The browse must therefore be done
inside the loop to update the pickings with
the latest changes.
Fixes#4201
In the module `purchase_double_validation`,
you can change the limit to require a second approval
in the purchase settings.
If the module was updated, the limit was re-set to
its default value.
Closes#4183
When adding a `%` in the followup letter content,
the constraint checking there is no syntax error
is supposed to raise a warning, telling '%' must
be set as `%%` when you want to display this percentage
char.
This constraint did not take into account the translation,
so when being in another language (e.g. French),
and adding a `%`, the warning was not raised, while
it should have been.
Closes#8680
In the case where target_currency == company_currency, the actual_debit or the
actual_credit must be equal to the amount_residual defined on the account.move.line
and expressed in the currency of the company. The actual_debit/actual_credit must
take into account the possible partial reconciliations and this is done by the
residual amount.
opw:648744
This revision is related to 6f355623f0.
The above revision had as goal to not allow the partial cancellation
(line per line) of a confirmed bank statement, as it would
prevent the ability to reconcile the statement, as reconcilling
a confirmed statement it not possible.
Nevertheless, cancelling the whole bank statement should be allowed
(using the `Cancel Statement` button), as this cancel all lines
and re-set the statement in draft.
opw-649864
fixes#8568
When invoice_method == 'picking', a po line is invoiced if all the lines
linked to the po line are in invoices with state not in ['draft', 'cancel'].
To keep the same logic than before commit 9b1ab76.
opw:649746
The journal_id used in a purchase.order created in auto procurement
(by the function make_po) must be the journal_id of the company_id
set on the procurement. The company_id set on the procurement is
the company_id set on the SO (function _prepare_order_line_procurement).
When creating the PO in function make_po, the company_id must be set in the
context to use the right journal_id with the function _get_journal in
"purchase.order" model.
opw:648600
The tax code of `Iva al 10% indetraibile (D)`
is `template_ivacode_pagata_10ind`, like its
sibbling `Iva al 10% indetraibile (I)`.
The fact it wasn't is due to a typo.
Something similar is done with the taxes
`Iva al 20% indetraibile (D)`
and
`Iva al 20% indetraibile (I)`
with the tax code `template_ivacode_pagata_20ind`
opw-649557
Closes#8047
The structure `filename*=UTF-8` works in Safari, from
release 6.2 (which is set as version 537 in the user_agent version).
This structure has the advantage to handle the UTF-8 encoding,
and therefore special characters, such as accents.
Therefore, from this Safari release, we use the same format
than other browser. For older releases, we use the format
`filename=`, without UTF-8, ASCII encoded, replacing
special characters by `?`.
opw-649863
It was allowed for all employees to read, create and edit
mail aliases. Only the deletion was prevented.
Nevertheless, giving the possibility to rename a mail alias
is allmost seen as a deletion, as you can rename it to something
that just won't be used anymore. Therefore, we can consider
to give any employees the rights to delete mail aliases.
Besides, not allowing the unlink leads to issues when the
mail alias is associated to a record the user wants to delete.
He was able to create the record, and its mail aliases, but
he could not remove the record, as he was not allowed to remove
the mail alias.
For instance, an HR officer was able to create a job position,
with its mail alias, but couldn't remove the job position he created.
Closes#8466
[FIX] Valuable checkout hooks for website_sale
[FIX] Values might need to be changed for different field mappings
[FIX] Make definition of form fields inheritable within a function
[FIX] Make shipping_info values available for inherited module manipulation
Close#8490
-The lang of the partner linked to the "event_registration" record
must be used to send the registration/confirmation email.
-strftime cannot be used on a string.
opw:649510
jQuery has a special behaviour when using .contents() over an iframe
object. This caused an error for escaping when saving the page with an
iframe content of an external domain.
introduced by 8c77c711
opw-649570
The delivery line in the SO was added among other lines,
in second most of the time, due to the fact
the sequence of the line was set after
all other order lines sequences.
opw-649629
In order for the printer to work we need to configure it in USB vendor
mode. This means it will not have a USB interfaceClass of 7. So when
we don't find any USB device that identifies as a printer, we search
for Star devices and use the first one of those we find.
This should be reasonably safe because Star does not manufacture other
devices apart from printers that one would attach to the posbox.
Although it might be a good idea to make sure a printer device is
properly closed, trying for >1 min to do so is too much. It can cause a
>1 min delay between receiving a receipt and actually printing. Also,
just because the device is not cleanly closed does not mean that it will
not work when we open it again.
Fees were not recomputed when the amount or the acquirer of the
payment transaction was changed.
This can happen if the user clicks on
"Pay now", which creates the transaction and computes
the fees for the first time and then redirects
to the payment provider, and then the user
came back from the payment provider, hitting the previous
button in his browser, for instance, and then
changes the content of his cart (the quantity, or even
the products) or change of payment provider
(from Ogone to Paypal, for instance).
opw-649509
The function "open_table" is not called when triggering the action
window "Current Inventory Valuation". Then the 'history_date' is not
set in the context.
opw:649168
Add multilang=False to website_image controller to prevent redirects
Because website_image is decorated with website=True
Requests made for the product image at
`/website/image/product.template/xx_xx/..`
triggered redirections to add the language code to the
requests URLs. This redirection was useless, as setting
the language code for images is non-sense.
Adding `websitelang=False` prevents this redirection.
In addition, the redirection could lead to
SSL security concerns, as the redirection
could use the http:// scheme.
Closes#8515
The function interval_get_multi must take into account the minutes in
hour_from and hour_to. hour_to and hour_from are float fields in the model
"resource.calendar.attendance" and the decimal part of these two fields is
for the minutes.
opw:648349
The widget SelectCreatePopup display the search view drawer directly
after the search view input field. But in current firefox version this
could lead to an issue with float positionning.
fixes#8462
opw-648999
In 7d40a7d, f820c07, 3ed0628 the way the mobile preview iframe is set
was altered several times. This left an inconsistent needless page load.
This page load was cancelled, but as a side effect in a given set of
conditions:
- an ajax request is done early in current (and so iframe) page,
- phantomjs is used for the test,
- server response time
this could lead to a false positive caused by a cancelled xhr request
throwing the error: "Can't load template, http status 0".
When creating a SO in dropshipping with 'create invoice' = 'on delivery order',
the resulting invoice must not be linked to the PO but to the SO created.
Inspired from '_create_invoice_line_from_vals' in addons/sale_stock/sale_stock.py
opw:647628
The undiscounted amount did not take into account the taxes
included in the price. Included taxes were seen as a discount.
For a quotation with one line with an included tax of 15%,
but no discount, the undiscounted amount must be the line price subtotal,
the price subtotal already removing the taxes from the price unit.
For a quotation with one line with an included tax of 15%,
and a discount of 10%, the undiscounted amount must be the line price subtotal,
plus the amount discounted. That way, the taxes included are already removed
from the price, but the discount is not included.
opw-648388
The former cost of a stock.valuation.adjustment.lines line is the sum
of cost * qty of each quant linked to the stock.move record linked to
this line (with the field 'move_id').
opw:648922
Backport of 1989495 without breaking existing translations.
do not forward port in 9 where proper fix has been made at 1989495.
Do not generate the messages by putting bits of sentences together.
Other languages do not have the same structure (and 'have not' was not
translated anyway).
For 8.0 keep the same source for the base error message but create a new one for
the negation as it was wrong in other languages.
When delivery_set is called from the website_delivery module, the
uid is set to SUPERUSER_ID. In a multi-company environment, this
causes the linked taxes from the delivery product to be added
to the sale_order_line.
Closes#8311
Check receiver_email only if receiver_id was not checked.
In Paypal, this is possible to configure as receiver_email
a different email than the business email (the login email)
In Odoo, there is only one field for the Paypal email:
the business email. This isn't possible to set a receiver_email
different than the business email.
Therefore, if you want such a configuration in your Paypal,
you are then obliged to fill
the Merchant ID in the Paypal payment acquirer in Odoo,
so the check is performed on this variable instead of the receiver_email.
At least one of the two checks must be done, to avoid fraudsters.
opw-648776
The product search field already handle product scanned by a code bar
(by adding it if it corresponds to only one product to the order) so
when the barcode is entered in this search input, the scan doesn't need to
be done.
closes#8433
opw-648856
As eCommerce is not complete and could be improved easily and was
not working anyway until
9d0cb024fd
- Use EAN13 instead of internal product id if available
- Add tax to transaction data
- Add shipping costs if available to transaction data
For an event during all day, during 2 days,
e.g. September 9th and September 10th,
Google expects as start date the first day, and as
stop date the day after the last day.
e.g.
start 2015-09-09
stop 2015-09-11
Even if, afterwise, in the Google Agenda interface, it will
be correctly displayed 2015-09-10 as end date.
This must be applied at the event creation AND at the event
update. It was not the case until this revision.
Besides, we now use the event `stop_date` in Odoo, instead
of the duration, in case the duration has been incorrectly
computed.
opw-648867
`False` is not syntax valid for a domain.
It leads to errors when trying to evaluate `False`
as a domain in the evaluation of `pyeval.js`.
Therefore, using `False` as default value for `mailing_domain`
isn't correct
opw-648857
Correctly use the email_from tag from template.
This partially reverts commit 0f82346167.
"[FIX] email_template: keep email_from and outgoing server"
Remove the email_from part that was incorrect, keeping the one on mail_server_id
Instead of assigning an non-evaulated email_from in the context, specify the
email_from in the onchange method. This way the created email has an evaulated
from value. This was an issue for templates using email_from like
"${(object.user_id.email or '')|safe}"
In the _notify method method, the email_from is partially respected as it will
be used a fallback only. However changing that would introduce a modification of
behaviour not suitable for 7.0 branch.
Fixes#8409
In Accounting > Bank and Cash > Cash Registers, when clicking in "More" button
on 'Put Money In' or 'Take Money out', the date used for the bank statement line
created must be the date of the bank stattement(same behaviour then when clicking
on "Add item" in edit mode). It's forbidden to put/take money in/out for a bank
statement which is not open.
opw:647631
To compute the intervals of working time, the function interval_get_multi
used 'hour_to' and 'hour_from' from "resource.calendar.attendance" model. 'hour_to'
and 'hour_from' are not in UTC timezone. All the dates in odoo are compared in UTC.
Then 'hour_to' and 'hour_from' must be converted.
To take into account the minutes in this computation, the minutes from the start date
are added in the variable todo (number of working hours).
opw:648349
Complement of the fix 6f355623f0
Adds the button for cash registers as well since the base view is
different than the one for bank statements.
Closes#8410Closes#8342
The product_id_change was always triggered at the creation of a sale order line.
This is due to the 'type' field that is no longer present in 8.0 and makes the
condition to be always verified.
When a account.bank.statement.line is created by clicking on "Put Money In"
(Accounting(Menu)>Bank and Cash(Menu)>Cash Registers(Menu)>More(Button)>"Put Money In"),
the account.bank.statement linked to this line must be updated(by passing in the write of
this model) to compute the real closing balance. This fix allow to have the same
behaviour than when a line is manually added (with "Add Item) in an account.bank.statement.
opw:647631
The `check` decorator expects the context to be in the `kwargs`
or to be the last arguments of the method.
The `call_kw` route, which is decorated by the `check` decorator,
like every route,
expands its kwargs arguments.
Therefore, once in the `check` decorator,
the context is located in the `kwargs` key
of the kwargs.
(More simply, instead of
`kwargs.get('context', {})`
it's
`kwargs.get('kwargs', {}).get('context', {})`
As the context is not retrieved correctly,
the lang is not set correctly either,
and the sql constraints were not translated.
In 7.0, it worked, because there was a double
check, as the call_kw was called trough an rpc
(`dispatch_rpc`) call,
which was decorated by the `check` as well.
As a fix for 8.0, we apply the same logic,
we perform a double check, with an indirection.
The check decorator should probably be
refactored, but this cannot be done
in a stable release such as 8.0.
Closes#3634
To compute start and end date of a working interval this function replaced
hour in datetime object without taking into account the time zone. The start and end date
taking respectively from calendar_working_day.hour_from and calendar_working_day.hour_to are
in the time zone of the user and the datetime object are compared in UTC to avoid schedule's gap.
This is why the start and end must be converted in UTC after being replaced by these hours.
The tz_info must be removed from dates because it's forbidden to compare naive and aware dates.
opw:648349
With 3e82c94d we use the timezone in the context to format date
sequences when formatting an ir.sequence.
This commit adds the other missing context when getting a sequence, so
these sequences are also dependant on the timezone.
closes#8351
opw-646487
The total used to check which delivery.grid.line to apply must be in
the currency of the company because the delivery.grid.line records with
variable == Price are expressed in the currency of the company.
opw:647799
When creating timesheet,
default from-date and to-date are adjusted for user timezone.
Fixes#3627
User timezone considered when assigning attendance records to timesheet
Fixes#3628Closes#3632
Written in the new API even though the rest is in the old API, because otherwise we'd have to add an onchange in the views which may be a problem for existing custom modules.
We want this behavior because previously, in some cases the default values were only added at create() time, ie. possibily when the users close the pop-up, so they may never have an opportunity to see and adjust the default.
This rev. is related to 1c533b193f
The reason why we force the event Google internal id is
explained in the above commit.
Forcing the internal id must be done only when creating the
event in Google, not when updating, for retro-compatibility:
if the event is already in the attendee calendar, with a different
internal id then the other attendee, we must leave it like this,
otherwise Google will be lost.
This rev. is related to a9e3d74713
This new revision is about the same use case than above, except
that both Google users login doesn't match the Odoo login email.
e.g.
User A: A@agrolait.com in Odoo, A@gmail.com in Google
User B: B@agrolait.com in Odoo, B@gmail.com in Google.
When A creates an event, with B in the attendees, and
syncs his calendar to Google, B is not automatically invited
Google side, as his attendee email is B@agrolait.com, which
doesn't match any existing Google User (doesn't match B@gmail.com)
While the revision mentioned above, a9e3d74713,
expected the attendee to be automatically invited Google side, and therefore
expected the event to already exists in B's calendar.
Therefore, when B syncs his calendar in Odoo, as the event
was there in his Odoo calendar, but not in his Google Calendar,
the code actually think it's no - longer - there, and take the assumption
the event has been deleted Google side. So, it deletes the event
in Odoo side as well, for both users A & B.
To overcome this new issue, when the Google & Odoo users emails
do not match, while keeping the compatibility when the Google & Odoo
emails do match (and therefore the invitation is automatically sent
Google side, as the email matches an existing Google account, and
the event is automatically created in B's calendar without needing the
sync in Odoo), we now force the Google internal id to be the same
for all attendees of an event, event by Google side.
opw-645745
Confirm lines of account cash statement on closing
The `account_bank_statement_extensions` adds
a state field to account.bank.statement.line
and sets the status to 'confirm'
when a bank statement is closed.
When a cash statement is closed,
the lines remained in draft.
Closes#3584
`hr_timesheet_invoice.py` overrides `on_change_account_id`
of model `hr.analytic.timesheet`.
The super call wasn't done, probably because this on_change
method in the base model was trivial:
`return {'value':{}}`
Nevertheless, if another module overrides this on_change,
according to the module dependences,
this method could have been called first in the calling chain,
discarding the changes from the other overriden
`on_change_account_id` methods, preventing
any customization in this on_change according to the
current database state.
Closes#8248
When we export a recurring event, there was an error since there is
virtual ids (like '{real_id}-{date_of_the_event}').
Events steming from a recurring events are in fact shown virtually. In
the database there is really only one event and a suffix is appended to
the id to target a given instance of a recurring event.
If we want to separate a recurring event from the instances, we can edit
the instance and use the link "Update only this instance", once done
this instance is separated for the recurring event.
This commit if one or more recurring events instances are selected when
an export is done, will only export one source event of each of the
events occurences.
fixes#7932closes#8262
opw-647676
Regarding _schedule_days, similar thing was done in
saas-6, @ fd5e7f2.
When the argument `days` was negative, the
returned intervals were wrong.
Regarding `get_working_intervals_of_day`,
calling this method without
`default_interval` and calendar
set crashed.
Closes#8208