diff --git a/view/work_form.xml b/view/work_form.xml
index b26180318a..6b70ad0a46 100644
--- a/view/work_form.xml
+++ b/view/work_form.xml
@@ -7,15 +7,15 @@ this repository contains the full copyright notices and license terms. -->
-
+
-
+
-
+
diff --git a/view/work_list.xml b/view/work_list.xml
index ee7972ad6b..af98395d6b 100644
--- a/view/work_list.xml
+++ b/view/work_list.xml
@@ -4,8 +4,8 @@ this repository contains the full copyright notices and license terms. -->
-
-
-
+
+
+
diff --git a/view/work_list_children.xml b/view/work_list_children.xml
index 33ec82f1e9..830bc6e13b 100644
--- a/view/work_list_children.xml
+++ b/view/work_list_children.xml
@@ -4,7 +4,7 @@ this repository contains the full copyright notices and license terms. -->
-
-
+
+
diff --git a/view/work_tree.xml b/view/work_tree.xml
index ee7972ad6b..af98395d6b 100644
--- a/view/work_tree.xml
+++ b/view/work_tree.xml
@@ -4,8 +4,8 @@ this repository contains the full copyright notices and license terms. -->
-
-
-
+
+
+
diff --git a/work.py b/work.py
index bed89bad65..55f3e4d8a5 100644
--- a/work.py
+++ b/work.py
@@ -28,6 +28,8 @@ class Work(metaclass=PoolMeta):
cost = fields.Function(fields.Numeric('Cost',
digits=(16, Eval('currency_digits', 2)),
depends=['currency_digits']), 'get_total')
+ currency = fields.Function(fields.Many2One('currency.currency',
+ 'Currency'), 'on_change_with_currency')
currency_digits = fields.Function(fields.Integer('Currency Digits'),
'on_change_with_currency_digits')
@@ -165,9 +167,14 @@ class Work(metaclass=PoolMeta):
return revenues
@fields.depends('company')
- def on_change_with_currency_digits(self, name=None):
+ def on_change_with_currency(self, name=None):
if self.company:
- return self.company.currency.digits
+ return self.company.currency.id
+
+ @fields.depends('currency')
+ def on_change_with_currency_digits(self, name=None):
+ if self.currency:
+ return self.currency.digits
return 2
@staticmethod