changeset f78ee85f45a1 in modules/account:default
details: https://hg.tryton.org/modules/account?cmd=changeset;node=f78ee85f45a1
description:
        Use custom icons for open, close and locked state

        issue8222
        review287131003
diffstat:

 account.xml                    |  13 +++++++++++++
 fiscalyear.py                  |   6 +++---
 icons/tryton-account-block.svg |   1 +
 icons/tryton-account-close.svg |   1 +
 icons/tryton-account-open.svg  |   1 +
 journal.py                     |   4 ++--
 period.py                      |   6 +++---
 7 files changed, 24 insertions(+), 8 deletions(-)

diffs (87 lines):

diff -r 410b1e347efd -r f78ee85f45a1 account.xml
--- a/account.xml       Wed Mar 27 01:02:05 2019 +0100
+++ b/account.xml       Thu Mar 28 19:40:28 2019 +0100
@@ -31,6 +31,19 @@
             <field name="name">tryton-account</field>
             <field name="path">icons/tryton-account.svg</field>
         </record>
+        <record model="ir.ui.icon" id="account_open_icon">
+            <field name="name">tryton-account-open</field>
+            <field name="path">icons/tryton-account-open.svg</field>
+        </record>
+        <record model="ir.ui.icon" id="account_close_icon">
+            <field name="name">tryton-account-close</field>
+            <field name="path">icons/tryton-account-close.svg</field>
+        </record>
+        <record model="ir.ui.icon" id="account_block_icon">
+            <field name="name">tryton-account-block</field>
+            <field name="path">icons/tryton-account-block.svg</field>
+        </record>
+
         <menuitem name="Financial" id="menu_account" sequence="2" 
icon="tryton-account"/>
         <record model="ir.ui.menu-res.group" id="menu_account_group_account">
             <field name="menu" ref="menu_account"/>
diff -r 410b1e347efd -r f78ee85f45a1 fiscalyear.py
--- a/fiscalyear.py     Wed Mar 27 01:02:05 2019 +0100
+++ b/fiscalyear.py     Thu Mar 28 19:40:28 2019 +0100
@@ -103,9 +103,9 @@
 
     def get_icon(self, name):
         return {
-            'open': 'tryton-open',
-            'close': 'tryton-close',
-            'locked': 'tryton-readonly',
+            'open': 'tryton-account-open',
+            'close': 'tryton-account-close',
+            'locked': 'tryton-account-block',
             }.get(self.state)
 
     @classmethod
diff -r 410b1e347efd -r f78ee85f45a1 icons/tryton-account-block.svg
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/icons/tryton-account-block.svg    Thu Mar 28 19:40:28 2019 +0100
@@ -0,0 +1,1 @@
+<svg xmlns="http://www.w3.org/2000/svg"; width="24" height="24" viewBox="0 0 24 
24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 2C6.48 2 2 6.48 2 12s4.48 
10 10 10 10-4.48 10-10S17.52 2 12 2zM4 12c0-4.42 3.58-8 8-8 1.85 0 3.55.63 4.9 
1.69L5.69 16.9C4.63 15.55 4 13.85 4 12zm8 8c-1.85 0-3.55-.63-4.9-1.69L18.31 
7.1C19.37 8.45 20 10.15 20 12c0 4.42-3.58 8-8 8z"/></svg>
\ No newline at end of file
diff -r 410b1e347efd -r f78ee85f45a1 icons/tryton-account-close.svg
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/icons/tryton-account-close.svg    Thu Mar 28 19:40:28 2019 +0100
@@ -0,0 +1,1 @@
+<svg xmlns="http://www.w3.org/2000/svg"; width="24" height="24" viewBox="0 0 24 
24"><path d="M0 0h24v24H0z" fill="none"/><path d="M18 
8h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 6v2H6c-1.1 0-2 .9-2 2v10c0 1.1.9 2 2 2h12c1.1 
0 2-.9 2-2V10c0-1.1-.9-2-2-2zm-6 9c-1.1 0-2-.9-2-2s.9-2 2-2 2 .9 2 2-.9 2-2 
2zm3.1-9H8.9V6c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2z"/></svg>
\ No newline at end of file
diff -r 410b1e347efd -r f78ee85f45a1 icons/tryton-account-open.svg
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/icons/tryton-account-open.svg     Thu Mar 28 19:40:28 2019 +0100
@@ -0,0 +1,1 @@
+<svg xmlns="http://www.w3.org/2000/svg"; width="24" height="24" viewBox="0 0 24 
24"><path d="M0 0h24v24H0z" fill="none"/><path d="M12 17c1.1 0 2-.9 
2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2zm6-9h-1V6c0-2.76-2.24-5-5-5S7 3.24 7 
6h1.9c0-1.71 1.39-3.1 3.1-3.1 1.71 0 3.1 1.39 3.1 3.1v2H6c-1.1 0-2 .9-2 2v10c0 
1.1.9 2 2 2h12c1.1 0 2-.9 2-2V10c0-1.1-.9-2-2-2zm0 12H6V10h12v10z"/></svg>
\ No newline at end of file
diff -r 410b1e347efd -r f78ee85f45a1 journal.py
--- a/journal.py        Wed Mar 27 01:02:05 2019 +0100
+++ b/journal.py        Thu Mar 28 19:40:28 2019 +0100
@@ -263,8 +263,8 @@
 
     def get_icon(self, name):
         return {
-            'open': 'tryton-open',
-            'close': 'tryton-close',
+            'open': 'tryton-account-open',
+            'close': 'tryton-account-close',
             }.get(self.state)
 
     @classmethod
diff -r 410b1e347efd -r f78ee85f45a1 period.py
--- a/period.py Wed Mar 27 01:02:05 2019 +0100
+++ b/period.py Thu Mar 28 19:40:28 2019 +0100
@@ -98,9 +98,9 @@
 
     def get_icon(self, name):
         return {
-            'open': 'tryton-open',
-            'close': 'tryton-close',
-            'locked': 'tryton-readonly',
+            'open': 'tryton-account-open',
+            'close': 'tryton-account-close',
+            'locked': 'tryton-account-block',
             }.get(self.state)
 
     @classmethod

Reply via email to