Fixes#33254:
* was in mail despite using mail.channel (which breaks if mail is not
installed, and web doesn't depend on mail)
* changes to sudo() broke previous behaviour (of having odoobot
message the admin, we ended up with the admin messaging themselves)
so fix that
* also get the channel and message with the user's context, otherwise
since we're during the login procedure the context could be as
little as just the lang from the browser and apparently channel_get
automatically creates a translation which would break if the
browser's lang is not installed in Odoo
closesodoo/odoo#37580
Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
[`psycopg2` includes a submodule called `sql`][1] which provides more safety and comfort when dealing with raw SQL queries.
As of today, it works fine with Odoo unless SQL query logging is enabled.
This patch fixes that problem, allowing usage of that module.
[1]: http://initd.org/psycopg/docs/sql.htmlclosesodoo/odoo#37561
Signed-off-by: Christophe Simonis <chs@odoo.com>
only activate multi-edit on list with specific attribute.
When the attribute multi_edit="1" is set on the tree view the user
can select a/some records and it will activate the multi-edit
with confirmation dialog (even for a single record).
Also, on-change are not applied when using multi-edit
closesodoo/odoo#37525
Signed-off-by: VincentSchippefilt <VincentSchippefilt@users.noreply.github.com>
Due to the merge of account.invoice.line and account.move.line
some views doesn't exist anymore.
On desktop, we only need editable list view to do the job but
it's not the case on mobile!
On mobile, the kanban view is loaded instead of "tree" and
the form view is opened when we add a record.
Before this commit, the corresponding form view wasn't usable
on mobile and some fields were hidden like product_id.
As kanban view and form view are important on mobile, we get them
back like on saas-12.3. So the workflow is quite similar as before.
Steps to reproduce:
* Open Odoo in mobile
* Go Accounting App
* Create a new record
* Add a new line
* There is no product field (BUG)
Task ID : 2061797
closesodoo/odoo#37424
Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
Move and adapt gantt unavailability related methods (
_get_work_interval() and _get_unavailable_intervals() ) from
hr.employee to resource.resource. This move allows the unavailability
to be generated for users without related employees (like in FSM in
enterprise).
Task-2069861
closesodoo/odoo#36785
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
Before this commit, automations triggering on new records caused onchanges to break out-of-context record rules, hence preventing to create the record.
This commit filters out new records from the list of records matched by the domain of an automation.
task-1998636
closesodoo/odoo#37360
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
Co-authored-by: Raphaël Collet <rco@odoo.com>
purpose of this commit is to show payment token while making payment with sale order
before this commit:
in SO payment, there is a filter for s2s acquirer, and becuase of that filter, if brings
tokens of the acquirer which is set to s2s currently
after this commit:
payment token will be shown for particular user, now it will not depends on mode of acquirer
task- 2028285
closesodoo/odoo#37562
X-original-commit: 0ebfe8575a8bac0f6b4c0ba1f1084701d73c4c74
Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
- Remove the useless domain set on the field.
- Fix the belgium PCMN to work with accrual.
closesodoo/odoo#37560
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
- Create a workcenter with a capacity of 500 units
- Create a BOM with a routing generating one work order in the WC
created
- Create 3 MO with the following real durations:
MO 1: 1000 units produced in 420.95 seconds
MO 2: 1000 units produced in 120.28 seconds
MO 3: 1000 units produced in 60 seconds
- Create a MO for 1 unit
The Duration expected is computed as
The Time Cycle is computed as:
(420.95 + 120.28 + 60) / (1000 + 1000 + 1000) = 0.20041
The Total Expected is computed as:
0 + 0 + (1.0 * 0.20041) * (100.0 / 100.0) = 0.20041
0.20041 seconds is not realistic based on the previous MO real
durations.
This is because the Time Cycle doesn't take into account the workcenter
capacity. If we can produce 60 units in parallel in 60 seconds, that
doesn't mean we can produce 1 unit in 1 second. Therefore, the Time
Cycle should be multiplied by the WC capacity, which gives a Time Cycle:
500 * (420.95 + 120.28 + 60) / (3000) = 100.205
Which is much closer to the real duration.
opw-2070759
closesodoo/odoo#37548
X-original-commit: 9d3a73f64feb3b9e71c50a04adb6206b6393c757
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Section 7.1.2 of RFC 7231 requires preservation of URL fragment
through redirects. Our old JS redirection code was necessary when
browsers did not consistently implement it. Apart from a few odd
and marginal exceptions they all do it now, so we can stop that.
Before this commit, when a hierarchy of options was displayed in the
editor left panel and that the user click on any one, the related
snippet was enabled making all the children options disappear (like
the "go to parent" button in the old UI). Now we only keep this behavior
when we click on the title of the snippet's options.
closesodoo/odoo#37538
Signed-off-by: Quentin Smetz (qsm) <qsm@odoo.com>
- Connect a real barcode scanner.
- Start a POS session.
- Scan a product. The product appears in the list properly with a quantity at 1
- Scan the product again.
Before this commit:
After the second scan the quantity is the number represented by the barcode.
The reason for this being that it's allowed to type a quantity with a numpad,
but the scanner works pretty much like a keyboard.
After this commit:
Scanning a product multiple times just increase the quantity by one. But you
can still type the quantity with a numpad, provided you don't type as fast as
a barcode scanner.
closesodoo/odoo#37530
Opw: 2075470
X-original-commit: db3ae61c00364894fef4684f34143f1cf575e882
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
— Have a POS in a multi-companies environment;
— the multi-companies environment configuration don't have a 'Common
Contact Book';
— user 'A' open a session in the company 'Z';
— user 'A' closes the POS without closing the session;
— user 'A' change of company to company 'Y';
— user 'B' opens the POS application in company 'Z'.
Before this commit, an error message was shown, because user 'B' didn't
have access to the name of user 'A' when user 'A' is not in the same
company.
Now, the name of user 'A' is shown correctly in the dashboard.
opw-2075388
closesodoo/odoo#37529
X-original-commit: b149522b281a5fcf8fe6d3d7421e364acb46e888
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
The notification for quotation/sale order would always say "See Sale
Order" and things (in the notification view, not inside) and not
"Quotation" if it is a quotation.
Do something similar to what was done for purchase in 3f72a8fab.
note: foward port of #37395 (half-fix is in 25153b but not translatable)
opw-207060
closes#37463closesodoo/odoo#37519
X-original-commit: fe3df270e19f77ce5d29b101f32834e96089a0d6
Signed-off-by: Nicolas Lempereur (nle) <nle@odoo.com>
Currently if we try to display image of a rating having a different value of
0/1/5/10 there is an infinite loading. Indeed images for rating are limited
to those values.
In this commit we fix that by computing a rounded value to find the closest
image.
Text display in form view is also centered for better wow onboarding back 2
basics demo usability fiximp effect.
This commit slightly improves the utm.campaign kanban view by reordering statistics and changing
their display.
Task#2077579
closesodoo/odoo#37518
Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
The import button on timesheet list view is not visible
for now. This commit makes it reappear, as we want to
handle that use case, since it is a common action for
end user.
opw-2077117
closesodoo/odoo#37498
X-original-commit: 5fb7ab44e1a113339c2ad797dfd2eb8ddfa4bf78
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
Suppose the following workflow:
- Creates a new vendor bill.
- Set an accounting date but no bill date.
- Post the vendor bill => accounting date / bill date are set at today.
This behavior is due to the fact the user didn't set a bill date.
This commit aims to set a default bill date to encourage the user to edit it
instead of letting it empty.
Any new line (components or by products) in the produce wizard
will be now added from the bottom of the One2many widget.
closesodoo/odoo#37514
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
Suppose a tax cash basis without account_id set on any repartition lines.
Before this commit, the generation of the cash basis entry failed because
odoo tried to create an account.move.line without account_id.
With this commit, a fallback is made on the base line account_id in case
of missing account_id on the tax repartition line.
closesodoo/odoo#37499
Signed-off-by: Laurent Smet <smetl@users.noreply.github.com>
This commit moves most of the logic of cover edition to website. This
will allow to define cover on other non-blog models, like events.
Note: this also "accidentally" fixes a crash during rendering of the
blog page when there is no blog or post.
Part of https://github.com/odoo/odoo/pull/37009
task-2043872
When copying a task, we need its company to be the
one in its new project.
Task-1999686
closesodoo/odoo#37108
Signed-off-by: Jérome Maes (jem) <jem@openerp.com>