Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Odoo CE
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
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
Coopdevs
Comunitats Energètiques
Odoo CE
Commits
02b3afed
Commit
02b3afed
authored
1 year ago
by
Daniil Digtyar Vasilieva
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] energy_selfconsumption: show last period dates
parent
3e472549
No related branches found
No related tags found
1 merge request
!250
[IMP] energy_selfconsumption: add email template
Pipeline
#64118
passed
1 year ago
Stage: test
Changes
2
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
energy_selfconsumption/models/contract.py
+23
-0
23 additions, 0 deletions
energy_selfconsumption/models/contract.py
energy_selfconsumption/views/contract_views.xml
+2
-0
2 additions, 0 deletions
energy_selfconsumption/views/contract_views.xml
with
25 additions
and
0 deletions
energy_selfconsumption/models/contract.py
+
23
−
0
View file @
02b3afed
...
...
@@ -18,6 +18,14 @@ class Contract(models.Model):
supply_point_name
=
fields
.
Char
(
related
=
"
supply_point_assignation_id.supply_point_id.name
"
)
last_period_date_start
=
fields
.
Date
(
string
=
"
Last Period Start
"
,
readonly
=
True
,
)
last_period_date_end
=
fields
.
Date
(
string
=
"
Last Period End
"
,
readonly
=
True
,
)
def
invoicing_wizard_action
(
self
):
"""
...
...
@@ -33,6 +41,21 @@ class Contract(models.Model):
action
[
"
res_id
"
]
=
wizard_id
.
id
return
action
def
_recurring_create_invoice
(
self
,
date_ref
=
False
):
last_period_date_start
=
last_period_date_end
=
False
if
len
(
self
)
>
1
:
last_period_date_start
=
self
[
0
].
next_period_date_start
last_period_date_end
=
self
[
0
].
next_period_date_end
res
=
super
().
_recurring_create_invoice
(
date_ref
=
date_ref
)
if
res
and
last_period_date_start
and
last_period_date_end
:
self
.
write
(
{
"
last_period_date_start
"
:
last_period_date_start
,
"
last_period_date_end
"
:
last_period_date_end
,
}
)
return
res
class
ContractRecurrencyMixin
(
models
.
AbstractModel
):
_inherit
=
"
contract.recurrency.mixin
"
...
...
This diff is collapsed.
Click to expand it.
energy_selfconsumption/views/contract_views.xml
+
2
−
0
View file @
02b3afed
...
...
@@ -11,6 +11,8 @@
<field
name=
"code"
/>
<field
name=
"next_period_date_start"
/>
<field
name=
"next_period_date_end"
/>
<field
name=
"last_period_date_start"
/>
<field
name=
"last_period_date_end"
/>
</tree>
</field>
...
...
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