Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
l10n_ar_padroniibb_import
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
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
Aconcagua
l10n_ar_padroniibb_import
Commits
738603c6
Commit
738603c6
authored
6 years ago
by
Reviewer Intergaláctico
Browse files
Options
Downloads
Patches
Plain Diff
[MOD] Retentions Mods
parent
33bd3fe6
Branches
8.0-SitIIBB_Load
Branches containing commit
No related tags found
3 merge requests
!16
8.0 stage
,
!15
8.0 arba change
,
!7
[MOD] Res Partner Perception IIBB Sit Load
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
partner.py
+13
-8
13 additions, 8 deletions
partner.py
retention_view.xml
+13
-0
13 additions, 0 deletions
retention_view.xml
wizard/padron_mass_update.py
+12
-21
12 additions, 21 deletions
wizard/padron_mass_update.py
with
38 additions
and
29 deletions
partner.py
+
13
−
8
View file @
738603c6
...
...
@@ -71,13 +71,12 @@ class res_partner(models.Model):
if
not
retent_ids
:
return
res
padron_retent
=
ret_ids
[
0
]
# TODO: Sit IIBB calculada a partir de multilateral en
# padron_retent (Cuando exista el campo en partner_retentions)
# sit_iibb = self._compute_sit_iibb(padron_retent)
sit_iibb
=
self
.
_compute_sit_iibb
(
padron_retent
)
res
=
{
'
retention_id
'
:
retent_ids
[
0
].
id
,
'
percent
'
:
padron_retent
.
percentage_retention
,
'
multilateral
'
:
padron_retent
.
multilateral
,
'
sit_iibb
'
:
sit_iibb
,
'
from_padron
'
:
True
,
}
return
res
...
...
@@ -114,13 +113,12 @@ class res_partner(models.Model):
if
not
retent_ids
:
return
res
padron_retent
=
ret_ids
[
0
]
# TODO: Sit IIBB calculada a partir de multilateral en
# padron_retent (Cuando exista el campo en partner_retentions)
# sit_iibb = self._compute_sit_iibb(padron_retent)
sit_iibb
=
self
.
_compute_sit_iibb
(
padron_retent
)
res
=
{
'
retention_id
'
:
retent_ids
[
0
].
id
,
'
percent
'
:
padron_retent
.
percentage
,
'
multilateral
'
:
padron_retent
.
multilateral
,
'
sit_iibb
'
:
sit_iibb
,
'
from_padron
'
:
True
,
}
return
res
...
...
@@ -333,3 +331,10 @@ class res_partner_perception(models.Model):
_inherit
=
"
res.partner.perception
"
from_padron
=
fields
.
Boolean
(
string
=
"
From Padron
"
)
class
res_partner_retention
(
models
.
Model
):
_name
=
"
res.partner.retention
"
_inherit
=
"
res.partner.retention
"
from_padron
=
fields
.
Boolean
(
string
=
"
From Padron
"
)
This diff is collapsed.
Click to expand it.
retention_view.xml
+
13
−
0
View file @
738603c6
...
...
@@ -13,6 +13,19 @@
</field>
</field>
</record>
<record
id=
"view_partner_retention_form_from_padron"
model=
"ir.ui.view"
>
<field
name=
"name"
>
res.partner.retention.from.padron
</field>
<field
name=
"model"
>
res.partner
</field>
<field
name=
"type"
>
form
</field>
<field
name=
"priority"
>
20
</field>
<field
name=
"inherit_id"
ref=
"l10n_ar_retentions.view_partner_retention_form"
/>
<field
name=
"arch"
type=
"xml"
>
<field
name=
"sit_iibb"
position=
"after"
>
<field
name=
"from_padron"
readonly=
"True"
/>
</field>
</field>
</record>
</data>
</openerp>
This diff is collapsed.
Click to expand it.
wizard/padron_mass_update.py
+
12
−
21
View file @
738603c6
...
...
@@ -64,21 +64,19 @@ class padron_mass_update(models.TransientModel):
cr
.
execute
(
query
,
params
)
for
res
in
cr
.
fetchall
():
partner_id
=
res
[
0
]
or
res
[
4
]
multi
=
'
2
'
if
res
[
2
]
else
'
1
'
q
=
"
UPDATE res_partner SET sit_iibb=%(sit_iibb)s WHERE id=%(partner_id)s
"
q_params
=
{
'
partner_id
'
:
partner_id
,
'
sit_iibb
'
:
multi
}
self
.
_cr
.
execute
(
q
,
q_params
)
if
res
[
6
]
==
'
UPDATE
'
:
# Change the amount of percentage
q
=
"
UPDATE res_partner_retention SET percent=%(percent)s WHERE id=%(id)s
"
q
=
"
UPDATE res_partner_retention SET percent=%(percent)s,
\
from_padron = True WHERE id=%(id)s
"
q_params
=
{
'
percent
'
:
res
[
1
],
'
id
'
:
res
[
3
]}
self
.
_cr
.
execute
(
q
,
q_params
)
elif
res
[
6
]
==
'
DELETE
'
:
# Set the percentage to -1
q
=
"
UPDATE res_partner_retention SET percent=%(percent)s WHERE id=%(id)s
"
q
=
"
UPDATE res_partner_retention SET percent=%(percent)s,
\
from_padron = True WHERE id=%(id)s
"
q_params
=
{
'
percent
'
:
-
1
,
'
id
'
:
res
[
3
]}
self
.
_cr
.
execute
(
q
,
q_params
)
elif
res
[
6
]
==
'
CREATE
'
:
# Create the res.partner.retention
q
=
"
INSERT INTO res_partner_retention (partner_id, percent, retention_id) VALUES (%(partner_id)s, %(percent)s, %(retention_id)s)
"
q
=
"
INSERT INTO res_partner_retention (partner_id, percent, retention_id, from_padron)
\
VALUES (%(partner_id)s, %(percent)s, %(retention_id)s, True)
"
q_params
=
{
'
percent
'
:
res
[
1
],
'
partner_id
'
:
res
[
0
],
'
retention_id
'
:
retention_id
}
self
.
_cr
.
execute
(
q
,
q_params
)
else
:
...
...
@@ -187,21 +185,19 @@ class padron_mass_update(models.TransientModel):
cr
.
execute
(
query
,
params
)
for
res
in
cr
.
fetchall
():
partner_id
=
res
[
0
]
or
res
[
4
]
multi
=
'
2
'
if
res
[
2
]
else
'
1
'
q
=
"
UPDATE res_partner SET sit_iibb=%(sit_iibb)s WHERE id=%(partner_id)s
"
q_params
=
{
'
partner_id
'
:
partner_id
,
'
sit_iibb
'
:
multi
}
self
.
_cr
.
execute
(
q
,
q_params
)
if
res
[
6
]
==
'
UPDATE
'
:
# Change the amount of percentage
q
=
"
UPDATE res_partner_retention SET percent=%(percent)s WHERE id=%(id)s
"
q
=
"
UPDATE res_partner_retention SET percent=%(percent)s
\
from_padron = True WHERE id=%(id)s
"
q_params
=
{
'
percent
'
:
res
[
1
],
'
id
'
:
res
[
3
]}
self
.
_cr
.
execute
(
q
,
q_params
)
elif
res
[
6
]
==
'
DELETE
'
:
# Set the percentage to -1
q
=
"
UPDATE res_partner_retention SET percent=%(percent)s WHERE id=%(id)s
"
q
=
"
UPDATE res_partner_retention SET percent=%(percent)s
\
from_padron = True WHERE id=%(id)s
"
q_params
=
{
'
percent
'
:
-
1
,
'
id
'
:
res
[
3
]}
self
.
_cr
.
execute
(
q
,
q_params
)
elif
res
[
6
]
==
'
CREATE
'
:
# Create the res.partner.retention
q
=
"
INSERT INTO res_partner_retention (partner_id, percent, retention_id) VALUES (%(partner_id)s, %(percent)s, %(retention_id)s)
"
q
=
"
INSERT INTO res_partner_retention (partner_id, percent, retention_id, from_padron)
\
VALUES (%(partner_id)s, %(percent)s, %(retention_id)s, True)
"
q_params
=
{
'
percent
'
:
res
[
1
],
'
partner_id
'
:
res
[
0
],
'
retention_id
'
:
retention_id
}
self
.
_cr
.
execute
(
q
,
q_params
)
else
:
...
...
@@ -243,11 +239,6 @@ class padron_mass_update(models.TransientModel):
cr
.
execute
(
query
,
params
)
for
res
in
cr
.
fetchall
():
partner_id
=
res
[
0
]
or
res
[
4
]
multi
=
'
2
'
if
res
[
2
]
else
'
1
'
q
=
"
UPDATE res_partner SET sit_iibb=%(sit_iibb)s WHERE id=%(partner_id)s
"
q_params
=
{
'
partner_id
'
:
partner_id
,
'
sit_iibb
'
:
multi
}
self
.
_cr
.
execute
(
q
,
q_params
)
if
res
[
6
]
==
'
UPDATE
'
:
# Change the amount of percentage
q
=
"
UPDATE res_partner_perception SET percent=%(percent)s,
\
from_padron = True WHERE id=%(id)s
"
...
...
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