Commit Graph
122050 Commits
Author SHA1 Message Date
Xavier Morel 79728da9d3 [IMP] core: setup o2m edition views recursively in server-side form
Before this commit, the SSF would only set up edition views on o2ms at
the toplevel. This usually isn't an issue, but in some cases involing
onchanges on o2ms which themselves contain o2m, odd results could
happen as the second level would try to list the sub-o2m's fields in
order to cleanup its (possible absence of) values (cf the `subfields`
local variable in _cleanup_onchange), which would blow up due to the
missing `"edition"` key.

Fix by recursively processing o2ms and setting up their edition view.

Also fix the fields iteration in fvg processing: don't recurse inside
fields. There still is no support for embedded views (I think?) but we
should not try to treat subview fields as view fields, that could have
very bad results.

closes odoo/odoo#28645
2018-11-13 16:15:07 +00:00
RomainLibert 1e4b3d093e [IMP] hr_holidays: compute number_of_days on create and write
closes odoo/odoo#28610
2018-11-13 10:04:41 +00:00
Yenthe V.G aff35db94b [IMP] hr_contract: add sheet on contact type form
It's better to display form views in sheets.

closes odoo/odoo#27333
2018-11-13 11:09:40 +00:00
Christophe Monniez 2ff49c5fcb [FIX] packaging: make Debian package depends on qrcode and vobject
As stated in issue #27752, some Debian packages are only recommended.
As a consequence, these packages are not installed on the Official
Docker image. In that case, if the user wants to install an Odoo module
that needs one of these package, the Docker container has to be
modified.

python3-qrcode and python3-vobject are now part of the latest Debian
stable (stretch) and the latest Ubuntu LTS (Bionic Beaver).
Also, they are pure python, and very small.

Thus, the Debian package can depends on them.

co-author: @sbidoul
Fixes #27752
Closes #28588
Closes #28371
Closes #28372
2018-11-13 09:00:30 +00:00
mreficent 8ca728bb93 [FIX] website: redirect_type oversight
In https://github.com/odoo/odoo/commit/2924b77b6f52e7ee9f4a6f2fb0cc79211be42292 type field was renamed to redirect_type
One was missing

closes odoo/odoo#28570
2018-11-12 11:28:21 +00:00
Vincent Schippefilt 98936f79a1 [REF] web: split relational fields tests into multiple files
The file relation_fields_tests.js was a huge 12K lines files for which some editors have a
hard time managing.

We have split it in 4 files to be more managable and removed remove unused data
and import.

closes odoo/odoo#28561
2018-11-12 12:36:53 +00:00
Fabrice Henrion d3567a8890 [IMP] sale: rephrase label
Expiration is clearer than validity

closes odoo/odoo#28517
2018-11-12 08:14:40 +00:00
Christophe Simonis 99d0e1b80e [MERGE] forward port branch 12.0 up to a403155dec 2018-11-12 13:06:48 +01:00
Thibault Delavallée 4d53266e23 [IMP] base, mail: better xpath for server actions and add autofocus
Commit linked to task ID 1906924 and PR #28538.
2018-11-09 15:36:59 +00:00
Martin Trigaux dd4288092d [ADD] mail: add 💔 emoji
The world ain't all sunshine and rainbows.
~~ Sylvester Stallone

closes odoo/odoo#28529
2018-11-09 12:43:43 +00:00
jem-odoo 352807298f [FIX] hr_presence: propagate options in longpolling
The hr_presence module recently introduced adds
a hook on the bus controller in order to execute
its very important and legally business, but this
hook brings an error as it forgot to propagate the
bus options.
Consequence: the bus_inactivity, responsible of the
bus.presence are not pass to super. So all user
appears offline.

closes odoo/odoo#28531
2018-11-09 13:04:34 +00:00
David Beguin bf441b984f [IMP] mass_mailing : add blacklist and opt_out demo data
In order to understand more easily the impact of an opt out
or a blacklisted contact on the interface, blacklist and
opt-out demo data are added.

Tests updated to only test mails on contacts created inside
the test environement and not with demo data.

Task ID 1892998
Closes PR #27674
2018-11-09 08:46:35 +00:00
Geoffroy Larue 8e15a23ca6 [IMP] mail: add view icon on all app (activity systray)
Before this commit, you could only access the activity view of the
Contacts app via the activity icon in activity systray menu.

With this commit, all apps in the activity systray menu that support
the activity view now have this icon that redirects to the
corresponding activity view.

Also, the icon in the activity systray menu has been changed in order
to match the icon of the activity view in the view switcher.

Task-ID 1894900

closes odoo/odoo#28066
2018-11-08 23:28:13 +00:00
Christophe Monniez e9e864802f [REV] base: revert rename ir.logging type to logging_type
This reverts commit c42a130a98
and commit fb7ac56d65.

The runbot is using cross db logging and those commit were breaking the
mechanism. As a result, the master builds logs were empty.
If we update the runbot to use logging_type instead, the other versions
builds will be impacted hence this revert.

closes odoo/odoo#28512
2018-11-08 14:31:57 +00:00
Yenthe V.G ecedd77928 [IMP] fleet: add sheet on model brand and tag form views
It's better to use sheet on form views

closes odoo/odoo#27327
2018-11-08 15:31:36 +00:00
Robot Odoo 13e68d65a7 [MERGE] hr_presence: Improve functional flow
Fine tune the module to improve the business flow:

1/ Allow to force the presence of an employee
2/ Don't notify followers when sending a email
3/ Open the leave request form instead of the leaves list

closes odoo/odoo#28483
2018-11-07 18:44:45 +01:00
Yannick Tivisse 63f52941e0 [IMP] hr_presence: Open the leave request form instead of the leaves list 2018-11-07 16:30:29 +00:00
Yannick Tivisse 1c391c3dfb [FIX] hr_holidays: Correctly compute number_of_days on form loading
On a hr.leave creation on the form view, the fields request_date_from and
request_date_to are set on today. The fields date_from and date_to are set on
now.

We have 2 onchange methods:
- _onchange_request_parameters: Set date_from and date_to according
  to the leave configuration.
- _onchange_leave_dates: Set number_of_days according to date_from
  and date_to

As _onchange_leave_dates is called before _onchange_request_parameters,
the field number_of_day is always set to 0, even if the leave is taken
for all the day (the default value).

It means that if you don't modify the dates, the value stored in the
database is incorrect.

We have to call manually the method _onchange_leave_dates at the end
of the method _onchange_request_parameters execution to ensure
the validity of the value.
2018-11-07 16:30:29 +00:00
Yannick Tivisse 32051efdc9 [IMP] hr_presence: Don't notify followers when sending a email 2018-11-07 16:30:29 +00:00
Yannick Tivisse faf90c4f52 [IMP] hr_presence: Allow to force the presence of an employee 2018-11-07 16:30:29 +00:00
Pierre Masereel ba18cf7fdc [FIX] stock: use self instead of picking
In the compute function _compute_move_without_package, we use self
instead of picking variable, which leads to traceback when more than one
picking is computed

closes odoo/odoo#28482
2018-11-07 16:11:55 +00:00
lbs-odoo c99a6d2fb5 [IMP] hr_holidays: Add team leader group and leave_manager_id
Purpose
=======

1/ A team leader is not able to validate leaves for his own team.
2/ Another person than the manager can be supposed to validate the leaves for a certain employee

Specification
=============

1/ New hierarchy: Team Leader < Officer < Manager

People in Team Leader access group will now be able to approve leaves for employees in their team.

- Added the new access group
- Added rules for people in this group to read or write appropriate records

2/ Add 'leave_manager_id' field on employees to refer to the Team Leader.

- Added the new field to Employee model
- Added the field to the view so that it is visible
- Modified a filter in a view so that it is more relevant according to its name (My Team Leaves)
- Added a filter in a view for managed employees

TaskID: 1888653

closes odoo/odoo#28352
2018-11-07 13:52:37 +00:00
Nimesh Jethva bc930e2e67 [IMP] hr_contract: rename 'Contract Type' into 'Employee Category'
Purpose :
=======

On the Contract form view the field label for the "contract type" is "Employee Category".

Then it will be good if we keep the same label on the group by also...

Right now on the Group By it is "Contract Type"

closes odoo/odoo#27560
2018-11-07 10:39:06 +00:00
mreficent c42a130a98 [FIX] base: logging_type remain
In fb7ac56 type field was renamed to logging_type
A few were missing

closes odoo/odoo#28447
2018-11-07 09:51:22 +00:00
Nicolas Lempereur a403155dec [FIX] website: rtl on frontend when logged out
Before this commit, RTL on frontend was only enabled for connected user.

To have RTL, we add the direction on the element, and the RTL version of
the stylesheet for the applicable languages are generated thanks to rtlcss.

opw-1892757
closes #28434
2018-11-06 12:28:58 +00:00
Odoo Translation Bot dcc077afc5 [I18N] Update translation terms from Transifex 2018-11-11 01:26:46 +01:00
Nicolas Lempereur 5d5cd8c052 [FIX] website_partner: correct demo data root->admin
The root user is now the sudoable superuser. The demo data should be
over admin user and not root user.

opw-1907486
closes #28534
2018-11-09 18:26:04 +00:00
qsm-odoo 54a6783040 [FIX] website_sale: shop search with collapsible hierarchy
When the eCommerce /shop page was configured to use collapsible product
categories, performing a search on a product whose eCommerce category
was a child of another one produced an error.

This was due to a typo made with https://github.com/odoo/odoo/commit/8889d00f4f702bb22416b0751b46dac28411d46d

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

closes odoo/odoo#28532
2018-11-09 13:23:32 +00:00
Adrian Torres 2824efee4b [FIX] base: ensure python version >= 3.5
Odoo 12.0 does *not* officially support any python version below 3.5,
but no effort had been made to gracefully announce this to the end user
if they were to run Odoo in an unsupported python version.

This is done because Odoo 12.0 uses py3-only constructs which can
and will raise different errors if ran in python 2.

With this patch, Odoo will display an appropriate error message and won't
launch at all unless it is being run with python 3.5 or greater.

closes odoo/odoo#28502
2018-11-08 11:53:35 +00:00
Raphael Collet 7a0fb3de1e [FIX] account: speedup the creation of the chart of accounts
Make the CoA template instantiates accounts and other records in batch.

closes odoo/odoo#28480
2018-11-09 10:53:46 +00:00
Aaron Bohy 45bc7c92f8 [FIX] web: extend the fieldsInfo of a view with the origin view to evaluate extra fields
Suppose you are editing a SO to add a new line. Depending on the configuration,
a sale order line wizard may open (e.g. if packages are activated).
This wizard is a form view, opened from the tree view of the sale order lines.
We have commit 8e5156938a
that adds extra fields from the originating view.
(However it doesn't work if the other view is inlined, so we modify this part to
add the extra field even in this case.)
Then we need the field info from the origin view in the target view;
we do so by extending the former with the content of the latter.

opw 1904337

closes odoo/odoo#28441
2018-11-09 15:04:18 +00:00
Nicolas Lempereur 1620c5b69c [FIX] account: test typo forward-port 3e4b9d4d66
also reference_type is removed from the model b5bb5bd42

closes #28536
2018-11-09 15:54:04 +00:00
Christophe Simonis 3e4b9d4d66 [MERGE] forward port branch saas-11.4 up to 639bd89635 2018-11-09 14:51:55 +01:00
len-odoo 9e8c63e1ec [FIX] stock: always show the detailed operations icon if one technical group is active
Stock moves show a detailed operations icon if the tracking, locations, or
consignment allow to be configured.
However it did so on a per move basis, only displaying it if the considered move
has some of these features.

This fix makes it that the "detailed operations" icon is always displayed if at
least one group of group_tracking_lot, group_stock_multi_locations, or
group_tracking_owner is active, or the move is tracked,
unless the move picking type already does show detailed operations.

opw 1893106

closes odoo/odoo#28072
2018-11-09 09:52:18 +00:00
Christophe Simonis 639bd89635 [MERGE] forward port branch saas-11.3 up to 94a9fc9902 2018-11-08 17:08:03 +01:00
Christophe Simonis 94a9fc9902 [MERGE] forward port branch 11.0 up to e5c8071484 2018-11-08 14:13:52 +01:00
len-odoo d60f2ab0e2 [FIX] mail: only generate one next activity when setting automated actions at record update
Create an automated action to create a new activity on update of a record
(e.g. a CRM lead).
At update, many fields recompute may be triggered, triggering as many write.
Thus it would generate many activities.
We simply do nothing if we are in a recompute.

Coauthored by rco

opw 1904156

closes odoo/odoo#28498
2018-11-08 10:40:58 +00:00
Nicolas Lempereur 9799dd294d [FIX] mail: enable composer after message sent
c5dc0b2f39 disabled send button on composer sent.

But this is only needed for chatter composer, other composers directly
send the message and are not refreshed asynchronously.

So for other composer, the send button worked one time but then was
disabled and the only way to sent was ENTER (on basic composer) or
CTRL+ENTER (on extended composer).

With this fix, disabling the button is done only for chatter composer.
Also the behavior of not clearing the message if there was an error is
introduced back.

Without change in code, added test fails with:
 "Should keep unsent message in the composer on failure" (result: "")
 "Send button should be re-enabled on message post failure" (result: true)

issue found when checking opw-1904029
closes #28475
2018-11-09 08:10:24 +00:00
Toufik Ben Jaa fe518f1fea [FIX] website_sale: performance when creating a cart
- When creating an eCommerce cart using the Public User, the code tries
  to access all the sale orders linked to it.

  Depending on the count of sale orders linked to the partner, the
  loading can take a lot of time.

  To avoid this, we only search for the sale orders of connected users
  and we only retrieve the last one.
2018-11-08 11:16:02 +01:00
Laurent Smet d1313d08fc [FIX] sale_payment: autoreconcile invoices using transactions
- Create a SO
- Paid the SO using a transaction
- Create an invoice from the SO
=> The invoice will now be reconciled automatically with the payment transaction

Was task: 1890029
Was PR #27390
2018-11-08 09:07:44 +01:00
Nicolas Martinelli e5c8071484 [FIX] account: domain on reconciliation model
When loading the Reconciliation Widget, all reconciliation models are
retrieved. This is not correct: only the one matching the company and
the journal should be retrieved.

Fixes #28270
opw-1904475

closes odoo/odoo#28474
2018-11-07 13:26:30 +00:00
Olivier Colson 7754416cd8 [FIX] account: fix "post at bank reconciliation" option of bank journals
Before that, with "post at bank reconciliation option" activated on bank journal, the following scenarii did not work as expected:

1. When creating an invoice, making two payments for it, and then matching only one of them with a bank statement
=> the invoice was marked as 'paid' while it should have staid 'in payment' until the second payment gets a bank statement.

2. When directly reconciling a bank statement with an invoice for its full amount
=> the invoice staid in "in payment" state, while it should have been "paid"

[IMP] account: add tests for the aforementioned cases

closes odoo/odoo#28428
2018-11-07 09:18:51 +00:00
Nicolas Seinlet e1c9efb2d2 [FIX] sale: ensure a non null date
Sometimes, a sale.order in the SALE state doesn't have a confirmed date,
which can cause a traceback. To avoid this, when confirmation_date is
null, use the write_date, which is never NULL when sale.order is in sale
state.
In migration, we will try to populate the confirmation date with
the mail.message subtype. As ultimate fallback, we will take
the write_date.

closes odoo/odoo#28296
2018-11-08 16:15:54 +00:00
len-odoo 8f39509d27 [FIX] hr_holidays: copy accrual fields when creating child allocations
Create an accrual leave, and set it e.g. by employee tag.
For each employee having the tag, a child allocation will be created.
When doing so, it will prepare the values for these creations.
However the relevant fields for accrual leaves were missing from these values.

opw 1906476

closes odoo/odoo#28492
2018-11-08 07:59:21 +00:00
eco-odoo 7a117b14df [IMP] l10n_uk: rename menu item England to United Kingdom
"British Statements" was wrongly renamed to "England" in a436645ae8.

closes odoo/odoo#28458
2018-11-07 08:37:41 +00:00
Joren Van Onder b9e6adcaf7 [FIX] account: reconcile payments against min date_maturity journal item
1. Create a payment term with:
   - 50% due now
   - balance due in 14 days
2. Validate an invoice with this payment term and partner Agrolait
3. Create a payment from Agrolait with the 50% due
4. Add this outstanding credit to the invoice

It is reconciled with the balance due in 14 days instead of what is
due now. Because of this e.g. the Aged Receivable report will show the
customer being overdue with a payment.

This issue was first fixed in 9.0 at
adad192cc0. It was then reintroduced in
saas-11.4 at d3d2612061. This commit
adds a test to avoid regressions like this.

To fix the issue this sorts journal items by their Due Date if there
is one. Otherwise we use the date from the journal entry as before.

Note that before this commit journal items were not sorted at all by
the two 'sorted' statements. sorted returns a sorted recordset, it
doesn't modify the recordset it's called on.

opw-1906665
2018-11-07 09:25:29 +01:00
Jeremy Kersten ae3997b8bf [FIX] web: guess resize placeholder
Before this commit, if you ask for a small image, you was waiting a picture of
64x64 but in case this image was not found, a placeholder with an other size
was returned.

Now, we try to guess the asked size, and return a resized placeholder.

This bug appear since we change the default placeholder picture with a big one

This will fix several issue and avoid to hard code size everywhere in the code

Eg: commit 92f837c and commit https://github.com/odoo/odoo/commit/154fc7d9dd550d35b7266af024e54c20e18938fc#diff-9af1af2039d16d6b544d481b4ee1ed7cR144

closes odoo/odoo#27695
2018-11-06 18:37:29 +01:00
Raphael Collet eaa93d1bd4 [FIX] models: update write_date when writing on inherited fields
When changing the field `image` on `res.users`, the `write_date` of the user is
not updated because the field is inherited from `res.partner`.

Related to Issue : 1839603
2018-11-06 11:11:03 +01:00
Christophe Simonis dc35de9d30 [MERGE] forward port branch saas-11.3 up to f66a9cdbcf 2018-11-06 10:16:30 +01:00
Christophe Simonis f66a9cdbcf [MERGE] forward port branch 11.0 up to bab5ccfdd7 2018-11-05 17:51:04 +01:00