-
-
Notifications
You must be signed in to change notification settings - Fork 321
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a new field and change the domain filter #44
Add a new field and change the domain filter #44
Conversation
👎 This breaks the login page when debug mode is disactivated. Try a new database and just installing this module. |
@bwrsandman : Ok, I try this |
@bwrsandman: I created a new database and just installed this module document_multiple_record, and I didn't get any error. |
Did you try:
|
@bwrsandman : I saw the issue and I fixed it. |
a48b8b3
to
172e7d8
Compare
a372fb4
to
39fb4fb
Compare
af05c35
to
b9d8bef
Compare
b9d8bef
to
ac7be2e
Compare
👍 |
@@ -70,8 +75,8 @@ var _t = instance.web._t, | |||
this.on_attachments_loaded([]); | |||
} | |||
else { | |||
var dom = [ ['attachment_document_ids.res_model', '=', dataset.model], ['attachment_document_ids.res_id', '=', model_id], ['type', 'in', ['binary', 'url']] ]; | |||
var ds = new instance.web.DataSetSearch(this, 'ir.attachment', dataset.get_context(), dom); | |||
var dom = [ ['related_document', '=', true] ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you did var dom = [ ['related_document', '=', [dataset.model, model_id]] ];
you wouldn't need to lose context.
In _get_related_model_documents
, you could get these from args
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bwrsandman : Your expression "var dom = [ ['related_document', '=', [dataset.model, model_id]] ]; " is incorrect, related_document is a boolean and [dataset.model, model_id]] is a list.
I just add a filter to list attachments where related_document field is true.
I set as needs fixing as there are some remarks from @bwrsandman |
ac7be2e
to
4258b58
Compare
Can't access the log from https://runbot.odoo-community.org/runbot/build/2946193 |
@ehdem try to fix first the logs of travis https://travis-ci.org/OCA/knowledge/builds/61657752 |
|
||
ir_attachment_ids = self.search( | ||
cr, uid, [ | ||
('attachment_document_ids.id', 'in', ir_attachment_doc_ids)]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
context not passed
e04a03e
to
3ee3924
Compare
Add a context to keep the model and model_id. Change the domain filter with the new field [ADD] Add a new field function This new function allows to get the related documents with the model and the model_id. We add this new field because the domain in the view or in the js doesn't match the wanted result [UPD] Add missing comma [ADD] Add unittests
3ee3924
to
9366ebf
Compare
👍 |
…cord_add_field Add a new field and change the domain filter
The new field function allows to get a filter with the model and mode_id. The result is used to update the domain in the js.