Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
V
vracoop_click_and_collect
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Le Filament
Vracoop
vracoop_click_and_collect
Commits
b88300b7
Commit
b88300b7
authored
5 years ago
by
Juliana
Browse files
Options
Downloads
Patches
Plain Diff
ajout attrs invisible dans sale pour methode livraison
parent
ed3a90da
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
models/sale_order.py
+8
-1
8 additions, 1 deletion
models/sale_order.py
views/sale_order.xml
+4
-3
4 additions, 3 deletions
views/sale_order.xml
views/vracoop_templates.xml
+3
-3
3 additions, 3 deletions
views/vracoop_templates.xml
with
15 additions
and
7 deletions
models/sale_order.py
+
8
−
1
View file @
b88300b7
...
...
@@ -12,6 +12,9 @@ class SaleOrder(models.Model):
string
=
"
Point retrait
"
)
day_retrait
=
fields
.
Date
(
"
Jour du retrait
"
)
hour_retrait
=
fields
.
Float
(
"
Heure du retrait
"
)
carrier_point_retrait
=
fields
.
Boolean
(
string
=
'
Point retrait
'
,
related
=
'
carrier_id.point_retrait
'
)
def
_check_retrait
(
self
,
force_retrait_id
=
None
):
self
.
ensure_one
()
...
...
@@ -31,8 +34,12 @@ class SaleOrder(models.Model):
hour
=
values
[
2
].
split
(
"
:
"
)
hour_retrait
=
float
(
'
%s.%s
'
%
(
hour
[
0
],
hour
[
1
]))
PointRetrait
=
self
.
env
[
'
vracoop.point.retrait
'
]
retrait
=
PointRetrait
.
browse
(
values
[
3
])
self
.
write
({
'
hour_retrait
'
:
hour_retrait
,
'
day_retrait
'
:
day_retrait
})
'
day_retrait
'
:
day_retrait
,
'
vracoop_point_retrait_id
'
:
retrait
.
id
})
return
True
\ No newline at end of file
This diff is collapsed.
Click to expand it.
views/sale_order.xml
+
4
−
3
View file @
b88300b7
...
...
@@ -9,9 +9,10 @@
<field
name=
"arch"
type=
"xml"
>
<data>
<xpath
expr=
"//div[@name='carrier_selection']"
position=
"after"
>
<field
name=
"vracoop_point_retrait_id"
/>
<field
name=
"day_retrait"
/>
<field
name=
"hour_retrait"
widget=
"float_time"
/>
<field
name=
"carrier_point_retrait"
invisible=
"1"
/>
<field
name=
"vracoop_point_retrait_id"
attrs=
"{'invisible': [('carrier_point_retrait', '=', False)]}"
/>
<field
name=
"day_retrait"
attrs=
"{'invisible': [('carrier_point_retrait', '=', False)]}"
/>
<field
name=
"hour_retrait"
widget=
"float_time"
attrs=
"{'invisible': [('carrier_point_retrait', '=', False)]}"
/>
</xpath>
</data>
</field>
...
...
This diff is collapsed.
Click to expand it.
views/vracoop_templates.xml
+
3
−
3
View file @
b88300b7
...
...
@@ -17,7 +17,7 @@
<t
t-esc=
"point_retrait.zip"
/></span><br/><br/>
<div
class=
"collapse"
data-parent=
"#retrait_method"
t-att-id=
"'slots_point_retrait_%i' % point_retrait.id"
>
<div
t-att-
class=
"
'
collapse
show' if point_retrait_nb == 1 else 'collapse'
"
data-parent=
"#retrait_method"
t-att-id=
"'slots_point_retrait_%i' % point_retrait.id"
>
<h5>
Sélectionner le jour et le créneau pour votre retrait
</h5>
<t
t-set=
"list_slots"
t-value=
"point_retrait.slot_calculate()"
/>
...
...
@@ -74,7 +74,7 @@
<div
class=
"container tab-pane active"
t-attf-id=
'#{slot[1].strftime("%A")}#{point_retrait.id}'
>
<t
t-foreach=
"slot[3]"
t-as=
"slot_by_day"
>
<label
class=
"label_radio_button"
role=
"radio"
>
<input
name=
"hour_select"
type=
"radio"
class=
"radio_hide"
t-attf-value=
"#{slot[1].day}-#{slot[1].month}-#{slot_by_day[0]}"
t-attf-id=
"#{slot_by_day_index}"
/>
<input
name=
"hour_select"
type=
"radio"
class=
"radio_hide"
t-attf-value=
"#{slot[1].day}-#{slot[1].month}-#{slot_by_day[0]}
-#{point_retrait.id}
"
t-attf-id=
"#{slot_by_day_index}"
/>
<span
class=
"btn btn-outline-primary span_radio_button"
>
<t
t-esc=
"slot_by_day[0]"
/>
:
<t
t-esc=
"slot_by_day[1]"
/>
...
...
@@ -87,7 +87,7 @@
<div
class=
"container tab-pane fade"
t-attf-id=
'#{slot[1].strftime("%A")}#{point_retrait.id}'
>
<t
t-foreach=
"slot[3]"
t-as=
"slot_by_day"
>
<label
class=
" label_radio_button"
role=
"radio"
>
<input
t-attf-id=
"#{slot_by_day_index}"
name=
"hour_select"
type=
"radio"
class=
"radio_hide"
t-attf-value=
"#{slot[1].day}-#{slot[1].month}-#{slot_by_day[0]}"
/>
<input
t-attf-id=
"#{slot_by_day_index}"
name=
"hour_select"
type=
"radio"
class=
"radio_hide"
t-attf-value=
"#{slot[1].day}-#{slot[1].month}-#{slot_by_day[0]}
-#{point_retrait.id}
"
/>
<span
class=
"btn btn-outline-primary span_radio_button"
>
<t
t-esc=
"slot_by_day[0]"
/>
:
<t
t-esc=
"slot_by_day[1]"
/>
...
...
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