[Stoq-devel] [Bug 2816] - Evitar a abertura de vendas para usuários sem a faceta ISalesPerson

bugzilla-daemon at async.com.br bugzilla-daemon at async.com.br
Tue Sep 5 16:46:27 BRT 2006


http://bugs.async.com.br/show_bug.cgi?id=2816  





--- Comment #3 from Johan Dahlin <jdahlin at async.com.br>  2006-09-05 16:46 BRT ---
(In reply to comment #2)
> (In reply to comment #1)
> > (From update of attachment 3519 [edit] [edit])
> > >Index: stoq/gui/pos/pos.py
> > 
> > >+        if not ISalesPerson(get_current_user(self.conn).get_adapted()):
> > >+            warning(_(u"You can't start a new sale, since you are not a "
> > >+                      "salesperson."))
> > >+            return
> > 
> > This check is done in the wrong place because, you don't want to see it when
> > 
> > * You login as an administrator
> > * You login as a manager
> > 
> > Ideally, it should only be shown /when/ you're actually trying to do something
> > which is not 
> > supported, such as starting a opening up a new sale.
> 
> if you look properly at the code, you'll see that the code was inserted in
> "new_order" method:
> 
>     def _new_order(self):
>         if not get_current_till_operation(self.conn):
>             warning(_(u"You need open the till before start doing sales."))
>             return
>         if not ISalesPerson(get_current_user(self.conn).get_adapted()):
>             warning(_(u"You can't start a new sale, since you are not a "
>                       "salesperson."))
>             return
>         if self._coupon is not None:
>             self._cancel_order()
>         rollback_and_begin(self.conn)
>         self.sale = self.run_dialog(NewOrderEditor, self.conn)
>         ...
> 
> I think it will help you to review now, the diff was confuse I know.
> 

Okay, it's fine then, r=jdahlin


More information about the Stoq-devel mailing list