Commit Graph
127612 Commits
Author SHA1 Message Date
Denis Ledoux 6fd637e131 [MERGE] forward port branch 11.0 up to b71b78035b 2019-04-24 14:31:10 +02:00
Damien Bouvy 90af6254ba [FIX] mrp_byproduct: missing oldname
Impacts migrations

closes odoo/odoo#32900

Signed-off-by: Damien Bouvy (dbo) <dbo@odoo.com>
2019-04-24 08:53:29 +00:00
Denis Ledoux b71b78035b [MERGE] forward port branch saas-15 up to 0c46c8a929 2019-04-24 10:04:05 +02:00
Denis Ledoux 0c46c8a929 [MERGE] forward port branch saas-14 up to 6fd092e131 2019-04-24 09:31:49 +02:00
Anang 5d0d6e4827 [CLA] Sign Odoo CLA for 0yik
closes odoo/odoo#32896

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-24 07:31:14 +00:00
Toufik Ben Jaa 153f708792 [FIX] hr_holidays: access issue on employee's manager update
- If the current user doesn't have write access to `hr.leave` or
`hr.leave.allocation` and tries to modify the manager (`parent_id`) of
a `hr.employee` record, an access right issue is raised.

This commit fixes the issue.

OPW-2000569

closes odoo/odoo#33542

Signed-off-by: Toufik Benjaa (tbe) <tbe@odoo.com>
2019-05-21 15:19:26 +00:00
Nicolas Martinelli cdd5b78c63 [FIX] stock: quant of zero with S/N
- Install the sales and stock applications
- Create a stored product tracked with unique S/N
- Create an initial inventory for this product with 2 SN 001 and 002 and
validate it
- Create a SO for 1 unit of the product, and deliver it using SN 001
- Display the product form view

In the form view of the product, the quantity on hand is 1 (correct).
But when we click on the smart button, we see that the Stock location
has a quant for SN 001 and a quantity of 0.

The vacuum should be run when we access the stock information from the
'On Hand' stat button.

opw-1999545

closes odoo/odoo#33687

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-27 12:49:31 +00:00
Jorge Pinna Puissant 904e237d78 [FIX] sale,product_email_template: match the help with the behaviour
Before this commit, the help of the product_email_template module said
that the email is sent when the invoice is paid. This is not the case,
the current behaviour of the module is that the email is sent when the
invoice is validated.

Fine-tuning of : 4b5265b9b9,
10eee18a04
and 33a413eb29

opw-1973946

closes odoo/odoo#33686

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-05-27 12:43:14 +00:00
Nans Lefebvre a98c15f443 [FIX] mail: fix multi-company access rights check when creating activities
When checking the rights when creating a new activity, c38a0d6768
made the choice to bypass the check if the multi-company case.
However the "multi-company case" was determined by checking that
len(target_user.company_ids) > 1; however if target_user.company_ids contains
companies to which the current user doesn't have access, then this is wrong.

Let the active user be Ua in companies C1, C2, currently in C1,
and the target user be Ut in C2, C3, currently in C3.
Then target_user.company_ids == [C2] for Ua, so the check would be False.

This shows that we need len(target_user.sudo().company_ids) > 1.

opw 1998709

closes odoo/odoo#33681

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-27 11:32:56 +00:00
Sébastien Theys 0ac7635b54 [FIX] sale: fix get_combination_info RPC when product_id given
Follow up of 51ef8514ea

The RPC would fail to return the correct value for `is_combination_possible` if
a product_id is given instead of a combination.

opw-2003069

closes odoo/odoo#33677

Signed-off-by: Sébastien Theys <seb-odoo@users.noreply.github.com>
2019-05-27 11:45:18 +00:00
Nicolas Martinelli 72b4469c3d [FIX] account: test if currency not USD
The test assumes that the company currency is in USD. However, if it is
not the case, the test fails.

We make the test more robust by simply checking the amount.

opw-2000681

closes odoo/odoo#33680

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-27 11:15:16 +00:00
Graeme Gellatly 6db361bf6a [FIX] purchase: remove duplicate code
Due to a forward-port, the code updating the vendor_ref has been duplicated
a few lines apart.

Closes odoo/odoo#33334

closes odoo/odoo#33676

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-27 10:03:14 +00:00
Jorge Pinna Puissant f4bb6e5d34 [FIX] hr_holidays: allocation with leave type in hours and with a different mode than 'By Employee'
When an allocation have as leave type hours, and have the mode different
from 'By Employee', the stored duration (in days) is calculated dividing
the filed number of hours by 8 (number of hours per days).
During the validation, an allocation is created for each employee that
match the mode chosen.

In these allocations, before this commit, the number of hours displayed
is calculated by multiplying the stored duration (in days) with the
average number of hours of the employee.
The problem is that in may cases the average number of hours of the
employee is different from 8, and the display number of hours is not
correct.

Now, the number of hours is calculated with 8 when the allocation is
created from another allocation.

opw-1972133

closes odoo/odoo#33675

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
2019-05-27 09:32:24 +00:00
Odoo Translation Bot b24e0441b9 [I18N] Update translation terms from Transifex 2019-05-26 01:15:48 +02:00
Nans Lefebvre 4c3698aa3f [FIX] mail: add all attachments at template onchange
Fine-tuning of 516f22c398.
This commit missed attachments that are linked to a mail.template,
which should be added to every mail sent using the template.

To make sure that we both fix the duplicates and the generation issue,
we add a test.

opw 2000515
opw 1998782

closes odoo/odoo#33653

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-24 13:45:50 +00:00
Martin Trigaux b45236dd68 [FIX] base: upsert empty translations
If a translation has an empty src and value, the value in the dictionary
after the search_read is False, not ''
When doing an insert, False is converted to 'false'

Before 489494e733 the translations were inserted using the ORM which correctly
converts False to ''

opw-1999723

closes odoo/odoo#33649

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-05-24 13:34:07 +00:00
Sébastien Theys f58668ccb5 [FIX] tools: fix image processing of palette PNG with alpha channel
Since b0ff033d69

To reproduce this issue: give to the processing method a PNG with transparency
and which is already encoded in palette mode.

In 12.0 such image could be `addons/payment/static/img/codensa_easy_credit.png`.

In earlier versions of Pillow, adding an alpha channel to such image would have
no effect, but since version 6.0.0 they raise an exception when that happens.

The PNG spec forbids the use of a full alpha channel with palette-based images
according to http://www.libpng.org/pub/png/book/chapter08.html#png.ch08.div.5.2

task-1998639

closes odoo/odoo#33628

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>
2019-05-24 12:23:09 +00:00
Hetal DhanakandPriyanka Kaakdiya 84130174df [FIX] web: make calendar toggle full width work
toggle full width of calendar not working, this is because getItem of
localstorage service now returns parsed value, AbstractStorageService now
return JSON.parse(value)

this commit fixes that.

task-1975004

closes odoo/odoo#33570

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>


Co-authored-by: Priyanka Kaakdiya <pka@odoo.com>
2019-05-24 11:19:34 +00:00
wan 946641da55 [FIX] account: import of invoice by csv gave wrong account
Task 1961719

type was set to False when called in the create method. This yielded
always the same account when importing invoices. Getting the value of
type from the context corrects that issue.

closes odoo/odoo#32579

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-05-20 08:38:03 +00:00
Olivier Dony 3845e0ff61 [ADD] Add security policy for our GitHub project
To be displayed on https://github.com/odoo/odoo/security/policy
2019-05-24 15:14:41 +02:00
Nans Lefebvre 345a5a4aa8 [FIX] crm: set the email_from from the kanban quick create
When setting the partner of a lead, on the form view the email_from
is automatically populated by the onchange on the partner_id.
This is not the case when created programmatically,
and this is not even the case when created from the kanban view.

This can lead to an unexpected failure to send emails down the line.

We apply the onchange in the create to fill all values consistently in all cases.
In case the values were already set, this simply won't change anything.

Note that we need to adapt the test from website_crm_partner_assign.
It uses demo data that makes little sense.
The opportunity crm.crm_case_21 is set in the UK,
with a partner base.res_partner_4 in the US, in the state Escuintla of Guatemala.
With the change from above, all the address fields on the opportunity are
populated by the onchange, from the partner.

opw 2000241

closes odoo/odoo#33622

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-23 13:35:03 +00:00
Damien BouvyandNicolas Martinelli 0c50fb516c [FIX] pos_sale: performances and UOM
Performance issue
-----------------

In databases with a lot of POS order lines, the Sales Analysis report is
quite slow. This impacts performances in the report itself and in the
form views of products and product templates. Indeed, they use the
`sale.report` model to compute the `sales_count` field on products.

opw-1987368

Bug on UOM
----------

- Activate Units of Measure
- Create a product A, set its UOM to 'g' (grams)
- Sell one product in the POS

In the Sales Analysis report, the amount is multiplied by 1000.

opw-1978462

Bug on taxes
------------

See issue #24746

All issues originates from the SQL view which is quite complex for no
good reason. Indeed, in v12 the fields `price_subtotal` and
`price_subtotal_incl` are stored and contain the necessary amounts.

closes odoo/odoo#33304

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>


Co-authored-by: Nicolas Martinelli <nim@odoo.com>
2019-05-24 07:34:40 +00:00
Julien Castiaux 4f0a00628f [FIX] mail: cannot create attachment of bad image
When receiving an email, an attachment is created for every base64
embedded image. We got an invalid image which caused the attachment
generation to fail with a traceback due to a base64 decode error.

The attachment creation has been wrapped into a try/catch in order to
remove problematic images.

opw-1987224

closes odoo/odoo#33620

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-23 13:09:37 +00:00
Denis RousselandMartin Trigaux c057708447 [FIX] base: support default boolean values in config_parameter
Commit a0dd81b added 'magic' support for ir.config_parameter
to res.config.settings fields.
However for boolean fields, we have:
IrConfigParameter.get_param(icp, field.default(self) if field.default else False)
if value is False we do nothing.
If icp is defined we get a str.
Now if field.default(self) is truthy, it will be called with value.lower().
In particular if value is the boolean True, it will crash and thus settings are
rendered inaccessible.

Note that commit odoo/enterprise@39fb3be0ef gave a default '' value to a
boolean field, sidestepping the issue.

By convention, config_parameters encode booleans using bool(str),
i.e. '' encodes False, while anything else encodes True.
We follow this convention here;
which means that "False" would be be interpreted as True (to Tarski's dismay).
Note that passing a default True value would mean that the config_parameter
would be False before the first settings save, which could be avoided by putting
the value in the module data.

opw-2000718
Closes odoo/odoo#33517

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>


Co-authored-by: Martin Trigaux <mat@odoo.com>
2019-05-23 09:04:22 +00:00
Varun Raval 57bb236c24 [FIX] web: fix tags field which looks weird on kanban view
For many2many_tags widget 'o_tag_color_0' class apply box shadow, in form
view it looks good but in kanban view, it does not look good so I have
removed box shadow from kanban view.

Before this commit in kanban view when no attributes are used in the field
at that time tags will be in box-shadow but after this commit even if no
attributes are used in the field, tags will be without box shadow.

Task ID: 1963188
Closes: #33503

Signed-off-by: Aaron Bohy (aab) <aab@odoo.com>
2019-05-23 08:55:43 +00:00
Hardik Prajapati 086b9ad879 [IMP] l10n_ae: Added taxes, COA and Fiscal position
- On the invoice pdf, if the invoice is in USD, we
need to specify conversion rate and amounts in AED.
Also, if it is between certain Gulf states, you need
to mention this on the invoice.   'Invoice' also
needs to replaced with 'Tax Invoice'.
- Taxes changed to 0% and 5% / AED symbol on currency
adapted to the real situation of UAE.
- A tax by state automatically adapted with the fiscal
positions in order to have the tax amounts correctly
split by state in the tax report.

opw-1931322

closes odoo/odoo#33385

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-05-22 13:17:55 +00:00
Laurent SmetandGoffin Simon 9989a9c329 [FIX] account: Fix reconciliation foreign currency on account
Suppose you make a reconciliation on an account having a foreign currency being
the same as the company one.
Suppose also you are making a reconciliation of three lines without currency_id set on this account:
- A with debit = 11
- B with credit = 10
- C with credit = 1

Before this commit, the reconciliation was wrong because all computation are made using the foreign
currency due to the account's configuration. As A, B & C have their amount_currency set to 0,
an account.full.reconcile is well created but only one account.partial.reconcile is created instead of
2 leading to an inconsistent state.

opw:1984684

closes odoo/odoo#33445

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>


Co-authored-by: Goffin Simon <simon.goffin@outlook.com>
2019-05-22 09:23:36 +00:00
Nans Lefebvre 839f62c375 [FIX] website_sale: clean the action to send recovery cart
The action to send cart recovery mails is really made to be automated.
However it was written in a way requiring either manual input, to use
action_recovery_email_send.
To make an automated action, you basically need to put the code of it
directly into the action itself, or it would be made incorrectly.

opw 1981665

closes odoo/odoo#33185

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-05-22 11:16:33 +00:00
Habib Ayob 9a05d4247f [ADD] l10n_za: add chart of accounts for South Africa
- generic CoA
- Sars VAT ready structure

Thanks to Paradigm Digital

separate pr for 12.3
opw-1893580
Closes #32685

Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
2019-05-15 11:47:07 +00:00
Nicolas Martinelli 910e5de42d [FIX] account: open from dashboard
In the accounting dashboard, click on the hamburger menu of a purchase
or sales journal, then click on View Bills. Both vendor bills and
refunds are displayed.

This is because the `use_domain` key of the view is replaced in the
`open_action` method.

opw-2000904

closes odoo/odoo#33562

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-22 09:42:47 +00:00
Raphael Collet 9db8497a99 [FIX] tests: Form must perform onchange with actual record
closes odoo/odoo#33557

Signed-off-by: Raphael Collet (rco) <rco@openerp.com>
2019-05-22 08:45:10 +00:00
RomainLibert d5b3060adb [FIX] hr_holidays: reset holiday_status_id in onchange
In order to force the user to select a new leave_type when requesting a
leave for someone else. We reset its value in the `_onchange_employee_id`

Task : 1984487
Closes #32697
Fixes #29806

Courtesy of @sswapnesh

closes odoo/odoo#33178

Signed-off-by: Romain Libert (rli) <rli@odoo.com>
2019-05-07 16:03:22 +00:00
Nicolas Martinelli 013d52e988 [FIX] sale: taxes on mobile
- Create 3 products, add 2 sales tax to each product
- Create a quotation template with the se 3 products
- Switch to mobile mode
- Create a SO, add the quotation template
- Modify the first line and change the quantity

The taxes of the two other lines are removed.

This is due to the missing `tax_id` field in the mobile kanban view.

opw-1998493

closes odoo/odoo#33527

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-05-21 12:22:25 +00:00
wan dfebe2f51d [IMP] account: filter aml on posted by default
Task 193992
The changes in account asset generate a lot of unposted aml in the future rendering hiding them by default necessary

closes odoo/odoo#31361

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-04-23 20:17:04 +00:00
wan ce799f2f99 [ADD] account: cron to post draft entries
Task 193992
The cron is used to post draft entries such as those created by the module account_asset
Also add an inverse to account.move.amount
Also add a reverse compute on amount, and adapt its value according to the currency
2019-04-23 20:16:48 +00:00
Denis Ledoux 6fd092e131 [MERGE] forward port branch 10.0 up to 4730a884b4 2019-04-23 17:16:26 +02:00
wan d5e2708f8e [IMP] account: generic usability improvements
Task 1950665

1. Define a tax on an account should tell if it's a SALE or PURCHASE tax
2. Credit Note creation from an invoice, label improvement
3. Improve Payable/Receivable account detection from bank statement reconciliation

closes odoo/odoo#32775

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-04-23 14:20:12 +00:00
William Henrotin a45e843dec [REF] mrp: share similar code
The quantity to consume for a component is computed in different places
(community and enterprise modules, workorder and produce wizard) during
a production. This commit share those computations into a static function.

closes odoo/odoo#32864

Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
2019-04-23 13:24:43 +00:00
Yannick Tivisse e716fabbdc [FIX] l10n_be_hr_payroll: Take Basic instead of Gross for IP part 2019-04-23 14:54:58 +02:00
Martin Trigaux c9913152ec [FIX] base: use correct iso code for Filipino
Instead of fil - fil_PH, it should have been fil_PH - fil.

The iso_code is used in URLs

The "code" value can not be changed in stable but iso-code can.
The code value will be changed in master as requires a migration script

closes odoo/odoo#32867

Signed-off-by: Martin Trigaux (mat) <mat@odoo.com>
2019-04-23 09:46:24 +00:00
Nans Lefebvre b7f4ff4b54 [FIX] hr_expense: fix payment entry of expenses paid by company
Create an expense paid directly by the company, validate and post entries.
While the account move lines are correct, the payment is not: it is always null.

opw 1962500

closes odoo/odoo#32956

Signed-off-by: Nans Lefebvre (len) <len@odoo.com>
2019-04-25 13:45:47 +00:00
Lucas Perais (lpe) 61f82c077d [FIX] stock: traceability report: direct children displayed
Configure a route to be in 3 steps
make a PO, validate all three pickings
Go on the final picking, the one that has the destination to the Stock
Click on the smart button to access the traceability report
unfold as many lines as you can

Before this commit, the first picking of the whole tree (Vendors to Input)
appeared as a direct child of the final picking,
as well as a child of the intermediary picking (as it should)

- Quality > Stock
	|
	- Input > Quality
	|	|
	|	-Vendors > Input
	- Vendors > Input

After this commit, the final picking contains only the intermediary
which in turn contains only the origin

- Quality > Stock
        |
        - Input > Quality
                |
                -Vendors > Input

OPW 1970286

closes odoo/odoo#32953

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-04-25 12:30:43 +00:00
Denis Ledoux 7228c10884 [MERGE] forward port branch saas-11.3 up to 6fd637e131 2019-04-25 15:47:09 +02:00
Jorge Pinna Puissant 101a28b8dc [FIX] sale: allow multi-record capacity to action_done
Fine-tuning : 6b7bb096e1

closes #32944

closes odoo/odoo#32947

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-25 09:44:36 +00:00
Nicolas Martinelli 9378552a89 [FIX] stock: print Traceability Report
The Traceability Report printing option is hidden since the report is
pretty much unusable.

opw-1973161

closes odoo/odoo#32939

Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2019-04-25 08:09:28 +00:00
82c13975f1 [IMP] website_sale_comparison: add test tours
Pretty much the whole module is covered by the tests in this commit:
- standard comparison, from shop, from product page
- comparison with more complicated product configuration
- the comparison page itself
- the alternative products

task-1929151

closes odoo/odoo#32901

Signed-off-by: Jérémy Kersten (jke) <jke@openerp.com>


Co-authored-by: Priyanka Kakadiya <pka@odoo.com>
Co-authored-by: Mohammed Shekha <msh@openerp.com>
Co-authored-by: Sébastien Theys <seb@odoo.com>
2019-04-24 14:54:35 +00:00
Goffin Simon 1da058f8ed [FIX] stock: Error when re-installing manufacturing application
Steps to reproduce the bug:
- Install MRP
- Uninstall MRP
- Install MRP

Bug:
An error was raised by sql constraint 'barcode_company_uniq' which ensures that
a barcode for a location is unique per company.
But when uninstalling MRP, some locations such as pbm_loc_id or sam_loc_id are set to
active = False and when re-installing MRP, the function _create_missing_locations tried
to re-create these locations and the sql constraint was raised.

opw:1967534

closes odoo/odoo#32882

Signed-off-by: Simon Goffin (sig) <sig@openerp.com>
2019-04-23 13:37:18 +00:00
Yannick Tivisse 4b0b00dbd9 [FIX] hr_holidays: Avoid erasing values on onchange if set
closes odoo/odoo#32790

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-04-24 12:27:17 +00:00
Lucas Lefèvre 08da07b1ca [FIX] hr_holidays: Fix deleted default employee
The goal of commit 2dbce5e was to handle the company
holiday type in onchange which was probably forgotten
when the company type was introduced.
However because the last `elif` was changed to `else`,
the `else` clause is executed in some situations where
it shouldn't.

e.g. If holiday type is `employee` and an employee is set,
the `else` clause is (obviously wrongly) executed.
This is particularly a problem if the employee is not
HR user nor manager. In that case, the field employee_id
is invisible and its value has been deleted by the onchange.
The allocation cannot be saved because it violates the
sql constraint (employee is null).

Also, the `mode_company_id` and `category_id` should be set
to `False` when the holiday type is not company/category.
2019-04-24 12:26:27 +00:00
Lucas Lefèvre d6242a340d [FIX] hr_holidays: Allow create department leave
1. Open form view to create a leave
2. Change the leave type to 'By department'
3. Choose the department of the current user
4. Save the leave
5. Approve the leave
=> ValidationError, cannot have two leaves at the same time.

In `@api.onchange('holiday_type')`, when choosing by department
it sets `employee_id`, `mode_company_id` and `category_id`
to `False` ONLY if the department is not already set.
But by default, the employee is set to the user's employee
and the department is set to the employee's department.
Therefore the employee is never set to `False` and the
department leave is linked to this employee.
When validating the 'department' leave, an 'employee'
leave is created for each employee in the department.
For the current user, it crashes because the deparment leave overlaps with
the 'employee' leave since the department leave is linked to
the employee.
2019-04-24 12:24:13 +00:00