Commit Graph
117975 Commits
Author SHA1 Message Date
jem-odoo 36b9899ec6 [FIX] sale_timesheet: overview access
On sales order form view, we display a "project overview"
stat button. It redirects to the overview of the only
billable project of the SO.
To avoid access error, and because this dahsboard is usefull
only for project manager, only those ones will have access to
this overview. So, stat button (Sales order) and label on
project kanban are aonly visible for manager.
2018-05-04 13:22:25 +02:00
jem-odoo a7b6462de8 [FIX] sale_timesheet: timesheet from SO
From the stat button of SO form view, we want to
see all the timesheet with the employee on the
list view. So the action used should be "all timesheet"
and not "my timesheet".
After that, we simply remove the defautl filters to
avoid confusion for the current user. And for performance
issue, the domain of the action does not include timesheet
ids, but the SO lines ids (should be less numerous).
2018-05-04 13:22:17 +02:00
jem-odoo 37dab1bc07 [FIX] sale_timesheet: access error during onchange
`compute_sudo=True` execute the compute method as super
user, to avoid access error. This also allow to trigger
other computation in cascade without being stopped by
access right error if the system has job to do.
However, during a onchange, the method is not executed
as super user, so access error can raise. An explicit
`sudo()`in the compute method is required, in addition
to the 'compute_sudo` on the field (usefull when storing
value).
This commit avoid the problem when a user (that is no
timesheet user) try to add a SO line the delivered qty
is based on its related timesheets (analytic lines).
2018-05-04 13:22:11 +02:00
jem-odoo a3372ffa33 [FIX] base: qweb float_time widget negative value
When trying to convert -1.5 into a time format, instead
of displaying -1:30, the widget will show -2:30, which
is confusing. The float time qweb widget does not handle
correclty negative, when its javascript version works
correclty.
This commit fixes this problem.
2018-05-04 13:22:04 +02:00
jem-odoo 851f36f3d0 [FIX] sale_timesheet: default_project_id on plan project
When clicking on task stat button from plan
project, we can create a new task, but no project
is given in the context. This commit fixes it.
2018-05-04 13:21:54 +02:00
Christophe Simonis 4e90a676da [MERGE] forward port branch 10.0 up to 4b7f4f32ea 2018-05-04 13:19:12 +02:00
Yannick Tivisse 2f15a5fa64 [IMP] base: Add support for private addresses
Purpose
=======

Add the possibility to create private addresses, only accessible for a subset
of users.

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

- Add a new 'Private' partner type
- Add a res.groups in base 'Access to Private Addresses'
- Add ir.rules for the following behavior:
    - Every employees/internal users can read non-private addresses
    - Only users in group_private_addresses can access private addresses
- Add in base a simplified form view for private addresses
- A HR Officer is automatically granted in group_private_addresses
- Use the simplified form view to open the address_home_id form on employees
2018-05-04 13:17:25 +02:00
Romain Derie b5516d400e [FIX] website_sale_comparison: use variant id and not product id
Before this commit, the compare button from the customized view "Alternative
Products" would create the URL by joining `alternative_product_ids` which are
ids from product.template.
But the route /shop/compare is supposed to receive variants (product.product)
IDs.
Thus, it would try to search given product.template IDs in product.product
records.
It would then show incorrect items or no items at all if the ID does not exist.

Now, we create the URL with the first variant (product.product) of the
product.template.
Obviously, the first product.product is arbitrary but we can't retrieve all the
variants ids, it would most of the time returns too many items.

opw-1840321
2018-05-04 12:58:20 +02:00
Simon Lejeune 3d8c0df8bf [FIX] stock: quant: reserve and unreserve on duplicated quants
In a situation where there's a negative quant next to a positive one,
they should be merged when the scheduler runs or when the user open its
inventory view. However, if in the meantime the user reserves and
unreserves, there may be some issues.

The system will only reserve on positive quant ;
the system will unreserve on the first encountered quant (even negative)

The issue is the second part of the early break condition:
    float_is_zero(available_quantity, precision_rounding=rounding):

The issue here is `available_quantity`. In a reservation scenario, it
represents the maximum quantity we can reserve across quant. It is
useful so we do not lose time loopin over quants where nothing will be
available. In an unreserve scenario however, it represented the same
thing, which is wrong. In the case you reserved all the quantities,
`available_quantity` will be 0 we'll loop only on the first quant where
we won't do anything.

As the code doesn't check the success or failure of the unreserve, move
lines were unlinked while the reserved quantity on the quants were not
updated, resulting in the desynchronization of the move lines/ reserved
quantities.

This continues the work done at [1] to track down the "cannot unreserve
more than" errors.

[1] cce6030c0d
2018-05-04 11:52:36 +02:00
Christophe Simonis 62705aee69 [FIX] purchase: delay tests with CoA after install 2018-05-04 11:24:24 +02:00
Yannick Tivisse ec929342eb [IMP] hr_contract: Improve the contract tree views
Remove useless/redundant information and add the department_id.
2018-05-04 11:17:59 +02:00
Aaron Bohy 6e15a9cd24 [FIX] web: one2many form view with action button
Assume a one2many field inside a form, displaying field A in its
list view, and a field B in its (dialog) form view. Moreover, there
is an action button in the dialog, which updates the value of B.

Before this rev., B wasn't correctly reloaded when the button was
clicked, because the BasicModel reloaded the fields on the list
view (i.e. field A), whereas it should reload the fields in both
views.

This fix is twofold. First, we force the viewType to 'form' when
the record is reloaded, instead of the default ('list'), so that
fields in the form view are correctly reloaded. Second, when we
open the form view in the dialog, we add the fields of the list
view to the dict of fields of the form view, so that the form
is aware of those fields and can ask the model to reload them
(still without displaying them).

Fixes #24189
2018-05-04 10:42:05 +02:00
Thibault Delavallée 901658df26 [REM] mail: remove duplicated method
This commit remove duplicated code probably due to a forward-port of a backport
or something like that. Or maybe due to a cosmic beam.

See commits https://github.com/odoo/odoo/commit/14f80bfae66f2c81abb0b8acc0ac558c60ef1d44 and https://github.com/odoo/odoo/commit/36141931bf9a57d01747cb219fdcfdfd7978ab42.

Cheers.
2018-05-04 10:27:58 +02:00
Christophe Monniez 7202205688 [FIX] packaging: avoid traceback on virtual machine timeout
When the virtual machine used to build MS Win package takes too much
time (to build or to test the build), a warning is logged and the VM is killed.

Before this commit, the PID of the process was passed as an argument to
the warning method, causing a traceback.
2018-05-04 10:09:31 +02:00
Yannick Tivisse ef721eb9af [IMP] hr_contract: Remove the field 'vehicle_distance'
The field 'km_home_work' already exists in the hr module for the same purpose.
2018-05-04 09:59:52 +02:00
SEINLET Nicolas b0c08a6846 [FIX] api: optimize way to retrieve records to prefetch (#24503)
Instead of searching for ids in the whole cache, search for the ones we will potentially prefetch.

Example: imagine you have 1K records in cache, and only 3 records in your prefetch set. Instead of retrieving the 1K records that have a value in cache, retrieve which of the 3 records that have no value in cache.
2018-05-04 09:59:45 +02:00
Yannick Tivisse a696f84f1f [IMP] hr: Add private information fields on the employees
Add some private information on the employees like:
- Certificate: Bachelor, Master, Other
- Place/Date of birth
- KM Home/Work
- Emergency Number/Contact
- ...

Also move some already existing private information from hr_contract to hr.
2018-05-04 09:59:24 +02:00
Yannick Tivisse 20c967ed19 [MERGE] hr_contract, l10n_be_hr_payroll: Improve employee contracts and payroll
1/ fleet: Improve stages demo data

    Remove the old one and defined stages that are more realistic.

2/ hr_contract: Add a access right group on contracts

    Some private information are on the contracts. Add a special group to display the
    contracts, independant of the other HR access rights.

3/ hr_contract: Add 'reported_to_secretariat' field on contracts

    Informative field to be greened when the related information is sent to
    the secretariat or the government.

4/ l10n_be_hr_payroll: Use the adapted wage as basic salary on payslips

    It's possible to take more holidays days than the allowed legal days.

    In that case the effective wage is the 'wage_with_holidays'.

    This specific wage should be used as basic salary when computing the payslip.

5/ l10n_be_hr_payroll: Track visibility onchange on wage_with_holidays

6/ l10n_be_hr_payroll: Remove cars domain on contracts

    Doesn't make sense to restrict the available cars on backend.

    A HR user is supposed to know what he does.

7/ l10n_be_hr_payroll: Rename 'Total Employer Cost' into 'Employee Budget'

8/ hr_contract: Add 'active' field on contracts

    Add the possibility to archive contracts.

9/ l10n_be_hr_payroll: Remove unnecessary field dependencies

    Since https://github.com/odoo/odoo/commit/2304edd46cc12aaef4fddaa22887ff51f51581bc,
    the total_depreciated_cost field on the fleet.vehicle is stored.

    This commit removes the field dependencies that are not useful anymore.

10/ l10n_be_hr_payroll: Allow to use several transport mode

    It should be possible to use several transport mode between
    - A company car
    - A public transportation
    - Another transport mode

    This commit split the selection field into 3 boolean fields.

    The payroll rules have to be modified too to take all the costs into account
    on payslips.

11/ hr_contract: Rename 'Contract Type' into 'Employee Category'

12/ l10n_be_hr_payroll: Introduce a new 'Intellectual Property' advantage

    Intellectual property rights guarantee their holders a temporary and territorially
    restricted, exclusive exploitation of their intellectual property. This monopoly
    stimulates innovations that are indispensable for economic growth, but can go against
    the right of free competition which is indispensable for the free market economy.

13/ l10n_be_hr_payroll_fleet: Add company car information on employee contracts

    It makes sense to display this piece of information on the employee contract.

    It allows HR users to see users information about the employee company car without
    having access to the whole fleet module.

14/ hr_contract: Add next activities on contracts

    It makes sense to plan activities on contracts like renewals, signatures, ask missing information,...
2018-05-04 09:54:28 +02:00
Yannick Tivisse 348447923a [IMP] fleet: Improve stages demo data
Remove the old one and defined stages that are more realistic.
2018-05-04 09:47:05 +02:00
Yannick Tivisse 9edc477b31 [IMP] hr_contract: Add a access right group on contracts
Some private information are on the contracts. Add a special group to display the
contracts, independant of the other HR access rights.
2018-05-04 09:47:00 +02:00
Yannick Tivisse 4117f346af [IMP] hr_contract: Add 'reported_to_secretariat' field on contracts
Informative field to be greened when the related information is sent to
the secretariat or the government.
2018-05-04 09:46:22 +02:00
Yannick Tivisse 60527f9b6d [IMP] l10n_be_hr_payroll: Use the adapted wage as basic salary on payslips
It's possible to take more holidays days than the allowed legal days.

In that case the effective wage is the 'wage_with_holidays'.

This specific wage should be used as basic salary when computing the payslip.
2018-05-04 09:44:59 +02:00
Yannick Tivisse df532c52b3 [IMP] l10n_be_hr_payroll: Track visibility onchange on wage_with_holidays 2018-05-04 09:44:53 +02:00
Yannick Tivisse a29b86e74c [IMP] l10n_be_hr_payroll: Remove cars domain on contracts
Doesn't make sense to restrict the available cars on backend.

A HR user is supposed to know what he does.
2018-05-04 09:44:22 +02:00
Yannick Tivisse 66f2a240e2 [IMP] l10n_be_hr_payroll: Rename 'Total Employer Cost' into 'Employee Budget' 2018-05-04 09:44:21 +02:00
Yannick Tivisse 10b4b54a52 [IMP] hr_contract: Add 'active' field on contracts
Add the possibility to archive contracts.
2018-05-04 09:44:04 +02:00
Yannick Tivisse ddecb3ef8a [IMP] l10n_be_hr_payroll: Remove unnecessary field dependencies
Since https://github.com/odoo/odoo/commit/2304edd46cc12aaef4fddaa22887ff51f51581bc,
the total_depreciated_cost field on the fleet.vehicle is stored.

This commit removes the field dependencies that are not useful anymore.
2018-05-04 09:44:01 +02:00
Yannick Tivisse cc60a3677b [IMP] l10n_be_hr_payroll: Allow to use several transport mode
It should be possible to use several transport mode between
- A company car
- A public transportation
- Another transport mode

This commit split the selection field into 3 boolean fields.

The payroll rules have to be modified too to take all the costs into account
on payslips.
2018-05-04 09:43:18 +02:00
Yannick Tivisse 951eebb26c [IMP] hr_contract: Rename 'Contract Type' into 'Employee Category' 2018-05-04 09:43:15 +02:00
Yannick Tivisse 0e7828151d [IMP] l10n_be_hr_payroll: Introduce a new 'Intellectual Property' advantage
Intellectual property rights guarantee their holders a temporary and territorially
restricted, exclusive exploitation of their intellectual property. This monopoly
stimulates innovations that are indispensable for economic growth, but can go against
the right of free competition which is indispensable for the free market economy.
2018-05-04 09:40:44 +02:00
Yannick Tivisse f9b7079b95 [IMP] l10n_be_hr_payroll_fleet: Add company car information on employee contracts
It makes sense to display this piece of information on the employee contract.

It allows HR users to see users information about the employee company car without
having access to the whole fleet module.
2018-05-04 09:40:07 +02:00
Yannick Tivisse f63f0d410c [IMP] hr_contract: Add next activities on contracts
It makes sense to plan activities on contracts like renewals, signatures, ask missing information,...
2018-05-04 09:39:36 +02:00
Olivier Dony c10b0b5f9e [IMP] purchase: show billing status on portal page
It's useful to display that a PO is waiting for a supplier bill on the
portal, so the supplier is reminded about that.
2018-05-03 18:34:53 +02:00
Pierre Masereel 772ce29193 [FIX] mrp: product unit of measure precision in produce wizard
The precision digit on the produce lines is not set to the product unit
of measure one. That can lead to a lost of precision when a small values
are set in the manufacturing order and not in the produce wizard.

OPW-1838077
2018-05-03 16:48:20 +02:00
Pierre Masereel 4102f38f15 [FIX] mrp: round up quantity to consume in produce wizard
When moves of a MO are generated, they are rounded up to the decimal
precision of the rounding, what is not done in the wizard.

So to keep it consistent, we also round up the quantity to consume in
the wizard.
2018-05-03 16:25:21 +02:00
Christophe Simonis 4b7f4f32ea [MERGE] forward port branch 9.0 up to f12daec1a1 2018-05-03 16:25:17 +02:00
Christophe Simonis 072c04c53c [FIX] web: correct tests after previous forward-port 2018-05-03 16:11:02 +02:00
Akash Bhavsar 8b7fb9a764 [FIX] mail: Do not close chat widnow if ESCAPE key is pressed on document viewer and keep focus on chat window input when document viewer is closed (#22741)
If document viewer is opened from chat window and when document viewer is opened then focus 
remains on it's modal, pressing escape should set focus back to chat window's input element,

if file selecor dialog is opened and if user press ESCAPE on file selector dialog to cancel file selector 
dialog then it should not close chat window instead it should set focus on chat window input and on 
second ESCAPE key chat window should be closed
also increase z-index of document viewer dialog so image remain on top of cht window

OPW: 1777937
2018-05-03 15:16:56 +02:00
Simon Lejeune cce6030c0d [FIX] stock: symmetric reserve and unreserve
When an internal locations has its `scrapped` field set to True,
reserving will increment the quant's `reserved_quantity` while
unreserving will bypass the reservation mechanism (as in a supplier
location). This leads to a desynchronisation between the
partially_available/available move lines and the quant's
`reserved_quantity`, leading later on to "cannot unreserve more than
available" errors.

To prevent this kind of issues, there's a `should_bypass_reservation`
method set on the location that we *should* use everywhere, it was
implemented by [0]. Sadly, this line was not adapted since its
implementaton in [1].

Co-authored by len-odoo <len@odoo.com>

opw 1837900

[0] e1cea2640f
[1] 0469d2e712
2018-05-03 14:03:42 +02:00
Lucas Perais (lpe) f49a6b6ebe [FIX] website_slides: avoid double slash in slide url 2018-05-03 13:52:45 +02:00
Olivier Dony 78ce64a6a7 [FIX] account: do not block reconciliation on different partners
This constraint was added during the Great Accounting Reform of v9, in
an attempt to help users avoid reconciliation mistakes.

It turns out that such mistakes are difficult to make in normal
situations, since the system only offers matching entries to reconcile,
so the constraint is largely redundant.

On the other hand, it does block legit cases of reconciliation,
such as those where a large number of lines with different partners are
reconciled together. This often happens when reversing a Journal Entry
that encompasses multiple customers, such as a POS closing entry, or a
manual entry.

To make the system more flexible, let's consider that when a manual
reconciliation breaks the "single partner" rule explicitly, it's for a
good reason, so we should allow it.

OPW: 1840437

Backport of 8e73023f68
2018-05-03 12:17:55 +02:00
Olivier Dony 8e73023f68 [FIX] account: do not block reconciliation on different partners
This constraint was added during the Great Accounting Reform of v9, in
an attempt to help users avoid reconciliation mistakes.

It turns out that such mistakes are difficult to make in normal
situations, since the system only offers matching entries to reconcile,
so the constraint is largely redundant.

On the other hand, it does block legit cases of reconciliation,
such as those where a large number of lines with different partners are
reconciled together. This often happens when reversing a Journal Entry
that encompasses multiple customers, such as a POS closing entry, or a
manual entry.

To make the system more flexible, let's consider that when a manual
reconciliation breaks the "single partner" rule explicitly, it's for a
good reason, so we should allow it.

OPW: 1840437
2018-05-03 12:16:00 +02:00
Christophe Simonis ad802d0d55 [MERGE] forward port branch 11.0 up to c591e0de7d 2018-05-03 11:21:42 +02:00
Goffin Simon c591e0de7d [FIX] stock: Scheduled Date on transfers
When creating a transfer from:

Dashboard > Planned Transfer

The scheduled date is not configurable as explained in commit:a57a290bd89bee0c50c9c1b03e7185c0497e89ed

opw:1838620
2018-05-03 11:15:28 +02:00
Vincent Schippefilt c7b979f1c2 [FIX] web: accessibility: add aria-keyshortcuts
all the elements that have an accesskey defined should also have the
aria-keyshortcuts attribute defined.
doc here: https://www.w3.org/TR/wai-aria-1.1/#aria-keyshortcuts
2018-05-03 11:07:01 +02:00
Goffin Simon 7353405aa4 [FIX] stock: Scheduled date purchase order wrong
When running the scheduler for a reordering rule, the delivery lead time
of the seller was not taken into account.

opw:1837550
2018-05-03 10:29:14 +02:00
Nicolas Lempereur fd44ff38a3 [FIX] stock: reserved qty, typo expected singleton
In 4322985a at one point several stock.move could be selected when we
just wanted the first one.

opw-1840719
closes #24538
2018-05-03 10:14:11 +02:00
Odoo Translation Bot d6050c9d07 [I18N] Update translation terms from Transifex 2018-05-03 10:11:45 +02:00
Goffin Simon aca19ceea6 [FIX] stock: Scheduled Date on transfers
Before this fix, it was impossible to change the date when
creating a transfer in a warehouse.

opw:1838620
2018-05-03 09:37:25 +02:00
Nicolas Lempereur f12daec1a1 [FIX] web: don't change page before saving
When we edit a list view and change page before the change has been
savec, the saving and page changing will be done concurrently thus
possibly causing an error if the page is changed before the saved is
finished: the save will try to modify the page that is no more
displayed.

In this change, the list view editable wait for the saving to be
finished before reloading its content.

note: for 9.0 up to saas-15

opw-1839149
closes #24471
2018-05-03 09:11:44 +02:00