[tryton-dev] PATCH: trytond: Add definition for lithuanian language (issue 807002)

2013-04-18 Thread giedrius . slavinskas

Reviewers: ,



Please review this at http://codereview.tryton.org/807002/

Affected files:
  M setup.py
  M trytond/ir/lang.xml
  M trytond/protocols/dispatcher.py


Index: setup.py
===

--- a/setup.py
+++ b/setup.py
@@ -45,6 +45,7 @@
 'Natural Language :: Dutch',
 'Natural Language :: English',
 'Natural Language :: French',
+'Natural Language :: Lithuanian',
 'Natural Language :: German',
 'Natural Language :: Russian',
 'Natural Language :: Spanish',

Index: trytond/ir/lang.xml
===

--- a/trytond/ir/lang.xml
+++ b/trytond/ir/lang.xml
@@ -72,6 +72,14 @@
 field name=decimal_point,/field
 field name=thousands_sep /field
 /record
+record model=ir.lang id=lang_lt
+field name=codelt_LT/field
+field name=nameLithuanian/field
+field name=date%Y-%m-%d/field
+field name=grouping[]/field
+field name=decimal_point,/field
+field name=thousands_sep/field
+/record
 record model=ir.lang id=lang_nl
 field name=codenl_NL/field
 field name=nameDutch/field

Index: trytond/protocols/dispatcher.py
===

--- a/trytond/protocols/dispatcher.py
+++ b/trytond/protocols/dispatcher.py
@@ -60,6 +60,7 @@
 ('es_ES', 'Español (España)'),
 ('es_CO', 'Español (Colombia)'),
 ('fr_FR', 'Français'),
+('lt_LT', 'Lietuvių'),
 ('nl_NL', 'Nederlands'),
 ('ru_RU', 'Russian'),
 ]



Re: [tryton-dev] Freeze of repositories

2013-04-18 Thread Mathias Behrle
* Betr.:  Re: [tryton-dev] Freeze of repositories (Sun, 24 Mar 2013 15:05:41
  +0100):

 * Betr.:  Re: [tryton-dev] Freeze of repositories (Sun, 24 Mar 2013 13:41:32
   +0100):
 
  On 24/03/13 12:53 +0100, Mathias Behrle wrote:
  Release dates are fixed since the begining and thus the translation
  window. When accepting the charge of translating, the translator knew
  about it so he can schedule the job for years in advance. But if for
  some reason he can not, of course he is free to delegate, resign etc. We
  just consider people are responsible to take action on time.
 
 Done.
 
 I herewith resign from leadership of the German translation. Wiki updated
 accordingly.

Yesterday I tried to push the german translation. It seems you silently removed
push access for me. Do you prefer patches on the bug tracker?

-- 

Mathias Behrle
MBSolutions
Gilgenmatten 10 A
D-79114 Freiburg

Tel: +49(761)471023
Fax: +49(761)4770816
http://m9s.biz
UStIdNr: DE 142009020
PGP/GnuPG key availabable from any keyserver, ID: 0x8405BBF6


signature.asc
Description: PGP signature


Re: [tryton-dev] Freeze of repositories

2013-04-18 Thread Cédric Krier
On 18/04/13 10:30 +0200, Mathias Behrle wrote:
 * Betr.:  Re: [tryton-dev] Freeze of repositories (Sun, 24 Mar 2013 15:05:41
   +0100):
  * Betr.:  Re: [tryton-dev] Freeze of repositories (Sun, 24 Mar 2013 
  13:41:32
+0100):
  I herewith resign from leadership of the German translation. Wiki updated
  accordingly.
 
 Yesterday I tried to push the german translation. It seems you silently 
 removed
 push access for me. Do you prefer patches on the bug tracker?

But you resigned.

-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: cedric.kr...@b2ck.com
Website: http://www.b2ck.com/


pgpFDhLgu8ZAz.pgp
Description: PGP signature


Re: [tryton-dev] Freeze of repositories

2013-04-18 Thread Mathias Behrle
* Betr.:  Re: [tryton-dev] Freeze of repositories (Thu, 18 Apr 2013 10:37:05
  +0200):

 On 18/04/13 10:30 +0200, Mathias Behrle wrote:
  * Betr.:  Re: [tryton-dev] Freeze of repositories (Sun, 24 Mar 2013
  15:05:41 +0100):
   * Betr.:  Re: [tryton-dev] Freeze of repositories (Sun, 24 Mar 2013
   13:41:32 +0100):
   I herewith resign from leadership of the German translation. Wiki updated
   accordingly.
  
  Yesterday I tried to push the german translation. It seems you silently
  removed push access for me. Do you prefer patches on the bug tracker?
 
 But you resigned.

I resigned as leader, not as translator of the application. As already told you
can read it at 

http://code.google.com/p/tryton/wiki/ProjectOrganization


-- 

Mathias Behrle
MBSolutions
Gilgenmatten 10 A
D-79114 Freiburg

Tel: +49(761)471023
Fax: +49(761)4770816
http://m9s.biz
UStIdNr: DE 142009020
PGP/GnuPG key availabable from any keyserver, ID: 0x8405BBF6


signature.asc
Description: PGP signature


Re: [tryton-dev] Freeze of repositories

2013-04-18 Thread Cédric Krier
On 18/04/13 10:45 +0200, Mathias Behrle wrote:
 * Betr.:  Re: [tryton-dev] Freeze of repositories (Thu, 18 Apr 2013 10:37:05
   +0200):
 
  On 18/04/13 10:30 +0200, Mathias Behrle wrote:
   * Betr.:  Re: [tryton-dev] Freeze of repositories (Sun, 24 Mar 2013
   15:05:41 +0100):
* Betr.:  Re: [tryton-dev] Freeze of repositories (Sun, 24 Mar 2013
13:41:32 +0100):
I herewith resign from leadership of the German translation. Wiki 
updated
accordingly.
   
   Yesterday I tried to push the german translation. It seems you silently
   removed push access for me. Do you prefer patches on the bug tracker?
  
  But you resigned.
 
 I resigned as leader, not as translator of the application. As already told 
 you
 can read it at 

That's make nonsense.

Anyway, just ask to the leader of your translation team to manage it.


-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: cedric.kr...@b2ck.com
Website: http://www.b2ck.com/


pgpDSvKYBwjkT.pgp
Description: PGP signature


Re: [tryton-dev] Freeze of repositories

2013-04-18 Thread Mathias Behrle
* Betr.:  Re: [tryton-dev] Freeze of repositories (Thu, 18 Apr 2013 10:50:57
  +0200):

 On 18/04/13 10:45 +0200, Mathias Behrle wrote:
  * Betr.:  Re: [tryton-dev] Freeze of repositories (Thu, 18 Apr 2013
  10:37:05 +0200):
  
   On 18/04/13 10:30 +0200, Mathias Behrle wrote:
* Betr.:  Re: [tryton-dev] Freeze of repositories (Sun, 24 Mar 2013
15:05:41 +0100):
 * Betr.:  Re: [tryton-dev] Freeze of repositories (Sun, 24 Mar 2013
 13:41:32 +0100):
 I herewith resign from leadership of the German translation. Wiki
 updated accordingly.

Yesterday I tried to push the german translation. It seems you silently
removed push access for me. Do you prefer patches on the bug tracker?
   
   But you resigned.
  
  I resigned as leader, not as translator of the application. As already told
  you can read it at 
 
 That's make nonsense.
 
 Anyway, just ask to the leader of your translation team to manage it.

There is none. Again: do you prefer patches on the bug tracker?

-- 

Mathias Behrle
MBSolutions
Gilgenmatten 10 A
D-79114 Freiburg

Tel: +49(761)471023
Fax: +49(761)4770816
http://m9s.biz
UStIdNr: DE 142009020
PGP/GnuPG key availabable from any keyserver, ID: 0x8405BBF6


signature.asc
Description: PGP signature


Re: [tryton-dev] Freeze of repositories

2013-04-18 Thread Cédric Krier
On 18/04/13 10:52 +0200, Mathias Behrle wrote:
 * Betr.:  Re: [tryton-dev] Freeze of repositories (Thu, 18 Apr 2013 10:50:57
   +0200):
 
  On 18/04/13 10:45 +0200, Mathias Behrle wrote:
   * Betr.:  Re: [tryton-dev] Freeze of repositories (Thu, 18 Apr 2013
   10:37:05 +0200):
   
On 18/04/13 10:30 +0200, Mathias Behrle wrote:
 * Betr.:  Re: [tryton-dev] Freeze of repositories (Sun, 24 Mar 2013
 15:05:41 +0100):
  * Betr.:  Re: [tryton-dev] Freeze of repositories (Sun, 24 Mar 
  2013
  13:41:32 +0100):
  I herewith resign from leadership of the German translation. Wiki
  updated accordingly.
 
 Yesterday I tried to push the german translation. It seems you 
 silently
 removed push access for me. Do you prefer patches on the bug tracker?

But you resigned.
   
   I resigned as leader, not as translator of the application. As already 
   told
   you can read it at 
  
  That's make nonsense.
  
  Anyway, just ask to the leader of your translation team to manage it.
 
 There is none. Again: do you prefer patches on the bug tracker?

No, I prefer a leader who will be responsible.

-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: cedric.kr...@b2ck.com
Website: http://www.b2ck.com/


pgptzaauiZbCJ.pgp
Description: PGP signature


[tryton-dev] account: Alert if sequence journal is empty when create a account move (issue 808002)

2013-04-18 Thread resteve

Reviewers: ,



Please review this at http://codereview.tryton.org/808002/

Affected files:
  M move.py


Index: move.py
===

--- a/move.py
+++ b/move.py
@@ -89,6 +89,8 @@
 'because it\'s date is outside its period.'),
 'draft_closed_period': ('You can not set to draft move '
 '%(move)s because period %(period)s is closed.'),
+'journal_empty_sequence': ('You can add a sequence  
in %s '

+'journal because it is empty.'),
 })
 cls._buttons.update({
 'post': {
@@ -242,6 +244,9 @@
 or Transaction().context.get('journal'))
 if journal_id:
 journal = Journal(journal_id)
+if not journal.sequence:
+cls.raise_user_error('journal_empty_sequence',
+(journal.rec_name,))
 vals['number'] = Sequence.get_id(journal.sequence.id)

 moves = super(Move, cls).create(vlist)





Re: [tryton-dev] Freeze of repositories

2013-04-18 Thread Mathias Behrle
* Betr.:  Re: [tryton-dev] Freeze of repositories (Thu, 18 Apr 2013 10:54:01
  +0200):

 On 18/04/13 10:52 +0200, Mathias Behrle wrote:
  * Betr.:  Re: [tryton-dev] Freeze of repositories (Thu, 18 Apr 2013
  10:50:57 +0200):
  
   On 18/04/13 10:45 +0200, Mathias Behrle wrote:
* Betr.:  Re: [tryton-dev] Freeze of repositories (Thu, 18 Apr 2013
10:37:05 +0200):

 On 18/04/13 10:30 +0200, Mathias Behrle wrote:
  * Betr.:  Re: [tryton-dev] Freeze of repositories (Sun, 24 Mar
  2013 15:05:41 +0100):
   * Betr.:  Re: [tryton-dev] Freeze of repositories (Sun, 24 Mar
   2013 13:41:32 +0100):
   I herewith resign from leadership of the German translation. Wiki
   updated accordingly.
  
  Yesterday I tried to push the german translation. It seems you
  silently removed push access for me. Do you prefer patches on the
  bug tracker?
 
 But you resigned.

I resigned as leader, not as translator of the application. As already
told you can read it at 
   
   That's make nonsense.
   
   Anyway, just ask to the leader of your translation team to manage it.
  
  There is none. Again: do you prefer patches on the bug tracker?
 
 No, I prefer a leader who will be responsible.

Sigh. Ok, I will provide the patches via the bug tracker.

-- 

Mathias Behrle
MBSolutions
Gilgenmatten 10 A
D-79114 Freiburg

Tel: +49(761)471023
Fax: +49(761)4770816
http://m9s.biz
UStIdNr: DE 142009020
PGP/GnuPG key availabable from any keyserver, ID: 0x8405BBF6


signature.asc
Description: PGP signature


Re: [tryton-dev] Freeze of repositories

2013-04-18 Thread Cédric Krier
On 18/04/13 11:27 +0200, Mathias Behrle wrote:
 * Betr.:  Re: [tryton-dev] Freeze of repositories (Thu, 18 Apr 2013 10:54:01
   +0200):
 
  On 18/04/13 10:52 +0200, Mathias Behrle wrote:
   * Betr.:  Re: [tryton-dev] Freeze of repositories (Thu, 18 Apr 2013
   10:50:57 +0200):
   
On 18/04/13 10:45 +0200, Mathias Behrle wrote:
 * Betr.:  Re: [tryton-dev] Freeze of repositories (Thu, 18 Apr 2013
 10:37:05 +0200):
 
  On 18/04/13 10:30 +0200, Mathias Behrle wrote:
   * Betr.:  Re: [tryton-dev] Freeze of repositories (Sun, 24 Mar
   2013 15:05:41 +0100):
* Betr.:  Re: [tryton-dev] Freeze of repositories (Sun, 24 Mar
2013 13:41:32 +0100):
I herewith resign from leadership of the German translation. 
Wiki
updated accordingly.
   
   Yesterday I tried to push the german translation. It seems you
   silently removed push access for me. Do you prefer patches on the
   bug tracker?
  
  But you resigned.
 
 I resigned as leader, not as translator of the application. As already
 told you can read it at 

That's make nonsense.

Anyway, just ask to the leader of your translation team to manage it.
   
   There is none. Again: do you prefer patches on the bug tracker?
  
  No, I prefer a leader who will be responsible.
 
 Sigh. Ok, I will provide the patches via the bug tracker.

I will not spend my time on merging them.
I do only for new translators that want to become leader and take
responsibilities but if there is no will in the way, I don't.

-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: cedric.kr...@b2ck.com
Website: http://www.b2ck.com/


pgph25X1PBuRD.pgp
Description: PGP signature


[tryton-dev] Enable Ctrl + Space on selection-like Dict entries (issue 809002)

2013-04-18 Thread jean . cavallo

Reviewers: ,

Description:
Enable Ctrl + Space on selection-like Dict entries

Safer get_values and lambdas.

issue3163

Please review this at http://codereview.tryton.org/809002/

Affected files:
  M tryton/gui/window/view_form/view/form_gtk/dictionary.py


Index: tryton/gui/window/view_form/view/form_gtk/dictionary.py
===
--- a/tryton/gui/window/view_form/view/form_gtk/dictionary.py
+++ b/tryton/gui/window/view_form/view/form_gtk/dictionary.py
@@ -81,11 +81,12 @@
 widget.child.props.activates_default = True
 widget.child.connect('changed', self.parent_widget.send_modified)
 widget.child.connect('focus-out-event',
-lambda w, e: self.parent_widget._focus_out())
+lambda *a: self.parent_widget._focus_out())
 widget.child.connect('activate',
-lambda w, e: self.parent_widget._focus_out())
+lambda *a: self.parent_widget._focus_out())
 widget.connect('notify::active',
-lambda w, e: self.parent_widget._focus_out())
+lambda *a: self.parent_widget._focus_out())
+widget.child.connect('key_press_event', self.sig_key_press)

 # setting completion and selection
 model = gtk.ListStore(gobject.TYPE_STRING)
@@ -111,7 +112,16 @@

 def get_value(self):
 text = self.widget.child.get_text()
-return self._selection[text]
+value = None
+if text:
+for txt, val in self._selection.items():
+if not val:
+continue
+if txt[:len(text)].lower() == text.lower():
+value = val
+if len(txt) == len(text):
+break
+return value

 def set_value(self, value):
 values = dict(self.definition['selection'])
@@ -120,6 +130,12 @@
 def set_readonly(self, readonly):
 self.widget.set_sensitive(not readonly)

+def sig_key_press(self, widget, event):
+if event.type == gtk.gdk.KEY_PRESS \
+and event.state  gtk.gdk.CONTROL_MASK \
+and event.keyval == gtk.keysyms.space:
+self.widget.popup()
+

 class DictIntegerEntry(DictEntry):
 expand = False




[tryton-dev] Selection widget of Dict fields should test if the value is in the list (issue 810002)

2013-04-18 Thread jean . cavallo

Reviewers: ,

Description:
Selection widget of Dict fields should test if the value is in the list

Please review this at http://codereview.tryton.org/810002/

Affected files:
  M tryton/gui/window/view_form/view/form_gtk/dictionary.py


Index: tryton/gui/window/view_form/view/form_gtk/dictionary.py
===
--- a/tryton/gui/window/view_form/view/form_gtk/dictionary.py
+++ b/tryton/gui/window/view_form/view/form_gtk/dictionary.py
@@ -111,7 +111,16 @@

 def get_value(self):
 text = self.widget.child.get_text()
-return self._selection[text]
+value = None
+if text:
+for txt, val in self._selection.items():
+if not val:
+continue
+if txt[:len(text)].lower() == text.lower():
+value = val
+if len(txt) == len(text):
+break
+return value

 def set_value(self, value):
 values = dict(self.definition['selection'])




[tryton-dev] Better test for quoting empty string (issue 811002)

2013-04-18 Thread cedric . krier

Reviewers: ,



Please review this at http://codereview.tryton.org/811002/

Affected files:
  M tryton/common/domain_parser.py


Index: tryton/common/domain_parser.py
===

--- a/tryton/common/domain_parser.py
+++ b/tryton/common/domain_parser.py
@@ -87,10 +87,10 @@
 yield cur + nex
 cur = None
 else:
-if cur:
+if cur is not None:
 yield cur
 cur = nex
-if cur:
+if cur is not None:
 yield cur


@@ -440,7 +440,8 @@
 }
 if isinstance(value, (list, tuple)):
 return ';'.join(format_value(field, x) for x in value)
-return quote(converts.get(field['type'], lambda: value)())
+return quote(converts.get(field['type'],
+lambda: value if value is not None else '')())


 def test_format_boolean():
@@ -569,15 +570,15 @@
 yield True

 def complete_selection():
-test_value = value
+test_value = value if value is not None else ''
 if isinstance(value, list):
 test_value = value[-1]
 for svalue, test in field['selection']:
 if test.lower().startswith(test_value.lower()):
-if test_value == value:
+if isinstance(value, list):
+yield value[:-1] + [svalue]
+else:
 yield svalue
-else:
-yield value[:-1] + [svalue]

 def complete_datetime():
 yield datetime.date.today()
@@ -612,6 +613,7 @@
 ('m', ['male']),
 ('test', []),
 ('', ['male', 'female']),
+(None, ['male', 'female']),
 (['male', 'f'], [['male', 'female']]),
 ):
 assert list(complete_value(field, value)) == result
@@ -780,8 +782,13 @@
 operator = '!'
 else:
 operator = ''
+formatted_value = format_value(field, value)
+if (operator in OPERATORS and
+field['type'] in  
('char', 'text', 'sha', 'selection')

+and value == ''):
+formatted_value = ''
 return '%s: %s%s' % (quote(field['string']), operator,
-format_value(field, value))
+formatted_value)
 else:
 return '(%s)' % self.string(clause)

@@ -916,7 +923,7 @@
 if lvalue:
 yield name + (lvalue,)
 else:
-yield name + ('',)
+yield name + (None,)
 break

 parts = []
@@ -959,7 +966,7 @@
 value = likify(value)
 if field['type'] in ('integer', 'float', 'numeric',
 'datetime', 'date', 'time'):
-if '..' in value:
+if value and '..' in value:
 lvalue, rvalue = value.split('..', 1)
 lvalue = convert_value(field, lvalue)
 rvalue = convert_value(field, rvalue)
@@ -991,6 +998,9 @@
 },
 })
 assert dom.string([('name', '=', 'Doe')]) == 'Name: =Doe'
+assert dom.string([('name', '=', None)]) == 'Name: ='
+assert dom.string([('name', '=', '')]) == 'Name: ='
+assert dom.string([('name', 'ilike', '%')]) == 'Name: '
 assert dom.string([('name', 'ilike', '%Doe%')]) == 'Name: Doe'
 assert dom.string([('name', 'ilike', 'Doe')]) == 'Name: =Doe'
 assert dom.string([('name', 'ilike', 'Doe%')]) == 'Name: Doe%'
@@ -1088,7 +1098,20 @@
 ('Name', None, 'Doe'),
 ]
 assert rlist(dom.group(udlex(u'Name:'))) == [
-('Name', None, ''),
+('Name', None, None),
+]
+assert rlist(dom.group(udlex(u'Name: ='))) == [
+('Name', '=', None),
+]
+assert rlist(dom.group(udlex(u'Name: ='))) == [
+('Name', '=', ''),
+]
+assert rlist(dom.group(udlex(u'Name: = '))) == [
+('Name', '=', ''),
+]
+assert rlist(dom.group(udlex(u'Name: = Name: Doe'))) == [
+('Name', '=', None),
+('Name', None, 'Doe'),
 ]


@@ -1116,6 +1139,12 @@
 })
 assert rlist(dom.parse_clause([('John',)])) == [
 ('rec_name', 'ilike', '%John%')]
+assert rlist(dom.parse_clause([('Name', None, None)])) == [
+('name', 'ilike', '%')]
+assert rlist(dom.parse_clause([('Name', '=', None)])) == [
+('name', '=', None)]
+assert rlist(dom.parse_clause([('Name', '=', '')])) == [
+('name', '=', '')]
 assert rlist(dom.parse_clause([('Name', None, 'Doe')])) == [
 ('name', 'ilike', '%Doe%')]
 assert rlist(dom.parse_clause([('Name', '!', 'Doe')])) == [
@@ -1130,6 +1159,9 @@
 

[tryton-dev] www.tryton.org: New Tryton release 2.8 (issue 812002)

2013-04-18 Thread cedric . krier

Reviewers: ,



Please review this at http://codereview.tryton.org/812002/

Affected files:
  files/images/tryton_act_window_domain.png
  files/images/tryton_bookmark.png
  files/images/tryton_completion.png
  files/images/tryton_contact_mechanisms_url.png
  files/images/tryton_global_search.png
  posts/new-tryton-release-28.txt




[tryton-dev] account: Fix tax_code usage as it can be None (issue 813002)

2013-04-18 Thread cedric . krier

Reviewers: ,



Please review this at http://codereview.tryton.org/813002/

Affected files:
  M move.py


Index: move.py
===

--- a/move.py
+++ b/move.py
@@ -808,7 +808,9 @@
 line.debit or line.credit, 1):
 if ((tax_line['tax'][key + '_account'].id
 or line.account.id) == account_id
-and (tax_line['tax'][key + '_tax_code'].id
+and ((tax_line['tax'][key + '_tax_code'].id
+if tax_line['tax'][key  
+ '_tax_code']

+else None)
 == code_id)
 and tax_line['tax'].id == tax_id):
 if line.debit:
@@ -937,7 +939,8 @@
 base_amounts = {}
 for tax_line in Tax.compute(self.account.taxes,
 debit or credit, 1):
-code_id = tax_line['tax'][key + '_base_code'].id
+code_id = (tax_line['tax'][key + '_base_code'].id
+if tax_line['tax'][key + '_base_code'] else None)
 if not code_id:
 continue
 tax_id = tax_line['tax'].id