Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
dwsproject
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
dws
dwsproject
Commits
60a51a54
Commit
60a51a54
authored
Apr 11, 2025
by
夏超
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[fix] 玖姿问题
parent
822a15b7
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
roke_product_income_expense/models/product_income_expense.py
+3
-3
No files found.
roke_product_income_expense/models/product_income_expense.py
View file @
60a51a54
...
...
@@ -20,7 +20,7 @@ class ProductIncomeExpense(models.Model):
@api.depends
(
"income"
,
"expenditure"
)
def
_compute_balance
(
self
):
data
=
self
.
search
([
(
"id"
,
"in"
,
self
.
ids
)
],
order
=
"business_date asc, create_date asc"
)
data
=
self
.
search
([],
order
=
"business_date asc, create_date asc"
)
for
v
in
data
:
last_data
=
self
.
search
([
"|"
,
...
...
@@ -31,6 +31,6 @@ class ProductIncomeExpense(models.Model):
(
"id"
,
"!="
,
v
.
id
)
],
limit
=
1
,
order
=
"business_date desc, create_date desc"
)
if
not
last_data
:
v
.
balance
=
0
+
v
.
income
-
v
.
expenditure
v
.
balance
=
round
(
0
+
v
.
income
-
v
.
expenditure
,
2
)
else
:
v
.
balance
=
last_data
.
balance
+
v
.
income
-
v
.
expenditure
v
.
balance
=
round
(
last_data
.
balance
+
v
.
income
-
v
.
expenditure
,
2
)
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