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
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)
code improvement
code improvement
payment_method to payment_method_id
writeoff_account to writeoff_account_id
property_account_receivable to property_account_receivable_id
property_account_payable to property_account_payable_id
property_account_expense_categ to property_account_expense_categ_id
property_account_income_categ to property_account_income_categ_id
property_account_expense to property_account_expense_id
property_account_income to property_account_income_id
property_account_expense_categ fix
sale_tax to sale_tax_id and default_sale_tax to default_sale_tax_id
purchase_tax to purchase_tax_id and default_purchase_tax to default_purchase_tax_id
ref_companies to ref_companies_ids
property_account_position to property_account_position_id
property_payment_term to property_payment_term_id
property_supplier_payment_term to property_supplier_payment_term_id
bank_accounts_id to bank_accounts_ids
payment_method fix after rebase
user_type after rebase
payment_method fix after rebase
after rebase
invoice to invoice_id
fix payment_method_id after rebase
code improvement
[IMP]user_type to user_type_id
[IMP]property_stock_account_input_categ, property_stock_account_output_categ to _id
[IMP]improve after rebase
[IMP]fix type
[IMP]Account: code improvement
Setting an expense with a tax included with a negative base code sign was
getting the wrong amount (tax line as a credit instead of debit). So leading to
a total for the accounting entry superior of the total of the expense (should
not happend as the tax is included).
Add test to verify this scenario.
Fixes#4260, opw 618531