Commit Graph
48 Commits
Author SHA1 Message Date
roen-odoo ca6cd0362e [FIX] hr_expense: Expense not cancelled
Current behavior:
When cancelling an expense payment, the expense state was not modified and was still 'paid' when it should be 'refused'.

Steps to reproduce:
- Create an expense and post the expense and register a payment for the expense.
- Then go the vendor payments and cancel the associated vendor payment.
- The expense still shows as paid in the expenses page.

opw-2711383

closes odoo/odoo#82496

X-original-commit: 16459957d23f4bdfddfe96d72ef96cbdc6fec539
Signed-off-by: Laurent Smet <las@odoo.com>
Signed-off-by: Engels Robin (roen) <roen@odoo.com>
2022-01-11 16:18:49 +00:00
Merlin (megu) 711780944a [FIX] hr_expense: use contact bank account for employee expense
Steps to reproduce:
1. Install the Expenses and Contacts Apps
2. Go to the Contacts App
3. Add a bank account to the private address linked to a specific employee
4. Go to the Expenses App
5. Create an expense for the employee and try to register the payment
6. The bank account will not show up

Solution:
If the employee doesn't have a bank account selected in the Employee form, we select the first bank account of his private address

OPW-2655450

closes odoo/odoo#80774

X-original-commit: cb998c804a0e7b14393637f372f1f32051fd548d
Signed-off-by: Olivier Colson <oco@odoo.com>
2021-12-03 09:43:54 +00:00
Kevin Baptiste 86aa7b78aa [IMP] *: introduce data-hotkey on form and modal views
Define `data-hotkey` on most used action buttons.

For the modals, the following keys are dedicated for "special"
actions:
 - Alt+G: add
 - Alt+V: save
 - Alt+Z: cancel

closes odoo/odoo#73275

Taskid: 2588233
Related: odoo/enterprise#19464
Signed-off-by: Kevin Baptiste <kba@odoo.com>
2021-07-15 08:39:49 +00:00
alt-odoo 58ca0422b9 [IMP] hr_expense: use bank account defined on employee in payment
When registering a payment on an expense, we are currently using the first
bank account set on the partner if no account is set on the account move.
We should use the bank account defined on the employee instead, and
fallback on the partner only if it is not set.

closes odoo/odoo#72077

X-original-commit: e0335a71afbeb34c5fad9a71bd1b53d5d88d6fa6
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
Signed-off-by: Alex Tuyls <alt-odoo@users.noreply.github.com>
2021-06-11 17:15:48 +00:00
Kevin Baptiste 278f5a6995 [IMP] hr_expense: show confirmation on duplicate expenses
Display a confirmation dialog when a user creates duplicate expenses.

Two expenses (or more) are considered duplicates when they share the same
date, amount, product, employee, company and currency.

closes odoo/odoo#64190

Taskid: 2368636
Related: odoo/upgrade#2061
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2021-03-04 12:54:34 +00:00
Laurent Smet b25e53a0b9 [IMP] hr_expense(_check): Remove the custom register payment expense wizard
- Use the one defined in the account module allowing paying multiple journal entries
and group payments together.
- Remove the hr_expense_check module that contains only duplicated features regarding the
register payment wizard.

--task: 2273528
2020-08-12 12:30:43 +00:00
Yannick Tivisse d6e20b474b [IMP] hr_expense: Improve general UX (back2basics)
closes odoo/odoo#55689

Taskid: 2277338
Related: odoo/upgrade#1595
Related: odoo/enterprise#12331
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-11 09:53:00 +00:00
Andrea Grazioso (agr-odoo) 7ec2153ca9 [FIX] hr_expense: fix paid status in expense
Create an expense
Save, create the report and go through the full flow up to the payment
Once paid, the expense sheet will remain in "posted" status, never going
to "paid".
This occur because the action which update the status
react only to invoices
https://github.com/odoo/odoo/blob/d9c715c53d51c21fa105aa35f650d54ea909220a/addons/account/models/account_move.py#L4287
https://github.com/odoo/odoo/blob/d9c715c53d51c21fa105aa35f650d54ea909220a/addons/account/models/account_move.py#L4381

opw-2308203

closes odoo/odoo#55633

X-original-commit: fe618a43eb79b7e2b85fa83da7b321055f5ed0b1
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
2020-08-07 13:42:14 +00:00
Martin Trigaux 80e97e98ce [IMP] *: use named placeholders in translated message
When more than one parameter is present in a message, it helps the
translation to use named placeholder. This way, the order can be
changed. It also helps the comprehension of the message.
2020-06-18 13:03:34 +02:00
Anh Thao Pham (pta) 3bd345597f [REF] hr*: convert onchange methods to stored-editable computed fields
Impacted modules:
hr, hr_contract, hr_recruitment, hr_payroll, fleet, hr_skills, hr_appraisal, ....

Several onchanges have been converted to computed fields in the following modules :
    Community :
        - hr
        - hr_contract
        - hr_recruitment
        - hr_work_entry
        - hr_maintenance
        - hr_expense
        - hr_expense_check
        - hr_holidays
        - sale_expense
        - account_analytic_default_hr_expense

    Enterprise:
        - hr_contract_salary
        - hr_referral
        - hr_payroll
        - hr_payroll_expense
        - test_l10n_be_hr_payroll_account

There are still 2 onchanges with complex behavior that couldn't be converted easily:
- an onchange that updates "tz" (timezone) that is defined as a related field
  to "resource_id.tz". Apparently it is useless except to initialize the default
  value of "tz".
- an onchange that updates "name" that is defined as a related field to
  "resource_id.name".
  the applicant.

closes odoo/odoo#45414

Taskid: 2169099
Related: odoo/enterprise#8572
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-04-20 10:32:45 +00:00
Laurent Smet caeb782841 [IMP] account,*: Improve bank statements/payments workflow
- Create journal entries as soon as bank/cash statement lines are created, temporary booked on a suspense account set on the journal.
- Simplify the management of "blue" lines in the reconciliation widget. A "blue" line is now a journal item using a temporary liquidity account (outstanding payment/receipt accounts, set on the journal).
- Adapt and simplify the bank reconciliation report.
- Remove the bank reconciliation threshold date. The reconciliation report will show the not already reconciled journal entries using a liquidity account and the not already reconciled journal entries using a temporary liquidity account. Without accounting, an account.payment will involve directly the liquidity account and then, will be considered as a statement line directly.
- Remove the post_at bank reconciliation feature. The "paid" state will be set on the invoices only if reconciled with a journal entry involving the journal's liquidity account.
    With invoicing, the payment will do that so the "in_payment" state should never be shown up.
    With accounting, only the statement lines have the power to move an invoice to the "paid" state.
- Fix various corner cases about the management of multi-currency in bank statement lines.
- Fix the conversion dates in multi-currency: Since the bank/cash is always used on the statement lines, it will use always the real "bank" date instead of the fictive payment one.
- Ensure the 'reconcile' method will raise an error if the involved moves are not posted.

related enterprise PR odoo/enterprise#7019

closes odoo/odoo#41301

--task: 2092096
Related: odoo/upgrade#1018
Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2020-04-10 09:47:24 +00:00
oco-odoo 4b629c7243 [FIX] account, hr_expense: incorrect forward-port
Incorrect forward-port of e09798098679f made in 51d49517a8b5af2d1c85d9c6.

closes odoo/odoo#45775

X-original-commit: 099d0d6785b85dd67ef091fdaef084713fafb3c0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
2020-02-20 08:55:15 +00:00
oco-odoo 4dd36a86e9 [FIX] account: fix bank account requirement on account.payment form
When making a payment for multiple vendor bills at once, it is possible that payments will be generated without any recipient bank account for payment methods normally requiring one. In such cases, the user needs to be able to correct the payments by cancelling them. It was not possible.

closes odoo/odoo#45082

X-original-commit: 9aec95dccef48a9ec89691f5721619ffc0e4da56
Signed-off-by: oco-odoo <oco-odoo@users.noreply.github.com>
2020-02-17 16:12:48 +00:00
Xavier Morel de590816d8 [FIX] *: deprecated access to url_ utilities through werkzeug root
In 0.15 accessing werkzeug.urls functions directly through werkzeug
is deprecated, the shortcut will be removed in the eventual werkzeug
1.0.

Fix existing uses of these shortcuts. Also cleanup some imports when
they're not far from a werkzeug* import being altered.
2020-02-04 12:42:35 +00:00
fw-bot fccaa703c4 [MERGE] project, hr_expense: Fix several multi-company issues + tests
Purpose
Fix multi-company access issues following the big changes that happened
(the 13.0). Make the usability better in order to avoid potential
multi-company issues for the user.

Specification
Check the related commits to see the different fixes that have been
made. For more information about the technical/functional considerations,
check the related task.

Taskid: 2088891
X-original-commit: 5c8df3a5e5f7960e5eab6439e0a32a06224ba826
2020-01-15 15:11:50 +01:00
Xavier Morel 2c123005a7 [REM] dynamic domain from hr_timesheet
closes odoo/odoo#40952

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-11-29 09:10:07 +00:00
Christophe Simonis 5a273e74f0 [MERGE] forward port branch saas-12.4 up to fe59754c52
closes odoo/odoo#36721

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-13 13:32:51 +00:00
jem-odoo be8731cc6a [IMP] hr_expense: posting flow in multi company environment
This commit tries to fix multi company problem in Expense application. Indeed, no check
were done to ensure this business flow. Some technical decisions were made:
- journal company: the journal define the company in which the accounting entries will be
created. We know ensure with 'domains' and constraints that the journal have the same
company as the expense sheet.
- journal conditionnally required: the journal is only required when posting the expense. It
is set by defaut on creation, but can be modify by accountant users. This is why the expense
company determine the journal and not the opposite.
- company fields required: As we need to use the company from the expense / expense sheet to
determine the journal field and since expense models are business models, we needed to put
company fields required.

Business Flow
When an employee creates an expense, the expense should be in its current company. A
product from any allowed company can be chosen. Only the taxes of the expense company are
applied to compute amounts. Then a report (sheet) can be created. We ensure that the expense
lines of a report belongs to the same company as the report and to the same employee. Once
submitted and approved by manager, the account journal can be set: it is forced to be in
the same company as the expense report. The accounting entries are created in the journal
(and expense report) company. As the analytic account can be shared (company is not set)
the analytic entries will be in the expense company (handle by the accounting module).
The payment is now registered in the expense company.

Migration
As company fields are now required, fill the company fields with the company of the related
employee, or fallback on the one from the journal.

Task-1999686

closes odoo/odoo#36447

Signed-off-by: Jérome Maes (jem) <jem@openerp.com>
2019-09-05 07:48:32 +00:00
Christophe Simonis 51354fadb0 [MERGE] forward port branch saas-12.3 up to 50e571acf7
closes odoo/odoo#36491

Signed-off-by: Christophe Simonis <chs@odoo.com>
2019-09-11 09:39:33 +00:00
Christophe Simonis 9bf0b04adb [MERGE] forward port branch 12.0 up to 82a8cdd6f2 2019-09-06 17:52:48 +02:00
Christophe Simonis 82a8cdd6f2 [MERGE] forward port branch saas-11.3 up to 091aa33190 2019-09-06 16:51:57 +02:00
Lucas Perais (lpe) 7c28c97724 [FIX] hr_expense: sheet multi expense partial payment
Create two expense and put them into one sheet
Post the sheet

Make One partial payment with the wizard (Register Payment)
Do it again for the residual amount

Before this commit, it crashed because the second payment tried to reconcile
itself with an already reconciled line

After this commit, all the lines that need to be reconciled
actually are without crash

OPW 2065501

closes odoo/odoo#36454

Signed-off-by: Lucas Perais (lpe) <lpe@odoo.com>
2019-09-05 09:22:20 +00:00
Prakash Prajapati c058562d73 [IMP] various: Add multi company domains on views
When the many2xxx field relates to a model where company_id is required, set
this  domain [('company_id','=',company_id.id)]

When the company_id field of the related model is not required, set this domain
['|',('company_id','=',company_id.id),('company_id','=',False)]

When setting the domain on a field which is in the treeview of a xxx2many field
evaluate against the company_id of the 'parent'.

Some constraints have been added on sereval models. Take a look at the complete
specification for more details.

TaskID: 2024446
Closes: #35266

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-08-16 11:17:28 +00:00
Yannick Tivisse f5dfe4727c [IMP] api.py: Rename company_id/company_ids into company/companies
The goal is to be coherent with the user property.

Actually, company_id and company_ids on the environment are no fields.

Calling env.company_id returns a browse record, not an id.
2019-05-29 08:09:15 +00:00
Lucas LefèvreandYannick Tivisse 3e97cff779 [IMP] base: Remove customer and supplier fields from res.partner
Purpose
=======

Fields `customer` and `supplier` on `res.partner`
are mostly used in domains of many2x fields.

Those domains can confuse end users because they don't
see the partner they are looking for; and it's not obvious why.

Some identified problems:

1. It can lead to duplicated partners: the user does not find
   the partner, so he creates a new one.

2. The user imports supplier contacts in the Contacts app, so they
   don't get the `supplier` flag. Then the user wants to make a purchase order,
   and cannot find the new suppliers in the list

3. A user removes the customer flag on a prospect, because they don't think
   it's a customer yet - except now they can't make a quote for that customer...

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

Remove the two mentioned fields.

Since fields `customer` and `supplier` have been removed, all partners
are now shown in many2one dropdowns.

But in some cases, not all partners are relevant or some are more likely
to be relevant than others. e.g. when creating a PO, top suppliers have a
higher priority than other partners.

So, adapt the places where those fields were used with the new mechanism to
display the searched the partners, according to the number purchase/sales
orders they made.

TaskID: 2031147

Co-authored-by: Yannick Tivisse <yti@odoo.com>
2019-08-01 12:42:03 +02:00
Adrian Torres 4b38cc6590 [REM] *: calls to @api.multi
Multi is the default api for methods, it is not necessary to explicitly
decorate methods with it, adds clutter and most people use it because
they see that the rest of the code uses it.

Done with `find . -type f -name '*.py' | xargs sed -i '/@api.multi/d'`
2019-07-17 14:13:12 +02: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
Hiral Bhavsar 3cd7ed07a2 [IMP] *: remove 'view_type' on window actions.
The old tree views don't really exist anymore, this odd pseudo-flag to
dispatch between "list" and "tree" tree views has no reason to remain.

Task 1937686

closes odoo/odoo#31243

Signed-off-by: Xavier Morel (xmo) <xmo@odoo.com>
2019-06-17 11:34:17 +00:00
Yannick Tivisse a5b6f31cf2 [IMP] base: Contextualize the multi company
Purpose
=======

Allow the user to select the allowed companies for which he wants to see records
on top of selecting his current company.

It is confusing for users to see the records from the company he is connected to
and the records of the children companies.

Instead of using the hierarchy of companies to access records across companies,
the user can now select (from his set of allowed companies) the companies for
which he wants to access records.

/!\ This means that the user will interact with records from company A when in
company B.
Example: a SO has been created and confirmed in A. When in B, I create the
invoice from it.

Specifications
==============

1/ Deprecate the parent/children hierarchy on the res.company model. The fields are
kept on the res.company model to ensure the retro-compatibility, but won't be used
accross the standard code anymore. The only functional usage for this mechanism
was to allow to see records from several companies by creating a virtual parent
company, which will be possible with the new mechanism.

2/ By default, a user will only see the records of the company he is connected
to (or records without a company). (It is still editable by the user if needed).
For that, put this information in the user context, to allow having different
configurations on different browser tabs. Instead of having domains like
['|',
('company_id', '=', False),
('company_id', 'child_of', user.company_id.id)]
you'll have something like
['|',
('company_id', '=', False),
('company_id', 'in', company_ids)]
Note that the 'company_ids' is a value that is passed in the evaluation
context on the record rule, as we already have user, or time.
company_ids is a list of the ids of all the enabled companies in the
user's context.

3/ Out of the generic improvements brought by this task, this will illustrate
issues that could exist since several versions. For example, it should not be
possible to create a scrap order for the company A with a package of the company
B, or it should not be possible to create an invoice on the company A with
payment terms from the company B. Before the version 12.0, it was easy to
encounter this kind of issues as the admin was the SUPERUSER_ID. A positive side
effect of the fact that the SUPERUSER_ID has become an inactive user was to
make it more difficult to introduce mismatch on the records, but haven't solved
the issue, as it was still possible to do it with parent companies
configuration. Some of these issues have been fixed in this commit, but all the
business flows should be re-tested to check if an ir.rule should be introduced
(eg: a multi company rule for stock.quand.package), if the company of a record
is correctly transfered to another record created from the first record (eg:
From a SO, create an invoice and a payment, the company of the sales order
should be transfered on the invoice and the payment, even if the company of the
sales order is A and I'm logged into the company B with the company A enabled.

4/ Currently, if I click on a button on a notification email (example 'View
Task'), I face a traceback if I'm not logged into the company of the record.
Now, if you click on a button and if you have access to the record, the correct
company will be automatically set.

5/ If I display a kanban view with several records from several companies (and
an image), all the images should be displayed.

6/ Currently if you copy paste an url, this will crash if you're not in the
correct company. This won't be fixed because it's quite impossible to do it in
a clean way. This task brings a workaround. Copy/Paste -> Traceback -> Log into
the correct company, re-copy/paste -> Ok.

7/ 2 property methods have been added on the environment to retrieve the company
on which the user is logged in and the companies the user enabled, on a specific
tab.
That way, when creating a record, instead of doing
default=lambda self: self.env.user.company_id
do
default=lambda self: self.env.company_id
On the other hand, to retrieve the enabled companies, do
companies = self.env.company_ids

8/ Modify the Company Switcher widget to allow to log into another company
WITHOUT writing on the res.users (and thus bringing cache invalidation issues
and so on). Also allow to enable several companies and see records from several
companies, and independantly of the other browser's tabs.

9/ When focusing on a tab, save the current company configuration on the local
storage. That way, when doing 'CTRL+T' or a middle click, the context is
propagated to the new tab.

10/ Improve the error message in case of multi company access errors. Now, when
the user is in debug mode, display the related names of the records and the name
of the user who brings the issue.

11/ Remove the context erasing when writing on a res.users
This is probably coming from the migration to new API of the base module.
The context was not propagated at this moment, which was a common mistake at
that time. When migrating the module, probably by using the 'black box' method,
as the context was not propagated, it was erased on the new version. This is
now an issue because the context (i.e. the enabled companies) was erased when
writing on a res.users, leading to tracebacks.
See: https://github.com/odoo/odoo/commit/7eab8e26d3d46c53f4be924d6a34e80a66e74960#diff-4c2e738ee8f64f11806c889ea097b5e7R624

12/ Fix the crash manager on redirect warnings. The issue is the following
- Create an invoice on a company without a configured CoA.
- Set a partner
- On the onchange_partner_id, a redirect warning is raised to propose you
to configure a CoA
- Click on 'Go to the configuration panel'
- A generic warning says something like 'Do you want to discard your changes?'
- Click on yes, the page refreshes, but not on the redirect action.
Now, set correctly the action on the hash, and reload instead. The breadcrumb is
lost for example, but you reach the correct action at least.

13/ Introduce a res.group to enable/disable the multi company per tab
feature.

14/ To help the users to know which tab is in which company, add the
possibility to have a favicon per company. When creating a company,
the classical 'O' icon is colored by default in a random color.

15/ Remove the company switcher on the frontend. This was mainly there
to allow a user to swicth to the company linked to the website.
This behavior is now transparent to the user. If the website A is
activated, then the company set on the context is the company of the
website.

16/ Deprecated the _company_default_get method on the res.company
model. Remove the method _get_company on the res.users model.

17/ Add 'allowed_company_ids' and 'current_company_id' on the pyeval
context. You can now use those variables on domains in the views to
access directly to the activated company.ies on the current tab.

TaskID: 1960971

closes odoo/odoo#32341

Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2019-05-13 08:57:49 +00:00
wan 6940cfddbc [IMP] account: visible but not required bank account on payment
When making a manual payment with account_sepa we want to allow people to add a bank account as it might display the European QR code for banking app, but this should stay optional.
So we made sure that the conditions making the field visible and required weren't the same.

part of task #1918423

closes odoo/odoo#32198

Signed-off-by: Quentin De Paoli (qdp) <qdp@openerp.com>
2019-04-04 12:46:20 +00:00
Nimesh Jethva a308506051 [IMP]hr_*: Improvement in model description
Purpose of this commit is to give description more "business oriented"
because those descriptions appears in Odoo Studio which is supposed to be used by end users, not only by developers.

Related Task ID : 37311
2018-09-21 11:45:15 +02:00
qsm-odoo c59380bac5 [REF] *: BS4, rename btn-default to btn-secondary
BS4 "btn-default" class was replaced with "btn-secondary", which makes
more sense.
2018-07-27 12:36:54 +02:00
Olivier Colson a33961f229 [REF] account: recipient bank account available in payments
This field is somewhat generic, as anyone could want to specify it and as it is used by several batch payment methods. It is thus now factorized in the core module.
Enterprise module 'hr_expense_sepa' is thus not needed anymore as its code can be put in hr_expense

Was part of task 33323
Was PR #25562
2018-07-09 09:24:11 +02:00
d-fence c030213fa3 [IMP] hr_expense: Allow a user to refuse an expense sheet from a line
Purpose
=======

Currently, a manager or a accountant can only refuse one expense report with a justification message.

If there are a lot of lines too comment individually or if only one line should be modified, the manager or the accountant can now refused one line and give a reason for it. That will refused the expense report automatically while waiting the employee to make the modifications.

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

- Rename wizard files, models and ids according to the model

- Allow to refuse one or several lines with a reason

- Use a qweb template to log messages, use message_post_with_view instead of message_post

- Print expense name instead of sheet name. In the log when expense is refused, it prints expense report name instead of expense

- Prevent modifying approved expenses
	* A user should not be able to modify an expense once approved
	* Method refuse_expense renamed to refuse_sheet when applied to a whole
	expense report/sheet
	* 'model' dict key renamed to something more explicit and less prone to
	confusion (passed in context to the refuse wizard)
	* Usage of explicit fields in the wizard to avoid confusion
	* Overriding 'default_get' to get default values for those fields

- When an expense is paid or reported, it must be impossible to refuse it.

- Replace refused expenses tree
	Purpose: The menu 'Refused expenses' is confusing. This improvement
	replaces it by 'Refused Reports' and leads to the refused reports tree
	view. That way, it's easier for the user to find back his refused
	expenses reports.

- Hide create button on refused
2017-09-01 15:30:30 +02:00
Laurent Smet 4ffb61db1d [IMP] account: allow to register payments for several partners, from invoices.
This patch allow to select several invoices/refunds or bills/bill refunds and launch the contextual action to register a payment for all of them.
Where, before, the system allowed that only if there was a single partner, it will now create and post a payment for each of them.

Was PR #https://github.com/odoo/odoo/pull/15228
Was task: 24014
2017-06-20 13:34:20 +02:00
Olivier Dony ba15df47cb [MERGE] Forward-port saas-15 up to 17b847c0f6 2017-06-01 01:10:29 +02:00
Olivier Dony b9e2207267 [MERGE] Forward-port 10.0 up to 7e44444878 2017-06-01 00:15:27 +02:00
Yenthe V.G c36c5454ae [FIX] hr_expense: untranslated string
Closes #17255
2017-05-29 11:01:59 +02:00
xmo-odoo b4429c2a91 [FIX] Various P3-related import changes
* LDAP import: python-ldap is not python3-compatible, pyldap is

  Warning: only supported from debian Stretch (current testing)?
  https://packages.debian.org/search?searchon=names&keywords=pyldap

* implicitly relative imports
* imports of moved or removed stdlib modules

issue #8530
2017-04-28 09:06:53 +02:00
Christophe Simonis 85368d7f86 [MERGE] forward port branch 10.0 up to 387b2acfcb 2017-02-23 20:15:38 +01:00
Denis Ledoux b36b79cfbc [FIX] hr_expense: hook to allow override the payment values
As it's done in
https://github.com/odoo/odoo/blob/10.0/addons/account/models/account_payment.py#L149

This is to allow `hr_expense_sepa` to inject the bank account
when creating the payment.

opw-708451
2017-02-20 12:49:52 +01:00
jpr-odoo 9e26d875db [IMP] *: uniformize modals buttons: remove 'oe_link' class and 'or' between buttons 2016-11-09 15:27:01 +01:00
Christophe Simonis f4738e7bb5 [MERGE] forward port branch saas-12 up to 78e9c7f 2016-08-26 18:06:17 +02:00
Yannick Tivisse 3b5d6da5c1 [FIX] hr_expense: Solve several usability issues on the flow
Review the subtypes
===================

- Add a subtype for the paid expenses
- Correct subtypes wording

Prevent expense report for several employees
============================================

- Can add lines from every employee, leading to account issues (payable / receivable)
  Raise an error if you try to report several expenses for different employees

Don't track onchanges on journal_id
===================================

- Expense Sheet, click on Post Journal Entries: you have 2 produced messages, and
  one is strange (Journal Entry: * 1 ?)

Remove useless message on chatter
=================================

- Remove the message to say that the expense report has been validated by ...
  It's redundant as the visibility tracker already logs this change

Remove unused method
====================

- 'refuse_expense_sheets' is declared but never used

Log a link to the payment on chatter
====================================

Expense Sheet, click on Register Payment: you have a message containing the
payment name (SUPP.OUT/2016/0001). Add a link to the form view.

Expense duplication
===================

Do not copy 'sheet_id' on duplication. It's wrong and has as secondary effect
to duplicate the state too.

Expense Report tree view
========================

Display correctly the widget monetary
2016-08-25 16:06:44 +02:00
Thibault Delavallée c8a313d51e [IMP] various: use odoo for imports instead of openerp and update class names 2016-08-10 15:48:07 +02:00
Yannick Tivisse f066b1ec4f [IMP] hr_expense: Onboarding improvement + mail gateway
1/ Modify the no content help message for hr_expense with a dynamic part
   which describe how to create a new expense by mail
2/ Mail gateway mechanism. New customizable email alias expense@domain
   that creates a new expense by sending an email to it. Check several things
   - Check that the email_from is the same than one of the employees or than
     on of the related users to employees. If not, send back an email to say that
     the expense will not be created.
   - If the email address is valid, check if something is between brackets '[]'
     If it is the case, check if it is linked to a product internal reference
     and set it accordingly. If nothing is found, use a default product
     'Fixed Cost'
   - If one/several float(s) are found in the mail subject, take the last
     occurence and set it as the expense total amount.
3/ If a product template is created, to not add taxes on it. We don't expect it
   to have additional taxes
4/ Under Expenses -> Configuration -> Expense Product, use a simplified product
   view with only the needed fields.
5/ When generating the account move lines, use the account defined on the expense
   line, not the sheet
6/ When creating a payment, make a reconciliation on the payable account move lines
   That way, if the total amount on the expense is paid, the expense will be set to
   paid automatically when registering a payment
7/ Add a one-page planner to explain how to use the email alias
8/ The field account_id on the expense sheet was informative. After some tests, it
   seems that it's more confusing than helping. So we removed it
9/ Add a domain on the field 'bank_journal_id' to select journals of
   type 'cash' or 'bank'
10/ If the number of expense lines is equal to 1, the expense summary on the expense
    sheet should be the same name the line. So the process can be done in one click
2016-06-21 14:09:48 +02:00
Yannick Tivisse 717f9217bb [IMP] hr_expense: bring back the sheets + other new features
NB:
- The option no_delete is not working, a fix will come from chm
- The many2many widget on a sheet creation is not working correctly as
  the called command is a (1, id, values) without a (4, id, _) before.
  A fix will also come from chm, but a disgusting hack has been
  provided for this particular case (to remove after chm fix)
2016-06-17 12:14:57 +02:00
Foram Katharotiya 52d72e61de [MERGE] hr_expense: module rewritten for more easiness and a better usability. Concept of expense sheet removed. Was PR #7387. 2015-09-04 17:23:19 +02:00