Skip to content

Commit

Permalink
[IMP] project_time_in_day : better filtering of uom when choosing a h…
Browse files Browse the repository at this point in the history
…our uom
  • Loading branch information
florian-dacosta committed Dec 29, 2023
1 parent 6fb5e3d commit 0f64af1
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion project_time_in_day/models/project_project.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,12 @@
class ProjectProject(models.Model):
_inherit = "project.project"

def _get_hour_domain(self):
return [("category_id", "=", self.env.ref("uom.uom_categ_wtime").id), ("uom_type", "=", "smaller")]

hour_uom_id = fields.Many2one(
"uom.uom", "Hour Uom", help="Used for conversion between day and hours"
"uom.uom", "Hour Uom", help="Used for conversion between day and hours",
domain=_get_hour_domain
)

def _get_hour_uom(self):
Expand Down

0 comments on commit 0f64af1

Please sign in to comment.