Giter VIP home page Giter VIP logo

hr-expense's People

Contributors

aungkokolin1997 avatar manuelregidor avatar mymage avatar oca-git-bot avatar oca-travis avatar peluko00 avatar saran440 avatar weblate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

hr-expense's Issues

Expense cannot post journal

Module

Employee Advance and Clearing

Describe the bug

When I want to Post Journal of Employee Expense when I Click "Post Journal Entries" I got Error

`Odoo Server Error
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_http.py", line 237, in _dispatch
result = request.dispatch()
File "/usr/lib/python3/dist-packages/odoo/http.py", line 684, in dispatch
result = self._call_function(**self.params)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 360, in _call_function
return checked_call(self.db, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/service/model.py", line 94, in wrapper
return f(dbname, *args, **kwargs)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 348, in checked_call
result = self.endpoint(*a, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 913, in call
return self.method(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 532, in response_wrap
response = f(*args, **kw)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1396, in call_button
action = self._call_kw(model, method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/addons/web/controllers/main.py", line 1384, in _call_kw
return call_kw(request.env[model], method, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 399, in call_kw
result = _call_kw_multi(method, model, args, kwargs)
File "/usr/lib/python3/dist-packages/odoo/api.py", line 386, in _call_kw_multi
result = method(recs, *args, **kwargs)
File "/mnt/extra-addons/tongthai/hr_expense_advance_clearing/models/hr_expense_sheet.py", line 94, in action_sheet_move_create
res = super().action_sheet_move_create()
File "/usr/lib/python3/dist-packages/odoo/addons/hr_expense/models/hr_expense.py", line 906, in action_sheet_move_create
res = expense_line_ids.action_move_create()
File "/usr/lib/python3/dist-packages/odoo/addons/sale_expense/models/hr_expense.py", line 46, in action_move_create
return super(Expense, self).action_move_create()
File "/usr/lib/python3/dist-packages/odoo/addons/hr_expense/models/hr_expense.py", line 510, in action_move_create
move_line_values_by_expense = self._get_account_move_line_values()
File "/mnt/extra-addons/tongthai/l10n_th_account_tax_expense/models/hr_expense.py", line 34, in _get_account_move_line_values
move_line_values_by_expense = super()._get_account_move_line_values()
File "/mnt/extra-addons/tongthai/hr_expense_advance_clearing/models/hr_expense.py", line 65, in _get_account_move_line_values
emp_advance = self.env.ref("hr_expense_advance_clearing.product_emp_advance")
File "/usr/lib/python3/dist-packages/odoo/api.py", line 514, in ref
return self['ir.model.data'].xmlid_to_object(xml_id, raise_if_not_found=raise_if_not_found)
File "/usr/lib/python3/dist-packages/odoo/addons/base/models/ir_model.py", line 1952, in xmlid_to_object
raise ValueError('No record found for unique ID %s. It may have been deleted.' % (xmlid))
Exception

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/odoo/http.py", line 640, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/usr/lib/python3/dist-packages/odoo/http.py", line 316, in _handle_exception
raise exception.with_traceback(None) from new_cause
ValueError: No record found for unique ID hr_expense_advance_clearing.product_emp_advance. It may have been deleted.`

To Reproduce

Affected versions: 14

Expected behavior
I want to Post Journal Entries.

[V14] hr_expense_invoice, bill created without vendor, bill line gone when vendor is added, can create multi line expenses into a vendor bill

approved

I want to create the two lines into a vendor bill (i see no buttons for this, in the form or in the action menu)
There is a button "create vendor bill" on each line when the button is clicked on each line, 2 separate draft vendor bills are created without a vendor (so it can't be posted), try a vendor in the bill --> the bill line is gone
The expense report can't be posted as well.

To Reproduce

Affected versions: Tried in V14 on runboat

  1. Create a petty cash holder
  2. Create vendor bill (check petty cash) and register payment to fill the petty cash
  3. Create expense 2 expense items product lamp and chair, check paid by petty cash and add the petty cash holder created before
  4. create expense report for the 2 expense items created
  5. submit to manager
  6. Approve the report
  7. There is no button to create into one bill (expected is have an option to create multi-line into a bill if vendor for product is the same
  8. click "create vendor bill" button on each line --> two draft vendor bills are created without vendor
  9. Try add a vendor onto the vendor bill --> the bill line is now gone (should be not gone)

Expected behavior

  1. expected there is an option (button) to select and to create expense lines in the report into a bill
  2. when there is no vendor on the created draft bill, and then we add a vendor there, the bill line should not be kept there..

Additional context

Is there any config that i miss?

[16.0][BUG] hr_expense_invoice: Cannot Edit Vendor Bill Created from Multiple Expenses

Bug: Cannot Edit Vendor Bill Created from Multiple Expenses

I have encountered an issue with the hr_expense_invoice module in Odoo, specifically when trying to create a vendor bill from multiple expenses. When the total expense amount is €115 and the "Create Vendor Bill" button is used to generate the invoice, the resulting vendor bill cannot be edited to properly account for the expenses.
Steps to Reproduce:

Expected Behavior:

The vendor bill created from multiple expenses should be editable, allowing for proper accounting and adjustments as needed.

Actual Behavior:

The created vendor bill is not editable, preventing necessary adjustments and correct accounting of the expenses.

Thank you very much for you attention
Best regards,
Rafael

@moduon MT-5202

Please could you give an opinion @SoniaViciana @victoralmau @kwoychesko @JordiBForgeFlow @alexey-pelykh @dreispt @tafaRU @gurneyalex ?

Thank you!!!! 😄 ❤️
Best regards!
Rafael

References:

  • #245 (Issue closed in 2 minutes - Fastest ever - Promotes contributions and really compliance with OCA rules about how to welcome new-contributors)
  • #244 (PR closed in 18 minutes)

HR-EXPENSE [15.0] - hr_expense_journal -

Dear @Saran440 ,

I hope you are well.

I am using your module with success.

Question about "When creating the Expense Report, the selected Payment Type is used to populate the "Bank Journal" field, in the "Other Setting" tab." ?

If I have created a new Journal "AMEX1" and force "Payment Journal" = "AMEX1", why this journal is not populated ?

Best Regards
Youssef

Portuguese Translations

Hi Team! Quick question, I have translated the hr_expense_advance_clearing to Portuguese (Brazilian) and I would like to ask where should I post the .PO file?

Thanks,

[RFC] expense sheet link to payment

Hello all,

In OCA has module hr_expense_cancel and it add new field expense_sheet_id in account payment.
I think this field should split out to new module hr_expense_payment because some module need to do something on payment and link to expense sheet.

Concept:

  • Module hr_expense_payment will link expense sheet id at view payment.
  • Module hr_expense_cancel depend on hr_expense_payment

What do you think?

[16.0] hr_expense_invoice: duplicated expense journal entry

Module

hr_expense_invoice
#234

Describe the bug

If i have this expense report:
image

Journal entries details will be:
image

So, untaxed amount does not match:

  • Journal items = 3.102,60
  • Expense report = 1.743,41

To Reproduce

Affected versions: 16

Steps to reproduce the behavior:

  1. Make a expense report with 2 lines of expense
  2. Create a vendor invoice of one of them and publish
  3. "Post Journal Entries" from the expense report

@pedrobaeza

its not holding vat account during posting

Module

hr_expense_petty_cash

Describe the bug

incorrect posting when the expense have VAT, instead of holding VAT account, it will hold the pettycash holder account

To Reproduce

13:

Steps to reproduce the behavior:
1.
2.
3.

Expected behavior
-I expected to post the vat amount to the vat receivable account at debit side instead of the pettycash holder account.
-I expected the total amount of the expense to be posted on the credit side of the pettycash holder account instead of the trade creditor account
-I expected the deducted amount(Total amount-vat amount) to be posted to the debit side of the expense account(product account)

this is the current issue
image

this is the actual expectation
image

Additional context
Add any other context about the problem here. (e.g. OS, Python version, ...)

Two Lines Employee Advance skip the Payment Process

I try in runbot to put the 2 lines of Employee Advance. Sometimes, there will be use case where the employee have to take employee Advance using different AA in one go.
After the manager approved, then the Accounting will Post the Journal
image

But after the Accounting post the journal, the document directly goes to Paid Status, where it suppposed to Register Payment first.
image

Is it in purpose ?
@kittiu, i think you will use the analytic account in Employee Advance in the Budget Module, and there is a possibility to have 2 AA as budget source for 1 Employee Advance Report, right ?

Thanks

[RFC] Does it make sense to have more than one advance-type product?

"hr_expense_advance_clearing.product_emp_advance"

I have a scenario in which the company contracts a volume of X credits to be used to pay for meals made on trips. This credit is distributed monthly to a specific employee and if any of these credits are left over, the company only supplements the balance in the following month

Example:
*$300 in food credit was transferred to the employee
*$150 was consumed

Total $150

  • Next month the company transfers another $150 to the employee.

New balance $300

Now, talking about the possibility of registering other products that can be used as an advance, it is because this process mentioned above seems to suit the purpose of the hr_expense_advance_clearing module well, but it would be important to be able to separate what is a merely financial advance from an advance of credits (including also the separation of the G/L account used). Therefore, one possibility would be to refactor this module to take into account a Boolean that determines if that product is of the advance type or not.

Makes sense ?

Migration to version 14.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-14.0

Modules to migrate

Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list

Migration to version 16.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-16.0

Modules to migrate

Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list

[BUG] hr_expense_invoice: errors when a tax is set in the expense.

There is an error in the expense sheet when we have set the taxes. Also if we try to create the expense sheet without taxes and then correct it in the invoice we will get the error that the total of the invoice does not match the total of the expense.

At the moment we create an invoice from the expense sheet the information of the tax fields is deleted, leaving the records incoherent.

In the following PR I propose a solution: #244

Here is a video explaining the issue: https://www.loom.com/share/a6c6049e0fbf431180a6b904e5694b13

Module

hr_expense_invoice

To Reproduce

Affected versions: 16.0 but probably more.

Steps to reproduce the behavior:

  1. Create an expense, set up a total and a tax.
  2. Click on "CREATE REPORT" to create the expense sheet. Then click on the expense sheet line "Create Vendor Bill".
    Make sure the tax has propagated to the expense line.

You will see how the expense total changed and the invoice as well.

Expected behavior
The total invoiced and the total expense should be the same.

Issues in the apps

module: hr_expense_petty_cash
version: 14.0

Steps to reproduce

  • ...

Current behavior

Expected behavior

[RFC] hr_expense_cancel: add config and process

Is your feature request related to a problem?

On Expense Report view.

  1. cancel button on Expense Report will unlink document

    • cancel on state paid : document on payment and JE will disappear
    • cancel on state posted : document on JE will disappear
  2. After you click cancel state will change to submit

Describe the solution you'd like

  1. I propose this module can configuration 2 things for solved issue above

    1. unlink or reverse document
    2. state submit or approve, when you click cancel
  2. Process expense report

    • Expense Report state paid can't see cancel button, you must have unreconciled document payment first and expense report automated change state paid to posted
    • Click cancel button on Expense Report state posted. it will (config 1.1) and state change to (config 1.2)

WDYT?

[V14] hr_expense_payment (question), in expense report to pay form, the outstanding debit (if any) is not shown as it like in normal vendor bill

Let's say the company has an outstanding debit amount to an employee, the employee then creates an expense and expense report (without a previous advance report).

When the expense report is reaching the state of "report to pay", it is expected the outstanding debit amount to the employee to show up and can be used to pay the expense report with the add button (like it is in the normal vendor bill), is it possible with current state? am I missing something because I do not have the information on outstanding debit in the expense report?

Portuguese (Brasil pt_BR)

Hi!

I've made a translation for hr_expense_advance_clearing module to Portuguese (Brazil) and I would like to share it, where's the most appropriate place to do it?

Migration to version 15.0

Todo

https://github.com/OCA/maintainer-tools/wiki/Migration-to-version-15.0

Modules to migrate

Missing module? Check https://github.com/OCA/maintainer-tools/wiki/%5BFAQ%5D-Missing-modules-in-migration-issue-list

[16.0] hr_expense_invoice: migrating to v16, request for guidance with _prepare_bill_vals modules

As I'm still learning Python, I could use some guidance. It appears like I'm correctly overwriting _prepare_bill_vals but the moves are created incorrectly anyway.
The core hr.expense.sheet now contains a _do_create_moves method, which contains the following line:

moves = self.env['account.move'].create([sheet._prepare_bill_vals() for sheet in own_account_sheets])
_prepare_bill_vals() sets several values for the move to be created, including partner_id and account_id. We need to overwrite these for hr_expense_invoice, so I have the following method:

def _prepare_bill_vals(self):
    prepared_bill_vals = super()._prepare_bill_vals()
    new_line_ids = []
    for line in prepared_bill_vals['line_ids']:
        if 'expense_id' in line[2]:
            expense = self.env['hr.expense'].browse(line[2]['expense_id'])
            if not expense.invoice_id:
                new_line_ids.append(line)
                continue
            new_line = (line[0], line[1], line[2].copy())
            new_line[2]['partner_id'] = expense.invoice_id.partner_id.commercial_partner_id.id
            new_line[2]['account_id'] = expense.invoice_id.line_ids.filtered(lambda l: l.account_type == "liability_payable").account_id.id
            new_line_ids.append(new_line)
    prepared_bill_vals['line_ids'] = new_line_ids
    return prepared_bill_vals

I can see in my debugger that prepared_bill_vals has updated the partner_id and account_id as required, but for some reason the moves are still being created with the Employee that created the expense as the partner_id and the expense category's account as the account_id.
Any guidance would be greatly appreciated! TIA!

[FIX][V14][V15] - HR Expense Advance Clearing

Hi Team! I was testing this module alongside my team and we've noticed a lot of new weird behaviors that makes this module unusable. I've tried in V14 and V15 both local and using runboat and they all behave the same.

Module

hr_expense_advance_clearing

Describe the bug

  1. When creating an advance, Odoo displays the error "Employee advance product has no payable account" because for some reason, the system is only looking if the product has an account set in the field Expense Account (property_account_expense_id) instead of looking to the account set at the Product Category (property_account_expense_categ_id) as well (which is odoo's default behavior for any product).

  2. In V15, expense products have their own menu at the Expense module (hr.expense), however the product used for advances doesn't show up there (It is my understanding that to be shown up there it needs to be marked as can_be_expensed = TRUE) which is no longer possible for users, as this checkbox is now invisible in the Product's menu.

  3. When creating expense reports and selecting the advance, users can't add expenses lines. The system makes the user to add the expense lines first and then the advance which doesn't make any sense as the advance is in the form header.

  4. Even after going through all of that, once you've submitted your expense, it doesn't clear the amount you've expended. Instead, it posts the full advance value in the journal as if you would have expended it all. Meaning, If I advance $100 and expended only $50, the journal entry from my expense report with an advanced would show $100. Which also causes issues with reports and accounting as the values doesn't match and no report displays remaining values as they're all zeroed.

To Reproduce

Affected versions: V14, V15

Steps to reproduce the behavior:

  1. Account Missing:
    1.1) Go to Expenses > My Expenses > Advances > Click on "Create"
    1.2) Click "add a line"
    1.3) Click on "Create"
    1.4)Type any value in the "Total" field
    1.5) Click on "Save & Close"
    1.6) The error message "Employee advance product has no payable account" is displayed.

2)Product not shown in the Expense Menu:
2.1) Go to Expenses > Configuration > Expenses Product
2.2) The product "Employee Advance" is not shown.

3)Expense Report with advance issue:
3.1) Go to Invoicing > Customers > Products
3.2) Remove any filter
3.3) Search for "Employee Advance"
3.4) In the Accounting tab, set the Expense account "600000 Expenses" and save it.
3.5) Go to Expenses > My Expenses > Advances > Click on "Create"
3.6) Give it a name
3.7) Click "add a line"
3.8) Click on "Create"
3.9)Type $100 in the "Total" field
3.10) Click on "Save & Close"
3.11) Click on "Submitt to Manager"
3.12) Cick on "Approve"
3.13) Click on "Post Journal Entries"
3.14) Click on "Register Payment" and create a payment.
3.15) Click on Expenses > My Expenses > Expenses
3.16) Click on "Create"
3.17) Select the advance you've created in steps 3.6-3.10
3.18) The "add a line" option is no longer available.

4)Remaining Value issue:
4.1) Go to Invoicing > Customers > Products
4.2) Remove any filter
4.3) Search for "Employee Advance"
4.4) In the Accounting tab, set the Expense account "600000 Expenses" and save it.
4.5) Go to Expenses > My Expenses > Advances > Click on "Create"
4.6) Give it a name
4.7) Click "add a line"
4.8) Click on "Create"
4.9)Type $100 in the "Total" field
4.10) Click on "Save & Close"
4.11) Click on "Submitt to Manager"
4.12) Cick on "Approve"
4.13) Click on "Post Journal Entries"
4.14) Click on "Register Payment" and create a payment.
4.15) Go to Expenses > My Expenses to Report
4.16) Click on "Create"
4.17) Select a expense product
4.18) Type $50 in the "Total" field and click "Save"
4.19) Click on "Create Report"
4.20) Select the advance you've created in steps 4.6-4.10
4.21) Click on "Submitt to Manager"
4.22) Click on "Approve"
4.23) Click on "Post Journal Entries"
4.24) Look at the field Advance Remaining (advance_sheet_residual) and the value will be the same as the advance total instead of the actual remaining value of $50.
4.25) Click on Expenses > Advances
4.26) Look for the advance created in steps 4.6-4.10, it will be marked as fully paid instead of partially paid.

Expected behavior

  1. The system should look to both fields and see which one is filled as it does in all the other modules.

  2. The Product should be displayed in the list.

  3. The option to add lines should continue to be available for the user to select expense lines or create new ones.

  4. The remaining value should be properly set (in this example should display $50) but the correct value would be the advance minus the sum of all expense reports that has that advance selected.

Best Regards,
Luiz Fernando

hr_expense_invoice : to access to the Refunds

Is your feature request related to a problem?

Every month I am receiving my credit card statement.
Each expense is an invoice.
Each statement is linked with a journal.
If I am getting a refund, this refunds is sent back to my credit card.
Then I am expecting to link the "refund" instead of "invoice".

Describe the solution you'd like
To access to the Refund AND Invoices items and able to link to an expense

Best Regards
Youssef

Can't reconcile the advance refund using account_reconcilation _widget.

Module

The name of the module that has a bug.
hr_advance_clearing combine with account_reconciliation_widget

Describe the bug

A clear and concise description of what the bug is.

Can't reconcile the advance refund using account_reconcilation _widget.

To Reproduce

Affected versions: currently i test this in version 14.0

Steps to reproduce the behavior:

  1. Create Advance Payment --> Approve --> Post Journal Entry --> Register Payment for example : 1,000
  2. Click Clear Advance button, create clearing advance report for example : 700 --> Approve --> Post Journal Entry, the remaining advance = 300
  3. Click Return Advance --> Register Payment wizard showed, then create Payment.
  4. The remaining advance become zero.
  5. Go to Invoicing --> fill the bank statement with incoming amount for 300.
  6. Post the bank statment
  7. Click Reconcile button.
  8. Try to validate the reconcilation of 300.
  9. Error appear as follow
    image

Expected behavior
A clear and concise description of what you expected to happen.
User can validate the reconciliation of the return advance

Additional context
Add any other context about the problem here. (e.g. OS, Python version, ...)
I can't try this in Runboat since module account_reconciliation_widget is not available in the hr_advance_clearing

HR-EXPENSE [15.0] - How to attach partner account for an employe ?

Dear,

  • Credit card :

I am using hr-expense-journal to assign a credit card for expenses.

Question : In the credit card journal, I can't see anything ? is it right ? or do I need to import any assets here ? or is available in another Journal ?

image

  • Paid by (Employee to reimburse) :

image

How to assign the employee AS PARTNER ?

Best Regards,
Youssef

Request validation after submit to manager

module: hr_expense_tier_validation
version: 14.0
Is there a way to trigger the approval after the employee has submitted the expense report to the manager, in order to improve the ux and flag the expense as already submitted while waiting for validations?

Indeed, it's quite puzzling to the employee to get 2 validation actions at its initial state Draft:

  • Submit to manager (standard one), primary action but locked due to the tier validation.
  • Request Validation (added by the module)

The case is a 2 steps validation by managers with a strict control on the users allowed to approve. The module fits this perfectly.

Steps to reproduce
Here is how I tried to do it:

  • Configure a tier approval with a domain on expense report [["state","=","submit"]]
  • Create an expense report

Current behavior
The approval is triggered at the Draft state, and the button Request Validation already shows up next to Submit to Manager.

Expected behavior
To trigger this action in state submit, after the employee has triggered Submit to Manager

Thanks a lot in advance for your insight!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.