File tree Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Expand file tree Collapse file tree 2 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -821,26 +821,29 @@ def action_attach_documents(self):
821
821
"target" : "new" ,
822
822
"context" : dms_context ,
823
823
}
824
+ category_name = "Other Documents"
824
825
if self .env .context .get ("category_id" ):
825
826
category_id = self .env .context .get ("category_id" )
826
827
category = self .env ["spp.dms.category" ].search ([("id" , "=" , category_id )])
827
828
if category :
828
829
dms_context .update (
829
830
{
830
- "default_change_request_id" : rec .id ,
831
831
"default_category_id" : category .id ,
832
832
"category_readonly" : True ,
833
833
}
834
834
)
835
- _logger .debug ("action_attach_documents dms_context: %s" , dms_context )
836
- action .update (
837
- {
838
- "name" : _ ("Upload Document: %s" , category .name ),
839
- "context" : dms_context ,
840
- }
841
- )
835
+ category_name = category .name
842
836
else :
843
837
raise UserError (_ ("The required document category is not configured." ))
838
+
839
+ dms_context .update ({"default_change_request_id" : rec .id })
840
+ _logger .debug ("action_attach_documents dms_context: %s" , dms_context )
841
+ action .update (
842
+ {
843
+ "name" : _ ("Upload Document: %s" , category_name ),
844
+ "context" : dms_context ,
845
+ }
846
+ )
844
847
return action
845
848
else :
846
849
raise UserError (_ ("There are no directories defined for this change request." ))
Original file line number Diff line number Diff line change 43
43
readonly =" 1"
44
44
force_save =" 1"
45
45
/>
46
- <field
47
- name =" change_request_id"
48
- options =" {'no_open':True}"
49
- readonly =" 1"
50
- force_save =" 1"
51
- />
46
+ <field name =" change_request_id" options =" {'no_open':True}" invisible =" 1" />
52
47
<!-- <field
53
48
name="path_json"
54
49
widget="path_json"
You can’t perform that action at this time.
0 commit comments