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
3500a4c0
Commit
3500a4c0
authored
1 year ago
by
Daniil Digtyar Vasilieva
Browse files
Options
Downloads
Patches
Plain Diff
[IMP] energy_selfconsumption: format name contract line from contract template line
parent
907a343f
No related branches found
No related tags found
1 merge request
!243
[IMP] energy_selfconsumption: invoicing integration fixes
Pipeline
#62940
passed
1 year ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
energy_selfconsumption/wizards/contract_generation_wizard.py
+10
-11
10 additions, 11 deletions
energy_selfconsumption/wizards/contract_generation_wizard.py
energy_selfconsumption/wizards/define_invoicing_mode_wizard.py
+2
-1
2 additions, 1 deletion
...y_selfconsumption/wizards/define_invoicing_mode_wizard.py
with
12 additions
and
12 deletions
energy_selfconsumption/wizards/contract_generation_wizard.py
+
10
−
11
View file @
3500a4c0
...
...
@@ -51,17 +51,16 @@ class ContractGenerationWizard(models.TransientModel):
)
# We use the next method from the contract model to update the contract fields with contract template
contract
.
_onchange_contract_template_id
()
# Now, we need to update the name field using the code and display_name fields
name
=
_
(
"""
CUPS: %s
\n
Owner: %s
\n
Invoicing period: #START# - #END#
"""
)
%
(
supply_point_assignation
.
supply_point_id
.
code
,
supply_point_assignation
.
supply_point_id
.
owner_id
.
display_name
,
)
contract
.
contract_line_ids
.
write
(
{
"
name
"
:
name
,
"
supply_point_assignation_id
"
:
supply_point_assignation
.
id
,
}
)
for
contract_line_id
in
contract
.
contract_line_ids
:
contract_line_id
.
write
(
{
"
name
"
:
contract_line_id
.
name
.
format
(
code
=
supply_point_assignation
.
supply_point_id
.
code
,
owner_id
=
supply_point_assignation
.
supply_point_id
.
owner_id
.
display_name
,
),
"
supply_point_assignation_id
"
:
supply_point_assignation
.
id
,
}
)
# Update selfconsumption and distribution_table state
self
.
selfconsumption_id
.
write
({
"
state
"
:
"
active
"
})
self
.
selfconsumption_id
.
distribution_table_state
(
"
process
"
,
"
active
"
)
...
...
This diff is collapsed.
Click to expand it.
energy_selfconsumption/wizards/define_invoicing_mode_wizard.py
+
2
−
1
View file @
3500a4c0
...
...
@@ -89,7 +89,8 @@ class ContractGenerationWizard(models.TransientModel):
"
company_id
"
:
self
.
env
.
company
.
id
,
"
qty_type
"
:
"
variable
"
,
"
qty_formula_id
"
:
formula_contract_id
.
id
,
"
name
"
:
""
,
# Values are formatted in contract_generation_wizard
"
name
"
:
"""
CUPS: {code}
\n
Owner: {owner_id}
\n
Invoicing period: #START# - #END#
"""
,
}
def
save_data_to_selfconsumption
(
self
):
...
...
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