Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Invoice Improvements
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Model registry
Analyze
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
XCG
Odoo modules
Invoice Improvements
Commits
28b5ce385189
Commit
28b5ce385189
authored
11 years ago
by
Emmanuel Cazenave
Browse files
Options
Downloads
Patches
Plain Diff
Now it really transfer analytics to the invoice.
parent
aab2d7552d9c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
account_invoice.py
+24
-14
24 additions, 14 deletions
account_invoice.py
with
24 additions
and
14 deletions
account_invoice.py
+
24
−
14
View file @
28b5ce38
...
@@ -34,5 +34,20 @@
...
@@ -34,5 +34,20 @@
),
),
}
}
def
move_line_get_item
(
self
,
cr
,
uid
,
line
,
context
=
None
):
res
=
super
(
account_invoice_line_analytic
,
self
)
\
.
move_line_get_item
(
cr
,
uid
,
line
,
context
=
context
)
for
i
in
range
(
1
,
6
):
key
=
"
a%s_id
"
%
i
val
=
getattr
(
line
,
key
).
id
res
[
key
]
=
val
return
res
class
account_invoice_analytic
(
osv
.
Model
):
_name
=
"
account.invoice
"
_inherit
=
"
account.invoice
"
def
fields_view_get
(
self
,
cr
,
uid
,
view_id
=
None
,
view_type
=
False
,
def
fields_view_get
(
self
,
cr
,
uid
,
view_id
=
None
,
view_type
=
False
,
context
=
None
,
toolbar
=
False
,
submenu
=
False
):
context
=
None
,
toolbar
=
False
,
submenu
=
False
):
...
@@ -37,6 +52,5 @@
...
@@ -37,6 +52,5 @@
def
fields_view_get
(
self
,
cr
,
uid
,
view_id
=
None
,
view_type
=
False
,
def
fields_view_get
(
self
,
cr
,
uid
,
view_id
=
None
,
view_type
=
False
,
context
=
None
,
toolbar
=
False
,
submenu
=
False
):
context
=
None
,
toolbar
=
False
,
submenu
=
False
):
print
"
FIELDS VIEW GET CALLED
"
'''
'''
Display analysis code in account move lines trees
Display analysis code in account move lines trees
'''
'''
...
@@ -44,7 +58,7 @@
...
@@ -44,7 +58,7 @@
context
=
{}
context
=
{}
print
"
Context is
"
print
"
Context is
"
print
context
print
context
res
=
super
(
account_invoice_
line_
analytic
,
self
).
fields_view_get
(
res
=
super
(
account_invoice_analytic
,
self
).
fields_view_get
(
cr
,
uid
,
view_id
=
view_id
,
cr
,
uid
,
view_id
=
view_id
,
view_type
=
view_type
,
context
=
context
,
view_type
=
view_type
,
context
=
context
,
toolbar
=
toolbar
,
submenu
=
False
)
toolbar
=
toolbar
,
submenu
=
False
)
...
@@ -109,15 +123,11 @@
...
@@ -109,15 +123,11 @@
'
views
'
][
'
tree
'
][
'
arch
'
]
=
etree
.
tostring
(
doc
)
'
views
'
][
'
tree
'
][
'
arch
'
]
=
etree
.
tostring
(
doc
)
return
res
return
res
# We override the Hook method of account_invoice
def
line_get_convert
(
self
,
cr
,
uid
,
x
,
part
,
date
,
context
=
None
):
# to add our analytic codes
res
=
super
(
account_invoice_analytic
,
self
)
\
def
finalize_invoice_move_lines
(
self
,
cr
,
uid
,
invoice_browse
,
move_lines
):
.
line_get_convert
(
cr
,
uid
,
x
,
part
,
date
,
context
)
print
"
************************************
"
for
i
in
range
(
1
,
6
):
print
invoice_browse
key
=
"
a%s_id
"
%
i
print
"
************************************
"
val
=
x
.
get
(
key
)
print
move_lines
res
[
key
]
=
val
print
"
************************************
"
return
res
return
super
(
account_invoice_line_analytic
,
self
).
finalize_invoice_move_lines
(
cr
,
uid
,
invoices_browse
,
move_lines
)
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