Commit Graph
127840 Commits
Author SHA1 Message Date
Yannick Tivisse 7fdc3a1890 [FIX] base: Allow to create an user
Now that an onchange set its result into the cache, we
cannot create a user because the onchange tries to put
the reified fields (eg: sel_4_7) into the cache.

As those field don't exist and are pseudo-fields used
to manage groups into the res user form view, we should
replace the values by ORM commands on the groups_id field,
as this is already the case in the create and the write
methods.

Note: Initially merged in saas-12.4, but was not
forward ported, I don't know why.

closes odoo/odoo#34487

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-09 09:13:58 +02:00
Goaman 04114043bb [IMP] account: Allow to merge and print original vendor bills
This commit add an action to merge and print the original vendor bills
through the field 'message_main_attachment_id'.

Was task 2006908

closes odoo/odoo#34023

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-07-08 12:10:51 +00:00
Goaman b82a6cdea2 [IMP] base, ir_actions_report: allow to merge pdf and images
This commit allows to merge, in a single pdf, different streams comming from both PDFs and images.
To achieve that, the dictionary save_in_attachment used in method render_qweb_pdf() has been changed to now store streams instead of ir.attachment records. That allows to process each of them equally to render them.

Was part of task 2006908
2019-07-08 12:06:49 +00:00
Kevin Baptiste 544476f945 [IMP] hr_work_entry: improve work entries error management
`display_warning` is now replaced with the `conflict` state.

closes odoo/odoo#34653

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-08 11:45:47 +00:00
Yenthe666 8dcc4f9d94 [REM] web: remove old changelog
Was for 7.0, no longer needed in 13.0

closes odoo/odoo#32922

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-08 12:23:23 +00:00
Yenthe666 f042c62916 [IMP] base_address_city: prefill country
When creating a state from the Cities list, the country was not prefilled.
Use the parent record

Closes #30135

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-07-08 13:14:45 +00:00
Nans Lefebvre b65d5efd02 [FIX] mrp: show the real duration for all users
The duration field ('real duration') only showed the duration spent
for the currently logged user; this was confusing to user.
We remove the domain on the user to show the same duration to all users.

opw 2029830

closes odoo/odoo#34649

Signed-off-by: Arnold Moyaux <amoyaux@users.noreply.github.com>
2019-07-08 11:00:10 +00:00
ppr-odoo 1520547ca3 [IMP] account: small UX imp in 'Journal Entries' form view
don't show the 'Reconclied Entries' stat button if no reconciliation are linked to the move

task-1935597

closes odoo/odoo#31149

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-07-08 10:26:52 +00:00
Simon Lejeune 341a9921e0 [REM] stock: remove unused context key usage
closes odoo/odoo#34540

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-07-08 07:20:37 +00:00
Simon Lejeune d3a23ab5ec [REM] stock: unused last_done_picking field 2019-07-08 07:20:36 +00:00
svs-odoo ca672eebac [IMP] stock: not detailed operations for receipts
Before this commit, each picking type had its `show_operation` field on
true if user actived multi locations, packaging or tracking.
Now, it still the case except for picking type for receipt.

Also, modifies onchange to reflect that when creating new picking type.

Task #2031313
2019-07-08 06:44:51 +00:00
jem-odoo 31a8616a03 [IMP] hr: add helpers to get employee unavaibilities
Those 2 methods are used in enterprise (for now) in order to get employee
unavailabilities. This is used for planning and forecast gantt view. As we
didn't want to create a bridge module for those 2 methods, we place them
here as 'hr' is the only one common dependency between forecast and planning.

Task-2024216

closes odoo/odoo#34638

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-07-05 13:06:05 +00:00
Gert Pellin 3ca2842cc1 [IMP] pos_sale: store sales team on pos order
For now the sales team is only used on the pos.config and now on the invoices generated.
When you open the sale report, you'll see the sales team of the pos.order, but in reality it is the one of the related pos config.
That means that if you change the pos team on a config. It will change the pos team of all existing order.
We should store sales team on pos order, like on invoice and sale order

TASK-ID: 2011460

closes odoo/odoo#34246

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-07-05 12:34:29 +00:00
Prakash Prajapati b85b584c34 [REF] sales_team: remove reply_to field from crm.team model
reply_to field is not used (and not available) anywhere. Its use is completely replaced by
aliases you can set on teams. Let us therefore remove this field.

Related to task 1985539

Closes #33497

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-05 11:44:04 +00:00
Patrick Hoste 68186037a2 [REM] crm, project: remove the legend_priority fields
Purpose of this commit is to remove of the legend_priority field in the crm
and project addons since they are not used anywhere.

Those were initially introduced at dd343c8633 . Purpose was to be able
to customize displayed label of priority field used in kanban view in
replacement of standard string. However kanban view does not support it
anymore since whatever web refactoring and this feature will not be
reintroduced. Let us therefore remove the fields.

Linked to task ID 1935620

closes odoo/odoo#33444

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-05 11:47:50 +00:00
Robot Odoo 1013f86bb0 [MERGE] mail: Apply some UX improvements (Back2Basics)
1/ base: use new avatar for administrator

As the current icon is white, we cannot see anything when
put on a white background, as this is the case on the chatter.

2/ mail: Remove the 'Bell' icon to edit subtypes

There are 2 different manners to edit the subtypes:
- The bell above the chatter
- The pencil next to your avatar on the followers dropdown.

It's better to have only one way to edit these subtypes.

As this is an advanced configuration that is not part of the
onboarding process, remove the most obvious way to edit it.

3/ mail: Move the attachment icon on the left

This is much better.

4/ mail: Display some tour popups on a better side

5/ mail: do not log note if note is empty

Because a note could be only False, not at least
"<p></br></p>"

TaskID: 2026295

closes odoo/odoo#34615

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-05 14:32:33 +02:00
RomainLibert 59175b96e3 [IMP] base: use new avatar for administrator
As the current icon is white, we cannot see anything when
put on a white background, as this is the case on the chatter.
2019-07-05 13:06:49 +02:00
RomainLibert 7594cb6279 [IMP] mail: Remove the 'Bell' icon to edit subtypes
There are 2 different manners to edit the subtypes:
- The bell above the chatter
- The pencil next to your avatar on the followers dropdown.

It's better to have only one way to edit these subtypes.

As this is an advanced configuration that is not part of the
onboarding process, remove the most obvious way to edit it.
2019-07-05 13:04:19 +02:00
RomainLibert 9cd3bcd440 [IMP] mail: Move the attachment icon on the left
This is much better.
2019-07-05 13:03:18 +02:00
RomainLibert a4f33b5bf5 [IMP] mail: Display some tour popups on a better side 2019-07-05 13:00:14 +02:00
RomainLibert 5ee89c0088 [IMP] mail: do not log note if note is empty
Because a note could be only False, not at least
"<p></br></p>"

TaskID: 2026295
2019-07-05 12:57:40 +02:00
Adrian Torres 407f1f6cdb [REM] api: remove helpers one and aggregate
`api.one` has been deprecated since v9 because it often makes the code
less clear and behaves in ways developers and readers may not expect
since functions decorated with it usually expect a `list` of record(s)
instead of the recordset, whereas most modern Odoo code expects `self`
to be a recordset.

The function `aggregate` was solely being used by `api.one` thus it has
also been removed since there doesn't seem to be any other use for it
thus far.

closes odoo/odoo#34555

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-07-05 09:04:45 +00:00
Adrian Torres 9e71d57d11 [REM] *: remove calls to api.one and adapt code
Adapt all code that was using `api.one` to recordset-style method and
remove any and all calls to `api.one` in preparation for its removal.
2019-07-05 09:04:45 +00:00
Robot Odoo 3fc2a27808 [MERGE] project, sale_timesheet: multi company fixes
Impacted modules: project, sale, sale_timesheet and project_timesheet_holidays.

Since a5b6f31cf2, the multi company environment is contextualized,
allowing people to see several company documents at the same time. This reveals
some problem in such env.
To solve this, we need to force the "company_id" field as required on some business
model, and to correctly propagate the company when a document generate another one.
The guidelines is to stop using company of current user, but the one of the document
itself.

See subcommits for more details.

Task-1999686

closes odoo/odoo#33739

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-07-04 18:42:51 +02:00
jem-odoo 2511841da1 [IMP] project: company field not in debug mode
We want to display company_id field on project form view only
when user has multi company access group, like every other
document in Odoo

Task-1999686
2019-07-04 15:28:24 +00:00
jem-odoo ef1afb7b69 [FIX] project_timesheet_holidays: multi company fixes
In a multi company environment, some adjustment must be done:
- the company of an internal project of a company should be in that company
- the generate timesheet on holidays validation must be in the company the
task (or internal project)

The company should be correctly propagate to timesheets.

Task-1999686
2019-07-04 15:28:24 +00:00
jem-odoo 26bc10486e [FIX] project: progate company in project on AA creation
When allowing timesheet on a project, the project generate
an analytic account if not given. When creating that account,
the company should be the one of the project (origin document)
rather than the one of the current user.

Task-1999686
2019-07-04 15:28:24 +00:00
jem-odoo ddb13a520f [FIX] sale_timesheet: propagate company
On Sales order confirmation, a project can be create. The project
company is not correctly propagated: the created project should
be in the same company as the SO.
To stay consistent, during the sold quantity conversion into the
planned hours of a task, we need to use the SO company instead of
the one of current user.

Task-1999686
2019-07-04 15:28:24 +00:00
jem-odoo 938990f698 [IMP] project: company required on task
As task can be billed, it became a important business model. To avoid mistakes in a multi company
environment, we need to make the company_id field required. Indeed shared task can be problematic
with access rights when a employee will log timesheet from another company in a task that is not in
the same company as its project.

To populate this field, we recommend to take the company of task's project, or to fallback on
the company of the user that created one.

Task-1999686
2019-07-04 15:28:24 +00:00
jem-odoo b061644e0c [IMP] sale: set company required
The sales order is a important model. Since it generates invoices and other business
documents, the company_id field should be required as the company must be propagate
to generated documents.
Moreover, a sales order without a company raises a error, and we need a company to
compute the multi currency rate.

This commit fixes that bug, by setting the company_id field required on sales order
and sale order line.

Note: we only simplify the ir.rule of sale.order, and not the one of
sale.order.line. Indeed, when creating an SOL, the creation is done
in 2 times by the ORM: first insert, then UPDATE with computed stored
fields. As company_id of SOL is a stored related, the check access rules
raises during the inconsistent state (between INSERT and UPDATE,
company_id is False).
Maybe this will be clean after the big refactoring of the ORM.

Task-1999686
2019-07-04 15:28:24 +00:00
Raphael Collet caf900e89e [FIX] *: use auth='public' in controllers that use request.env
The following trick used to work, because `sudo()` was actually making
an environment for the superuser to operate upon:

request.env[...].sudo().method(...)

It no longer works in general, since `sudo()` now makes an environment
in superuser mode but with `uid=None`!  It may still work by accident
for operations that never use `env.uid`, but is broken in general.

Using `auth='public'` fixes the problem by using the public user when no
user is available.

closes odoo/odoo#34297

Signed-off-by: Olivier Dony (odo) <odo@openerp.com>
2019-07-04 11:32:22 +00:00
Raphael Collet 6230f72d2b [FIX] mail: avoid crashing for users without email address 2019-07-04 11:32:22 +00:00
Raphael Collet 3520eee8eb [FIX] website_form: avoid default_get() to crash by using superuser 2019-07-04 11:32:22 +00:00
Raphael Collet 3b592ef5a2 [FIX] base: create asset attachments with superuser
Stick with this convention, as it prevents regular users from manually
creating attachments that match the expected url, and screw up websites.
2019-07-04 11:32:22 +00:00
Raphael Collet bd8c760e92 [FIX] test_mail: query count 2019-07-04 11:32:22 +00:00
Raphael Collet da5021f704 [FIX] mail, hr: bypass user_has_groups() in superuser mode 2019-07-04 11:32:22 +00:00
Raphael Collet 368e9530f4 [REF] *: record.env.user._is_XXX() -> record.env.is_XXX()
Superuser mode implies `record.env.is_XXX()`.
2019-07-04 11:32:22 +00:00
Raphael Collet b7fd679a6c [FIX] *: sudo() -> with_user() 2019-07-04 11:32:22 +00:00
Raphael Collet 1e6c3bec2c [ADD] api: flag su on environments
The flag defines a "superuser mode" on environments, which allows to
bypass access rights without changing the current user id.
2019-07-04 09:24:23 +00:00
rhe 541012c9ea [FIX] point_of_sale: No payment methods after validating bank statement.
Before the fix, it was possible to validate a bank statement of a POS without validating the entire POS session.
After the fix it's impossible to validate the bank statement of an opened POS session. We now have an error message if we try to do it from accounting app and can't see the validate button anymore from the POS app.
TASK-ID: 2001551

closes odoo/odoo#33986

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-07-03 12:03:37 +00:00
Yannick Tivisse 7b9bf47d2e [REM] website_hr: Remove module
Useless module is useless.

closes odoo/odoo#34579

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-07-04 09:43:52 +00:00
Gert Pellin 1345a4f47e [FIX] point_of_sale: recover unpaid orders
Steps to reproduce:

Open a POS session and add an order with a few items on it, but
don't submit a payment for that order.
Exit, close and validate/post the POS session
Open another POS session

Current behavior:

The unpaid order vanished into Never Never Land, never to be
found again.

Expected behavior:

Either an error should be displayed when trying to close a
session with outstanding orders, or any open orders should
be automatically moved to the next open session. If I had
the choice, I would much prefer the second option, plus a
warning message when closing the session.

Closes https://github.com/odoo/odoo/issues/16151

TAK-ID: 1918354

closes odoo/odoo#33395

Signed-off-by: pimodoo <pimodoo@users.noreply.github.com>
2019-07-04 09:27:42 +00:00
Pierre Masereel 637d9e734d [FIX] point_of_sale: Decimal Precision access rights
Since changes made on decimal precision access rights in rev: a1eb000c93
the pos user doesn't have access anymore to decimal precision model in
read access.

So we've added the read right on this model for the pos user.
2019-07-04 07:30:28 +00:00
jem-odoo 86f5b6a926 [IMP] tools: get_timedelta helper
This commit introduces a small helper to return
a timedelta given a quantity and a time unit (day, hour,
month, ...)

Task-2024216

closes odoo/odoo#34576

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-07-04 08:19:08 +00:00
jem-odoo 01c279ced1 [IMP] tools: introduces format_time
In some module, we gonna need to display time part in name_get. So,
it is interesting to have a helper doing that for us. Time part label
depends on the language, format, and timezone.

This commit introduces this tool, based on `babel` lib like the
other helpers. Tests are provided.

Task-2024216
2019-07-04 08:16:08 +00:00
Rishabh Jadia 967040e62e [IMP] account: zip fields are now char
In fiscal position, fields from 'ZIP range' were not supporting the ZIP range with 'char' field and only support 'integer'. It was a problem in some countries like Canada.

task 1948120

closes odoo/odoo#31910

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-07-03 19:12:05 +00:00
Thibault Delavallée 3fc57893fb [IMP] test_mail: update test_mail performance counters according to current state
Also make a base performance class for some context and users in order
to lessen a big file size.

closes odoo/odoo#34547

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-03 11:38:49 +00:00
Jérémy Hennecart 3cc217e5a8 [IMP] website_sale_slides: improve course purchase flow and buttons
Before this task, when a customer bought a course, he was directly
redirect to the checkout process.

After this task, the customer can either Add to Cart or Buy Now
(if the Buy Now option is activated)

This commit also updated the redirection regex in website_sale_product_
configurator. When a product has an optional product, you have the possibility
to add in your cart the optional product thanks to a modal. Before, the button
"Add to Cart" was only available in the shop (/shop/), but now it is also
available on a course (/slides/). So to be redirected on the cart when we
click on the button "Proceed to Checkout" for a course, we needed to apply the
redirection also for the course.

Linked to task 1974929
Related to PR #34224

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-03 09:02:19 +00:00
Jérémy Hennecart 2010de60e7 [IMP] website_sale_slides: do not automatically install module
Now we can have eCommerce and eLearning without automatically willing to
sell courses. The auto_install in the manifest was also blocking the
possibility to uninstall the module. When we tried to uncheck the option for
selling course, it reinstalled it just after we had saved the change in the
settings.

Linked to task 1974929
Related to PR #34224
2019-07-03 08:51:44 +00:00
Parth Choksi 2bdff6783d [IMP] base: do not stretch partner image to a square
Before this commit when you set a partner image whose height was greater
than it's width, it used to get squeezed into a square. After this commit
we prevented partner image from being squeezed into a square.

Task ID: #1982082

closes odoo/odoo#33134

Signed-off-by: Thibault Delavallee (tde) <tde@openerp.com>
2019-07-03 09:04:07 +00:00