Skip to content

Conversation

@petrus-v
Copy link
Contributor

Migrate project consumable #1410 from v14.0

with main differences:

  • refactor do not depends on hr_timesheet and avoid conflict with it, the shame is that odoo is not using polymorphism to generate account.move.line 😭 so odoo assume that an account.analytic.line with a project_id are timesheet line making very hard to add a new kind of account.analytic.line linked to the project
  • in project.update profitability right panel add consumable/materials somehow => smart button + other cost is fine to me for the time being.

@rousseldenis
Copy link

/ocabot migration project_consumable

)

@api.onchange("type")
def _onchange_type(self):

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make project_ok fields compute/stored/readonly=False to avoid onchanges.

class Project(models.Model):
_inherit = "project.project"

company_currency_id = fields.Many2one(

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this at the right place (this module ?) ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I admit I can't remember why I'm not using the existing currency_id field in the monitory field... I've moved to the existing currency_id field

Thanks !

@petrus-v petrus-v force-pushed the 17.0-project_consumable branch from 73b34f1 to 929e591 Compare October 20, 2025 13:43
In the previous implementation project_id field was reused on account move line
but a lot of the odoo code source assume that an account move line with a project_id
is a timesheet, making very hard to distinguish Materials and Timesheet.

Adding a consumable_project_id it avoid to breaks existing code make module
much more easier to maintains
@petrus-v petrus-v force-pushed the 17.0-project_consumable branch from 929e591 to ed448e3 Compare October 20, 2025 14:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants