Tue 12 May 2015 02:56:54 AM UTC, comment #4:
Hiya Luis!
Thanks for the clarification!
I think documenting this behavior is a great idea because there are a few bug reports about the Related Records actions. I mean, it makes more sense from a developer standpoint why it's read-only.
Changing the name, I think, would clarify it to users. Maybe change the page title, too -- like Stock Moves [read-only] or similar. However, I still think we'll get bug reports about this problem because many views aren't truly read-only, since you can try to create a new record. Other than deleting the domain and allowing a clean view, I don't see an easy solution.
Thanks again.
|
Mon 11 May 2015 10:49:44 AM UTC, comment #3:
Hi,Chris
We created the wizard so the stock moves are generated from the information given in the main prescription / vaccination view.
So, the related records in these models are only to view NOT to generate the moves. As you said, this is done in the stock move wizard .
Since Tryton 3.2, the domain in relate actions has been limited to active_ids . This is part of the reason we use wizard to create the stock move and to create the patient evaluation from the appointment.
Check http://savannah.gnu.org/bugs/?43111
We should document the functionality on the wiki and close the bug. Probably, we should also call the related records action "View stock moves" to be more explicit about the purpose.
Best,
|
Mon 11 May 2015 12:54:32 AM UTC, comment #2:
This issue is one of a series of issues with form_relate and domains (with similar bug reports). Put simply, you should create new stock moves by means of the wizard: Actions > Create Prescription/Vaccination Stock Move. On the technical side, the Related Records function defines a domain/filter for the Stock Moves view, in order to only show the related stock move. However, when you try to create a new record from that view, the domain is still active, consequently some weird stuff happens (errors). I'm not entirely clear why. Nevertheless, you can create new stock moves from the default view (no domain defined). A simple fix is to remove the domain, so the shortcut is to the default view of Stock Moves, then the user can filter down to what they are looking for. However, you lose the ability to immediately see the related Stock Move (if it exists). Another possibility is to define a search_value (for the search bar) that will display only Stock Moves from that model (can't seem to make this search specific enough to display the single stock move related to the prescription/vaccination). To be honest, I think removing the domain would alleviate some confusion. Or even removing the related records function altogether. In general, I'm finding that form_relate (Related Records) oftentimes produces confusing behavior. Thoughts?
|
Wed 29 Jan 2014 08:36:15 AM UTC, original submission:
Hi,
I am testing GNU Health on demo server as following:
Server: health.gnusolidario.org:8000
Database: health24rc1
User name: admin
Password: gnusolidario
Tryton version: 3.0.2
========================================
When I tried to create a stock move as follows, I got 'Application Error' Message window:
1. Prescriptions
2. Select one prescriptions (here in demo server I selected PRES 2013/000002)
3. Open Related Records (in top menu bar)
4. Create New Record (from top menu bar)
5. Select 'Origin' as 'Patient Ambulatory Care' and then 'Open New Record'.
This give 'Application Error' as follows:
(SOME TIMES IT GOES TO HANGING STATE)
=========================================
Traceback (most recent call last):
File "/trytond/protocols/jsonrpc.py", line 123, in _marshaled_dispatch
response['result'] = dispatch_method(method, params)
File "/trytond/protocols/jsonrpc.py", line 156, in _dispatch
res = dispatch(*args)
File "/trytond/protocols/dispatcher.py", line 169, in dispatch
result = rpc.result(meth(c_args, *c_kwargs))
File "/trytond/model/modelsql.py", line 871, in search
tables, expression = cls.search_domain(domain)
File "/trytond/model/modelsql.py", line 1044, in search_domain
expression = convert(domain)
File "/trytond/model/modelsql.py", line 1042, in convert
domain[1:] if domain[0] == 'AND' else domain)))
File "/trytond/model/modelsql.py", line 1041, in <genexpr>
return And((convert(d) for d in (
File "/trytond/model/modelsql.py", line 1032, in convert
expression = field.convert_domain(domain, tables, cls)
File "/trytond/model/fields/field.py", line 237, in convert_domain
name, operator, value = domain
ValueError: too many values to unpack
|