Keyboard Shortcuts

File
u :up to issue
m :publish + mail comments
M :edit review message
j / k :jump to file after / before current file
J / K :jump to next file with a comment after / before current file
Side-by-side diff
i :toggle intra-line diffs
e :expand all comments
c :collapse all comments
s :toggle showing all comments
n / p :next / previous diff chunk or comment
N / P :next / previous comment
<Up> / <Down> :next / previous line
<Enter> :respond to / edit current comment
d :mark current comment as done
Issue
u :up to list of issues
m :publish + mail comments
j / k :jump to patch after / before current patch
o / <Enter> :open current patch in side-by-side view
i :open current patch in unified diff view
Issue List
j / k :jump to issue after / before current issue
o / <Enter> :open current issue
# : close issue
Comment/message editing
<Ctrl> + s or <Ctrl> + Enter :save comment
<Esc> :cancel edit
Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(153)
Issues Repositories Search
Open Issues | Closed Issues | All Issues | Sign in with your Google Account to create issues and add comments

Issue 4149041: Fix field analytic_account is always required

Can't Edit
Can't Publish+Mail
Start Review
Created:
14 years, 11 months ago by hoRn
Modified:
12 years, 9 months ago
Reviewers:
yangoon, ced
Visibility:
Public.

Patch Set 1 #

Total comments: 4

Patch Set 2 : Think that adding required to states is only necessary if account.mandatory #

Total comments: 5

Patch Set 3 : no need for getting actual 'states' because the method is updating the res of the field_get #

Total comments: 4
Created: 14 years, 11 months ago
Download [raw] [tar.bz2]
Unified diffs Side-by-side diffs Delta from patch set Stats (+4 lines, -3 lines) Patch
M account.py View 1 2 3 chunks +4 lines, -3 lines 4 comments Download
Total messages: 12
|
hoRn
analytic_account/account.py
14 years, 11 months ago (2011年02月08日 11:29:49 UTC) #1
analytic_account/account.py
Sign in to reply to this message.
ced
http://codereview.appspot.com/4149041/diff/1/account.py File account.py (right): http://codereview.appspot.com/4149041/diff/1/account.py#newcode176 account.py:176: res[account_id] = -res[account_id] Don't change this it is not ...
14 years, 11 months ago (2011年02月08日 11:45:49 UTC) #2
http://codereview.appspot.com/4149041/diff/1/account.py
File account.py (right):
http://codereview.appspot.com/4149041/diff/1/account.py#newcode176
account.py:176: res[account_id] = -res[account_id]
Don't change this it is not PEP8
http://codereview.appspot.com/4149041/diff/1/account.py#newcode285
account.py:285: res[name]['states'] =
PYSONEncoder().encode({'required':Equal(Eval('type'), 'line')})
80 chars
http://codereview.appspot.com/4149041/diff/1/account.py#newcode285
account.py:285: res[name]['states'] =
PYSONEncoder().encode({'required':Equal(Eval('type'), 'line')})
You erase the initial states of the field.
You must only change the required state.
And by the way, why not only use states?
http://codereview.appspot.com/4149041/diff/1/account.py#newcode286
account.py:286: else: res[name]['required'] = False
Split into 2 lines
Sign in to reply to this message.
yangoon
14 years, 11 months ago (2011年02月08日 12:16:20 UTC) #3
Sign in to reply to this message.
hoRn
changed http://codereview.appspot.com/4149041/diff/4001/account.py File account.py (right): http://codereview.appspot.com/4149041/diff/4001/account.py#newcode176 account.py:176: res[account_id] = -res[account_id] don't know where to set ...
14 years, 11 months ago (2011年02月08日 12:55:30 UTC) #4
changed
http://codereview.appspot.com/4149041/diff/4001/account.py
File account.py (right):
http://codereview.appspot.com/4149041/diff/4001/account.py#newcode176
account.py:176: res[account_id] = -res[account_id]
don't know where to set it in eclipse - any hint welcome
Sign in to reply to this message.
ced
http://codereview.appspot.com/4149041/diff/4001/account.py File account.py (right): http://codereview.appspot.com/4149041/diff/4001/account.py#newcode176 account.py:176: res[account_id] = -res[account_id] On 2011年02月08日 12:55:30, hoRn wrote: > ...
14 years, 11 months ago (2011年02月08日 13:07:41 UTC) #5
http://codereview.appspot.com/4149041/diff/4001/account.py
File account.py (right):
http://codereview.appspot.com/4149041/diff/4001/account.py#newcode176
account.py:176: res[account_id] = -res[account_id]
On 2011年02月08日 12:55:30, hoRn wrote:
> don't know where to set it in eclipse - any hint welcome
Don't use eclipse :-)
http://codereview.appspot.com/4149041/diff/4001/account.py#newcode286
account.py:286: encode({'required':Equal(Eval('type'), 'line')})
one space after :
Sign in to reply to this message.
udono
http://codereview.appspot.com/4149041/diff/4001/account.py File account.py (right): http://codereview.appspot.com/4149041/diff/4001/account.py#newcode286 account.py:286: encode({'required':Equal(Eval('type'), 'line')}) Is this correct with double required? I ...
14 years, 11 months ago (2011年02月08日 13:29:09 UTC) #6
http://codereview.appspot.com/4149041/diff/4001/account.py
File account.py (right):
http://codereview.appspot.com/4149041/diff/4001/account.py#newcode286
account.py:286: encode({'required':Equal(Eval('type'), 'line')})
Is this correct with double required?
I would propose:
res[name]['states']['required'] = PYSONEncoder().encode(Equal(Eval('type'),
'line'))
Sign in to reply to this message.
hoRn
http://codereview.appspot.com/4149041/diff/4001/account.py File account.py (right): http://codereview.appspot.com/4149041/diff/4001/account.py#newcode286 account.py:286: encode({'required':Equal(Eval('type'), 'line')}) sorry - need to upload a new ...
14 years, 11 months ago (2011年02月08日 13:51:12 UTC) #7
http://codereview.appspot.com/4149041/diff/4001/account.py
File account.py (right):
http://codereview.appspot.com/4149041/diff/4001/account.py#newcode286
account.py:286: encode({'required':Equal(Eval('type'), 'line')})
sorry - need to upload a new file - this will not work at all, because
res[name]['states'] is a string ;(
Sign in to reply to this message.
hoRn
14 years, 11 months ago (2011年02月08日 14:27:35 UTC) #8
Sign in to reply to this message.
ced
http://codereview.appspot.com/4149041/diff/4003/account.py File account.py (right): http://codereview.appspot.com/4149041/diff/4003/account.py#newcode176 account.py:176: res[account_id] = -res[account_id] Still there. http://codereview.appspot.com/4149041/diff/4003/account.py#newcode285 account.py:285: encode({'required': Equal(Eval('type'), ...
14 years, 11 months ago (2011年02月08日 22:37:51 UTC) #9
http://codereview.appspot.com/4149041/diff/4003/account.py
File account.py (right):
http://codereview.appspot.com/4149041/diff/4003/account.py#newcode176
account.py:176: res[account_id] = -res[account_id]
Still there.
http://codereview.appspot.com/4149041/diff/4003/account.py#newcode285
account.py:285: encode({'required': Equal(Eval('type'), 'line')})
As we don't have yet a PYSONDecoder without evaluation, the simple way to fix
this is to redefine states.
So you must also set the value of invisible like it is in the origin.
Sign in to reply to this message.
hoRn
http://codereview.appspot.com/4149041/diff/4003/account.py File account.py (right): http://codereview.appspot.com/4149041/diff/4003/account.py#newcode285 account.py:285: encode({'required': Equal(Eval('type'), 'line')}) don't know why, but in the ...
14 years, 11 months ago (2011年02月09日 07:56:54 UTC) #10
http://codereview.appspot.com/4149041/diff/4003/account.py
File account.py (right):
http://codereview.appspot.com/4149041/diff/4003/account.py#newcode285
account.py:285: encode({'required': Equal(Eval('type'), 'line')})
don't know why, but in the resulting fields_get of analytic_** there is
'invisible' in the states. Think it's because analytic_accounts_fields_get is
updating the fields_get. I tried to get the states, but the value of states is a
string. so updating this string needs something like eval() - don't know ....
Sign in to reply to this message.
ced
http://codereview.appspot.com/4149041/diff/4003/account.py File account.py (right): http://codereview.appspot.com/4149041/diff/4003/account.py#newcode285 account.py:285: encode({'required': Equal(Eval('type'), 'line')}) On 2011年02月09日 07:56:54, hoRn wrote: > ...
14 years, 11 months ago (2011年02月11日 14:16:31 UTC) #11
http://codereview.appspot.com/4149041/diff/4003/account.py
File account.py (right):
http://codereview.appspot.com/4149041/diff/4003/account.py#newcode285
account.py:285: encode({'required': Equal(Eval('type'), 'line')})
On 2011年02月09日 07:56:54, hoRn wrote:
> don't know why, but in the resulting fields_get of analytic_** there is
> 'invisible' in the states.
With or without your patch?
On a mandatory account chart?
> Think it's because analytic_accounts_fields_get is
> updating the fields_get. I tried to get the states, but the value of states is
a
> string. so updating this string needs something like eval() - don't know ....
In the current state, it is not possible to update the states because of missing
a tool in PYSON.
But you can just set an invisible key in the states dictionary that you
encoding.
Sign in to reply to this message.
udono
12 years, 9 months ago (2013年03月27日 13:12:03 UTC) #12
Sign in to reply to this message.
|
This is Rietveld f62528b

AltStyle によって変換されたページ (->オリジナル) /