Skip to content
GitLab
Explore
Projects
Groups
Topics
Snippets
Projects
Groups
Topics
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Otros
ob_customer_credit_limit
Commits
26cb7b89
There was an error fetching the commit references. Please try again later.
Commit
26cb7b89
authored
9 months ago
by
lucianortiz
Browse files
Options
Downloads
Patches
Plain Diff
[T4015] add compute payment_notices
parent
c32629e4
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
models/res_partner.py
+8
-0
models/res_partner.py
with
8 additions
and
0 deletions
models/res_partner.py
+
8
−
0
View file @
26cb7b89
...
...
@@ -37,8 +37,16 @@ class ResPartner(models.Model):
string
=
"
Payment notices
"
,
default
=
0
,
help
=
'
Billing Notices
'
,
compute
=
"
_compute_payment_notices
"
)
@api.depends_context
(
'
company
'
)
def
_compute_payment_notices
(
self
):
BillingNotice
=
self
.
env
[
'
billing.notice
'
]
partner_notices_by_company
=
BillingNotice
.
search
(
[(
'
client_name
'
,
'
=
'
,
self
.
name
),
(
'
state
'
,
'
=
'
,
'
sent
'
),
(
'
company
'
,
'
=
'
,
self
.
env
.
company
.
id
)])
self
.
payment_notices
=
sum
([
notice
.
amount
for
notice
in
partner_notices_by_company
])
@api.depends
(
'
credit
'
,
'
debit
'
,
'
payment_notices
'
)
def
_compute_amount_due
(
self
):
for
rec
in
self
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
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
Menu
Explore
Projects
Groups
Topics
Snippets