Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Coopdevs OCB mirror
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Coopdevs
Odoo
Coopdevs OCB mirror
Commits
4a72d3a7
Commit
4a72d3a7
authored
14 years ago
by
Harshad Modi
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] base: add company_id in ir.attachment and improve search view
bzr revid: hmo@tinyerp.com-20101014103707-rz7114umi29g4w9s
parent
bee7aabb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/addons/base/ir/ir.xml
+26
-10
26 additions, 10 deletions
bin/addons/base/ir/ir.xml
bin/addons/base/ir/ir_attachment.py
+3
-1
3 additions, 1 deletion
bin/addons/base/ir/ir_attachment.py
with
29 additions
and
11 deletions
bin/addons/base/ir/ir.xml
+
26
−
10
View file @
4a72d3a7
...
...
@@ -854,8 +854,11 @@
<field
name=
"type"
>
form
</field>
<field
name=
"arch"
type=
"xml"
>
<form
string=
"Attachments"
>
<field
name=
"name"
/>
<field
name=
"type"
/>
<group
colspan=
"4"
col=
"6"
>
<field
name=
"name"
/>
<field
name=
"type"
/>
<field
name=
"company_id"
groups=
"base.group_multi_company"
widget=
"selection"
/>
</group>
<notebook
colspan=
"4"
>
<page
string=
"Attachment"
>
<group
col=
"4"
colspan=
"4"
>
...
...
@@ -896,6 +899,8 @@
<tree
string=
"Attachments"
>
<field
name=
"name"
/>
<field
name=
"datas_fname"
/>
<field
name=
"type"
invisible=
"1"
/>
<field
name=
"company_id"
groups=
"base.group_multi_company"
/>
<field
name=
"create_uid"
/>
<field
name=
"create_date"
/>
</tree>
...
...
@@ -908,20 +913,31 @@
<field
name=
"arch"
type=
"xml"
>
<search
string=
"Attachments"
>
<group
colspan=
"4"
col=
"10"
>
<filter
icon=
"terp-stage"
string=
"URL"
domain=
"[('type','=','url')]"
/>
<filter
icon=
"terp-stock_align_left_24"
string=
"Binary"
domain=
"[('type','=','binary')]"
/>
<separator
orientation=
"vertical"
/>
<filter
icon=
"terp-stage"
string=
"URL"
domain=
"[('type','=','url')]"
/>
<filter
icon=
"terp-stock_align_left_24"
string=
"Binary"
domain=
"[('type','=','binary')]"
/>
<separator
orientation=
"vertical"
/>
<filter
icon=
"terp-go-month"
string=
"Month"
domain=
"[('create_date','<=', time.strftime('%%Y-%%m-%%d')),('create_date','>=',time.strftime('%%Y-%%m-01'))]"
/>
<separator
orientation=
"vertical"
/>
<field
name=
"name"
/>
<field
name=
"type"
/>
<field
name=
"datas_fname"
/>
<field
name=
"create_uid"
>
<filter
icon=
"terp-personal"
domain=
"[('create_uid','=',uid)]"
help=
"Filter on my documents"
/>
</field>
</group>
<newline/>
<group
expand=
"0"
string=
"Group By..."
>
<filter
string=
"Creator"
icon=
"terp-personal"
domain=
"[]"
context=
"{'group_by':'create_uid'}"
/>
<filter
string=
"Owner"
icon=
"terp-personal"
domain=
"[]"
context=
"{'group_by':'create_uid'}"
/>
<filter
string=
"Type"
icon=
"terp-stock_symbol-selection"
domain=
"[]"
context=
"{'group_by':'type'}"
groups=
"base.group_extended"
/>
<filter
string=
"Company"
icon=
"terp-personal"
domain=
"[]"
context=
"{'group_by':'company_id'}"
groups=
"base.group_multi_company"
/>
<separator
orientation=
"vertical"
/>
<filter
string=
"Month"
help=
"Creation Month"
icon=
"terp-go-month"
domain=
"[]"
context=
"{'group_by':'create_date'}"
/>
</group>
</search>
...
...
This diff is collapsed.
Click to expand it.
bin/addons/base/ir/ir_attachment.py
+
3
−
1
View file @
4a72d3a7
...
...
@@ -117,11 +117,13 @@ class ir_attachment(osv.osv):
'
Type
'
,
help
=
"
Binary File or external URL
"
,
required
=
True
),
'
create_date
'
:
fields
.
datetime
(
'
Date Created
'
,
readonly
=
True
),
'
create_uid
'
:
fields
.
many2one
(
'
res.users
'
,
'
Creator
'
,
readonly
=
True
),
'
create_uid
'
:
fields
.
many2one
(
'
res.users
'
,
'
Owner
'
,
readonly
=
True
),
'
company_id
'
:
fields
.
many2one
(
'
res.company
'
,
'
Company
'
),
}
_defaults
=
{
'
type
'
:
'
binary
'
,
'
company_id
'
:
lambda
s
,
cr
,
uid
,
c
:
s
.
pool
.
get
(
'
res.company
'
).
_company_default_get
(
cr
,
uid
,
'
ir.attachment
'
,
context
=
c
),
}
def
_auto_init
(
self
,
cr
,
context
=
None
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment