Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[15.0][project_stock] Error in vals of the account analytic line (timesheet_invoice_type = billable_time) #1043

Closed
Bilbonet opened this issue Dec 4, 2022 · 13 comments
Labels

Comments

@Bilbonet
Copy link

Bilbonet commented Dec 4, 2022

Module

project_stock

Describe the bug

Analytic lines created from this module count like timesheet and don't have the id of the project.

To Reproduce

Affected versions: 14.0

Steps to reproduce the behavior:

  1. Add materials to a task.
  2. When you transfer materials analytic lines are created.
    These analytic lines have the value (timesheet_invoice_type = billable_time).
    And there isn't any value in field "project_id" too.

These analytic lines count like time consumed in the project.

Expected behavior
The value in the field should be (timesheet_invoice_type = other_costs)
And the field "project_id" the id of the project.

@Bilbonet Bilbonet added the bug label Dec 4, 2022
@pedrobaeza
Copy link
Member

No, project_id shouldn't be populated. That's only for timesheets.

@Bilbonet
Copy link
Author

Bilbonet commented Dec 7, 2022

OK, for me not to have project_id is not a problem.
I thought if these lines are created from a project it would be nice to have that information.

@pedrobaeza
Copy link
Member

No,as said, that's interpreted by Odoo as a timesheet line, which is not.

@Bilbonet
Copy link
Author

Bilbonet commented Dec 8, 2022

Hi @pedrobaeza maybe I explained wrong the issue, excuse me

The lines are recorded by this module like (timesheet_invoice_type = billable_time).

For this reason, the analytic lines recorded by this module appear in timesheets and count like a time consumed in the project.
For example, if I consum 100 screws in the project appears a line in timesheet with 100 minutes.

For this, I think this issue should be still open.

@pedrobaeza
Copy link
Member

Please indicate exactly where it appears.

@Bilbonet
Copy link
Author

Bilbonet commented Dec 8, 2022

The behavior has changed. I imagine because just updated.
It's true, the lines appears in timesheet because now the line has project_id. It isn't due to (timesheet_invoice_type = billable_time). Now the value of the field is 'no_billable' and stills appearing.

I recorded a gif with the current behavior. The amount of time is 8 instead 1 due tio the unit of mesure. I don't have units of mesure enabled for the installation.

stock_barcodes

Now I'm confused.
I'll try to reproduce this in a runboat instance to be sure.

Thanks.

@pedrobaeza
Copy link
Member

According to this comment, it may happen in v14 as a side effect:

#1020 (comment)

@victoralmau can you review?

@victoralmau
Copy link
Member

This behavior (although strange) is now correct as of v14 because https://github.com/odoo/odoo/blob/14.0/addons/hr_timesheet/models/project.py#L45-L55 takes into account all analytical notes linked to the project.

Perhaps, a solution could be to create a module called project_stock_timesheet to correct several things:

This also happens in v15.

What do you think about this?

@pedrobaeza
Copy link
Member

But project.timesheet_ids shouldn't include these lines, as project_id is not filled, and if it's filled, that's the problem.

@Bilbonet
Copy link
Author

Bilbonet commented Dec 9, 2022

Yes, maybe a solution could be not to fill project_id and not link these analytic account notes with the project to this way.

@victoralmau
Copy link
Member

Ok, currently project_id field in project_stock https://github.com/OCA/project/blob/14.0/project_stock/models/stock_move.py#L26-L84 is not being populated and this is a side effect of hr_timesheet.

I think the best thing to do would be to overwrite https://github.com/OCA/project/blob/14.0/project_stock/models/project_task.py#L224 here to leave the project empty.

Do you think this is correct?

@Bilbonet Bilbonet changed the title [14.0][project_stock] Error in vals of the account analytic line (timesheet_invoice_type = billable_time) [15.0][project_stock] Error in vals of the account analytic line (timesheet_invoice_type = billable_time) Dec 9, 2022
@Bilbonet
Copy link
Author

Bilbonet commented Dec 9, 2022

Sorry, all my descriptions of the issue are in 15.0

@pedrobaeza
Copy link
Member

Such field shouldn't be populated as stated, so if the solution is to explicitly empty it, then go for it, both in v14 and v15.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants