Commit Graph
21 Commits
Author SHA1 Message Date
fw-bot 0a8f4b6cda Purpose
=======

This PR is in the continuity of odoo#62360.

- Display remaining hours in task sales_line_id (name_get + task form view)
- Remove internal reference from services demo data
- Display sol in project timesheets list if project is billable
- Remove use of non_allow_billable in timesheets as it has been removed from project and task in previous PR (see above)
- Only recompute planned_hours for service product
- Determine the correct SOL for timesheet
- Set the last SOL of customer on timesheet if none is set on task or project
- Allow edition of so_line in timesheet
- Restrict SOL on project to sale lines with a service product
- Use same widget on partner_id many2One than in sale.order (using ranking)
- Remove timesheets table in SO and invoice portal.They were added in previous PR (see above). This introduces the use of links to /my/timesheets/.
- Review portal timesheets (my/timesheets/ and link from orders and invoices)
- Activate group_uom "Units of Measure" on sale_timesheet install
- Hide partner phone number in task form view
- Only determine SOL of task and timesheet if allow_billable=True
- Filter SOL in task so that it matches the SOL of the project SO
- Display red label if remaining hours is negative
- Change SO compute behavior
- Only open SO for salesman on project overview

task-2409761

--
I confirm I have signed the CLA and read the PR guidelines at www.odoo.com/submit-pr

closes odoo/odoo#63695

Forward-port-of: #62900
X-original-commit: b1985773f3a67e28049f9e2bb635bcab059ad9c0
Related: odoo/enterprise#15427
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-12-22 13:40:28 +00:00
Kevin Baptiste 45bb6f6e39 [IMP] hr_expense: show alias_email on list helper
The "Incoming Emails" setting is now enabled by default and the email
address shown on the list helper.

closes odoo/odoo#56069

Taskid: 2300864
Related: odoo/enterprise#12494
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
2020-08-18 14:48:47 +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
Rohan PatelandLucas Lefèvre 4ba8f51d87 [IMP] hr_expense: improve mail gateaway
1/ Send mail notification if expense is registered successfully

Before this commit, when user submits the expense via email, user is not getting
information about whether expense is registered or not. After this commit user
will get a confirmation email.

Few other usability improvements,
- Improved tooltip for the field 'default_code' in expense's form and in the
'Emails' config setting.
- Added product's default code in product's kanban view
- Filtered uom based on category of product's uom.

2/ Better parsing of expense mail subject

Criteria for matching expense product from email subject is changed,
  - The product code should be the first word of the subject.
  - Only expense products are allowed, previously there was no filter and user was
    able to select any product in expense via mail.

Currency support is added,
  - Now user can specify currency symbols and ISO code in expense mail subject.
  - If subject contains multiple numbers in that case, number with currency will
    get higher priory, and it selected as an amount in expense.
  - If multi currency is active, user can use any active currency symbol/ISO code
    in mail subject. Respective currency will be selected in registered expense.
  - If multi currency is not active, user can only pass company currency. Other
    currencies are ignored and expense will be registered as default company currency
  - If user pass non active currency in subject then that currency will be ignored
    and expense will be registered as default company currency

Examples:
PROD_CODE 2 foo $1205.91 baz

Added python test cases for mail subject parsing.

Related to task #35093
closes #22168

Co-authored-by: Lucas Lefèvre <lul@odoo.com>
2019-01-24 13:08:27 +00:00
Fabien Pinckaers bed29a4aea [IMP] product: Unify/Clean product demo data
PURPOSE
=======

1. Unified product demo data
2. Less demo: one per use case
3. Demo data for all models

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

1. Refactor all the brol in the demo data
2. Adapt the tests to make them green, as some products are
   renamed, removed, created in python instead of as demo data
   ...
2018-07-05 08:57:41 +02:00
Christophe Simonis aeef0c5973 [FIX] hr_expense: remove duplicated defined records 2018-05-04 17:57:45 +02:00
XavierDo 2966d4faed [IMP] product: rename product.uom into uom.uom
Also rename product.uom.categ into uom.category to
 give it a decent name.
2018-02-26 14:27:26 +01:00
Thibault Delavallée 561ae286f9 [MOV] hr_expense: split data to separate mail data from other data
It is simpler to have data split by main model or application like we
already do for models and views. It allows to easily have an overview
of data a module holds.

As we will work on mail related data like adding activities or tweaking
subtypes and templates, having them all in a single file and not lost
between other data helps finding and working with it.

This commit only moves code. No functional change should occur.
2018-02-21 16:51:38 +01:00
Mehul Patel 257bf539d5 [IMP] sale_timesheet: add demo data
This commit adds demo data to populate
the project overview with billable
timesheet on sold projects and tasks.
This will ease the testing and reinforce
the wow effect during demonstration.

Note: those demo data should never be
involved in python test cases.

Closes #21132
2018-02-20 09:34:56 +01:00
fda-odoo 2df2afc405 [IMP] hr_expense: improve useability of hr_expense
- Change the differents states of hr.expense to have
ToSubmit, submitted, approved, refused and paid.
- Add a responsible field on employee model. The responsible is a res.user that belong to the group "hr_expense.group_hr_expense_manager"
The commit change too a "vals" variable that changed in a git rebase operation.
- Make the other_info tab invisible if the user doesn't belong to account.group_account_user.
- Make expense wizard (for expense lines) editable if expense is in reported mode, so when the sheet is in To submit state.
- Move a tour from expense form to expense_sheet form
- rename two fields (attachments and manager)
- The buttons "approve" and "expense" must be hidden if the user isn't the expense responsible.
- The description field of expense line must be editable in draft, reported and refused state
- Add a subtype to follow responsible changes on expenses sheets
2018-01-25 15:51:57 +01:00
jem-odoo 9f35ae0602 [MOV] hr_expense: move files to fit guidelines 2018-01-15 17:16:05 +01:00
Christophe Simonis b31cd558e5 [MERGE] forward port branch saas-14 up to b857fd4c90 2017-07-19 17:04:28 +02:00
Nicolas Martinelli 957d57eaf7 [FIX] hr_expense: mail to manager
When an employee submits an expense, no mail is sent to the manager.
This should be the case, since it works this way on holidays.

The trick, however, is that the expense is created as submitted, but the
followers are only added afterwards. We need to make sure to add the
followers at creation.

opw-751085
2017-07-18 13:53:13 +02:00
Fabien Pinckaers eee806e4a4 [IMP] *: remove #general messages at module installation 2017-01-07 21:31:11 -08: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
Yannick Tivisse 47728ccd40 [FIX] hr, hr_expense: Allow employees to send emails to aliases
New feature in mail module
==========================

Currently, an email can be sent to an alias from:
- Everyone
- Authenticated Partners
- Followers

This commit is intended to add another category: Employees
The main purpose of this new feature is to allow employees to send an email
to an 'expense' alias in order to create automatically their expenses with
their mobile phones.

Use this new mechanism in hr_expense
====================================

Currenlty, we're overriding message_new to make a security check and create
an expense if the sender is an employee or bounce otherwise, which is not the
correct way to achieve this. A better way is to use the alias mechanism now
that it has been extended to employees too.

Don't hardcode email_from
=========================

The email_from of the bounce email is hardcoded to "help@odoo.com". I am sure
they will be happy to receive all answers from any odoo instance

Review the bounce email content
===============================

content: Your expense has not been created because your email address is not set
on an employee or on a employee's user. Configure your employee's information correctly and try again.
-> this is a message for the admin, not an employee or anyone else

Now the content is generical for aliase defined for employees.
2016-08-25 14:55:08 +02:00
Thibault Delavallée 1077423f81 [FIX] hr_expense: fix context access in mako template
As context is a keyword in mako, odoo context is actually called ctx
in mako templates. Otherwise any rendering of the template will
crash.
2016-08-16 14:00:19 +02:00
Fabien Pinckaers b0c9ee669b [FIX] Product view opens as a list view
[IMP] improved planner content
[IMP] Misc usability improvement:
	cost instead of sale price on product form
	improved views and terminologies
	journal entry is RO
2016-06-21 17:23:49 -07: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