Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
erp5
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
139
Merge Requests
139
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
erp5
Commits
a5581cd5
Commit
a5581cd5
authored
Jun 24, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
invoicing: scripts to get dynamic accounting trade model paths
parent
25e4a08a
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
337 additions
and
0 deletions
+337
-0
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/TradeModelPath_getAccountingDynamicDestinationCategoryListWithAnalytic.py
...etAccountingDynamicDestinationCategoryListWithAnalytic.py
+18
-0
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/TradeModelPath_getAccountingDynamicDestinationCategoryListWithAnalytic.xml
...tAccountingDynamicDestinationCategoryListWithAnalytic.xml
+62
-0
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/TradeModelPath_getAccountingDynamicDestinationCategoryListWithoutAnalytic.py
...ccountingDynamicDestinationCategoryListWithoutAnalytic.py
+27
-0
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/TradeModelPath_getAccountingDynamicDestinationCategoryListWithoutAnalytic.xml
...countingDynamicDestinationCategoryListWithoutAnalytic.xml
+62
-0
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/TradeModelPath_getAccountingDynamicSourceCategoryListWithAnalytic.py
...ath_getAccountingDynamicSourceCategoryListWithAnalytic.py
+18
-0
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/TradeModelPath_getAccountingDynamicSourceCategoryListWithAnalytic.xml
...th_getAccountingDynamicSourceCategoryListWithAnalytic.xml
+62
-0
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/TradeModelPath_getAccountingDynamicSourceCategoryListWithoutAnalytic.py
..._getAccountingDynamicSourceCategoryListWithoutAnalytic.py
+26
-0
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/TradeModelPath_getAccountingDynamicSourceCategoryListWithoutAnalytic.xml
...getAccountingDynamicSourceCategoryListWithoutAnalytic.xml
+62
-0
No files found.
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/TradeModelPath_getAccountingDynamicDestinationCategoryListWithAnalytic.py
0 → 100644
View file @
a5581cd5
category_list
=
context
.
TradeModelPath_getAccountingDynamicDestinationCategoryListWithoutAnalytic
(
movement
)
function
=
movement
.
getDestinationFunction
(
base
=
True
)
or
context
.
getDestinationFunction
(
base
=
True
)
if
function
:
category_list
.
append
(
function
)
funding
=
movement
.
getDestinationFunding
(
base
=
True
)
or
context
.
getDestinationFunding
(
base
=
True
)
if
funding
:
category_list
.
append
(
funding
)
project
=
movement
.
getDestinationProject
(
base
=
True
)
or
context
.
getDestinationProject
(
base
=
True
)
if
project
:
category_list
.
append
(
project
)
return
category_list
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/TradeModelPath_getAccountingDynamicDestinationCategoryListWithAnalytic.xml
0 → 100644
View file @
a5581cd5
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
movement
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
TradeModelPath_getAccountingDynamicDestinationCategoryListWithAnalytic
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/TradeModelPath_getAccountingDynamicDestinationCategoryListWithoutAnalytic.py
0 → 100644
View file @
a5581cd5
portal
=
context
.
getPortalObject
()
category_list
=
[
c
for
c
in
[
movement
.
getDestinationSection
(
base
=
True
),
movement
.
getDestinationPayment
(
base
=
True
)
]
if
c
]
account
=
movement
.
getDestinationAccount
()
or
context
.
getDestination
()
if
not
account
:
# try to find from predicates
resource
=
movement
.
getResourceValue
()
if
resource
is
not
None
:
account
=
next
(
(
predicate
.
getDestinationAccount
()
for
predicate
in
portal
.
portal_domains
.
searchPredicateList
(
context
=
movement
,
portal_type
=
'Purchase Supply Line'
,
)
if
predicate
.
getDestinationAccount
()),
None
)
if
account
:
category_list
.
append
(
'destination/%s'
%
account
)
return
category_list
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/TradeModelPath_getAccountingDynamicDestinationCategoryListWithoutAnalytic.xml
0 → 100644
View file @
a5581cd5
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
movement
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
TradeModelPath_getAccountingDynamicDestinationCategoryListWithoutAnalytic
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/TradeModelPath_getAccountingDynamicSourceCategoryListWithAnalytic.py
0 → 100644
View file @
a5581cd5
category_list
=
context
.
TradeModelPath_getAccountingDynamicSourceCategoryListWithoutAnalytic
(
movement
)
function
=
movement
.
getSourceFunction
(
base
=
True
)
or
context
.
getSourceFunction
(
base
=
True
)
if
function
:
category_list
.
append
(
function
)
funding
=
movement
.
getSourceFunding
(
base
=
True
)
or
context
.
getSourceFunding
(
base
=
True
)
if
funding
:
category_list
.
append
(
funding
)
project
=
movement
.
getSourceProject
(
base
=
True
)
or
context
.
getSourceProject
(
base
=
True
)
if
project
:
category_list
.
append
(
project
)
return
category_list
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/TradeModelPath_getAccountingDynamicSourceCategoryListWithAnalytic.xml
0 → 100644
View file @
a5581cd5
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
movement
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
TradeModelPath_getAccountingDynamicSourceCategoryListWithAnalytic
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/TradeModelPath_getAccountingDynamicSourceCategoryListWithoutAnalytic.py
0 → 100644
View file @
a5581cd5
portal
=
context
.
getPortalObject
()
category_list
=
[
c
for
c
in
[
movement
.
getSourceSection
(
base
=
True
),
movement
.
getSourcePayment
(
base
=
True
)
]
if
c
]
account
=
movement
.
getSourceAccount
()
or
context
.
getSource
()
if
not
account
:
# try to find from predicates
resource
=
movement
.
getResourceValue
()
if
resource
is
not
None
:
account
=
next
(
(
predicate
.
getSourceAccount
()
for
predicate
in
portal
.
portal_domains
.
searchPredicateList
(
context
=
movement
,
portal_type
=
'Sale Supply Line'
,
)
if
predicate
.
getSourceAccount
()),
None
)
if
account
:
category_list
.
append
(
'source/%s'
%
account
)
return
category_list
bt5/erp5_invoicing/SkinTemplateItem/portal_skins/erp5_invoicing/TradeModelPath_getAccountingDynamicSourceCategoryListWithoutAnalytic.xml
0 → 100644
View file @
a5581cd5
<?xml version="1.0"?>
<ZopeData>
<record
id=
"1"
aka=
"AAAAAAAAAAE="
>
<pickle>
<global
name=
"PythonScript"
module=
"Products.PythonScripts.PythonScript"
/>
</pickle>
<pickle>
<dictionary>
<item>
<key>
<string>
Script_magic
</string>
</key>
<value>
<int>
3
</int>
</value>
</item>
<item>
<key>
<string>
_bind_names
</string>
</key>
<value>
<object>
<klass>
<global
name=
"NameAssignments"
module=
"Shared.DC.Scripts.Bindings"
/>
</klass>
<tuple/>
<state>
<dictionary>
<item>
<key>
<string>
_asgns
</string>
</key>
<value>
<dictionary>
<item>
<key>
<string>
name_container
</string>
</key>
<value>
<string>
container
</string>
</value>
</item>
<item>
<key>
<string>
name_context
</string>
</key>
<value>
<string>
context
</string>
</value>
</item>
<item>
<key>
<string>
name_m_self
</string>
</key>
<value>
<string>
script
</string>
</value>
</item>
<item>
<key>
<string>
name_subpath
</string>
</key>
<value>
<string>
traverse_subpath
</string>
</value>
</item>
</dictionary>
</value>
</item>
</dictionary>
</state>
</object>
</value>
</item>
<item>
<key>
<string>
_params
</string>
</key>
<value>
<string>
movement
</string>
</value>
</item>
<item>
<key>
<string>
id
</string>
</key>
<value>
<string>
TradeModelPath_getAccountingDynamicSourceCategoryListWithoutAnalytic
</string>
</value>
</item>
</dictionary>
</pickle>
</record>
</ZopeData>
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment