Compare commits
No commits in common. "9d614ed79eb640930836da99432007e4de8ad6d7" and "91301fc2715f26bb4c13f3f3318d30a5df666368" have entirely different histories.
9d614ed79e
...
91301fc271
3 changed files with 19 additions and 17 deletions
|
|
@ -134,8 +134,7 @@ class GroupOrder(models.Model):
|
||||||
|
|
||||||
# === Home delivery ===
|
# === Home delivery ===
|
||||||
home_delivery = fields.Boolean(
|
home_delivery = fields.Boolean(
|
||||||
compute="_compute_home_delivery",
|
default=False,
|
||||||
store=True,
|
|
||||||
tracking=True,
|
tracking=True,
|
||||||
help="Whether this consumer group order includes home delivery service",
|
help="Whether this consumer group order includes home delivery service",
|
||||||
)
|
)
|
||||||
|
|
@ -256,11 +255,6 @@ class GroupOrder(models.Model):
|
||||||
else:
|
else:
|
||||||
record.display_image = False
|
record.display_image = False
|
||||||
|
|
||||||
@api.depends("delivery_product_id")
|
|
||||||
def _compute_home_delivery(self):
|
|
||||||
for record in self:
|
|
||||||
record.home_delivery = bool(record.delivery_product_id)
|
|
||||||
|
|
||||||
available_products_count = fields.Integer(
|
available_products_count = fields.Integer(
|
||||||
compute="_compute_available_products_count",
|
compute="_compute_available_products_count",
|
||||||
store=False,
|
store=False,
|
||||||
|
|
|
||||||
|
|
@ -61,8 +61,8 @@
|
||||||
<field name="period" help="How often this order repeats"/>
|
<field name="period" help="How often this order repeats"/>
|
||||||
<field name="pickup_day" help="Day when members pick up orders"/>
|
<field name="pickup_day" help="Day when members pick up orders"/>
|
||||||
<field name="cutoff_day" help="Day when purchases stop"/>
|
<field name="cutoff_day" help="Day when purchases stop"/>
|
||||||
<field name="home_delivery" readonly="1" help="Automatically enabled when a delivery product is configured"/>
|
<field name="home_delivery" help="Enable home delivery option for this order"/>
|
||||||
<field name="delivery_product_id" help="Product to use for home delivery. Setting this enables home delivery."/>
|
<field name="delivery_product_id" invisible="not home_delivery" required="home_delivery" help="Product to use for home delivery"/>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
<group string="Calculated Dates" name="calculated_dates">
|
<group string="Calculated Dates" name="calculated_dates">
|
||||||
|
|
|
||||||
|
|
@ -129,10 +129,14 @@
|
||||||
<span class="meta-value">
|
<span class="meta-value">
|
||||||
<t t-foreach="order.pickup_slot_ids" t-as="slot">
|
<t t-foreach="order.pickup_slot_ids" t-as="slot">
|
||||||
<div class="slot-entry">
|
<div class="slot-entry">
|
||||||
|
<t t-if="slot.label">
|
||||||
|
<t t-esc="slot.label" />
|
||||||
|
</t>
|
||||||
|
<t t-else="">
|
||||||
<t t-esc="day_names[int(slot.weekday) % 7]" />
|
<t t-esc="day_names[int(slot.weekday) % 7]" />
|
||||||
 
|
 
|
||||||
<t t-esc="('%02d:%02d–%02d:%02d' % (int(slot.start_hour or 0), int(((slot.start_hour or 0) % 1) * 60), int(slot.end_hour or 0), int(((slot.end_hour or 0) % 1) * 60)))" />
|
<t t-esc="('%02d:%02d-%02d:%02d' % (int(slot.start_hour or 0), int(((slot.start_hour or 0) % 1) * 60), int(slot.end_hour or 0), int(((slot.end_hour or 0) % 1) * 60)))" />
|
||||||
<t t-if="slot.label"> (<t t-esc="slot.label" />)</t>
|
</t>
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -212,10 +216,14 @@
|
||||||
<span class="info-value">
|
<span class="info-value">
|
||||||
<t t-foreach="group_order.pickup_slot_ids" t-as="slot">
|
<t t-foreach="group_order.pickup_slot_ids" t-as="slot">
|
||||||
<div>
|
<div>
|
||||||
|
<t t-if="slot.label">
|
||||||
|
<t t-esc="slot.label" />
|
||||||
|
</t>
|
||||||
|
<t t-else="">
|
||||||
<t t-esc="day_names[int(slot.weekday) % 7]" />
|
<t t-esc="day_names[int(slot.weekday) % 7]" />
|
||||||
 
|
 
|
||||||
<t t-esc="('%02d:%02d–%02d:%02d' % (int(slot.start_hour or 0), int(((slot.start_hour or 0) % 1) * 60), int(slot.end_hour or 0), int(((slot.end_hour or 0) % 1) * 60)))" />
|
<t t-esc="('%02d:%02d-%02d:%02d' % (int(slot.start_hour or 0), int(((slot.start_hour or 0) % 1) * 60), int(slot.end_hour or 0), int(((slot.end_hour or 0) % 1) * 60)))" />
|
||||||
<t t-if="slot.label"> (<t t-esc="slot.label" />)</t>
|
</t>
|
||||||
</div>
|
</div>
|
||||||
</t>
|
</t>
|
||||||
</span>
|
</span>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue