Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

12.0 polln #275

Open
wants to merge 31 commits into
base: 12.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
be3b007
[FIX] beesdoo_shift: dynamic selection field
tfrancoi Jul 19, 2020
ad374d3
[CLEAN] Remove beesdoo_base dependency
tfrancoi Dec 29, 2020
9a03392
[FIX] beesdoo_product: do not raise in compute
tfrancoi Dec 29, 2020
9748e5a
[ADD] beesdoo_product: add label report
tfrancoi Dec 29, 2020
5ac77b5
[MIG] Migrate receipt sent by email
tfrancoi Jan 17, 2021
59289b7
[TYPO] beesdoo_pos: err -> error
tfrancoi Jan 24, 2021
de86038
Unit price on ticket
tfrancoi Mar 21, 2021
6ce287f
[FIX] beesdoo_shift: dynamic selection field
tfrancoi Jul 19, 2020
128ef94
[FIX] beesdoo_worker_status, import api
odoo-pda Aug 21, 2021
0aac4cb
[ADD] polln_base, card members report.
odoo-pda Aug 21, 2021
50f9a7f
[ADD] beesdoo_shift_welcome_screen on 12.0
odoo-pda Aug 21, 2021
951cc26
[ADD] polln_shift: add new module polln shift
tfrancoi Sep 2, 2021
5138708
[IMP] polln_base: improve layout polln card
tfrancoi Sep 4, 2021
547a3a5
[FIX] polln_base: new log for polln card
tfrancoi Sep 5, 2021
2467f1e
[IMP] poll_shift: various UI improvement + Label
tfrancoi Sep 8, 2021
bc1c9c8
[FIX] beesdoo_product: finally fix total_with_vat with consignes
tfrancoi Sep 16, 2021
f827ea1
[ADD] beesdoo_product: vertical label
tfrancoi Sep 16, 2021
3bc7f19
[IMP] create user at subscription + set super coop on shift + force w…
tfrancoi Sep 23, 2021
61fd134
[IMP] beesdoo_base: need to print card for new eaters
tfrancoi Sep 25, 2021
78a41f9
[ADD] welcome_screen; eater see worker info + next shift
tfrancoi Sep 25, 2021
f894f1b
[FIX] remove confusin field + fix access right issue
tfrancoi Sep 30, 2021
8b88aae
[FIX] display weight decimal configurable + error of wizard subscribe
tfrancoi Sep 30, 2021
244770b
[FIX] counter reset at each update + status computation
tfrancoi Nov 3, 2021
4d619c1
[IMP]
tfrancoi Nov 21, 2021
ceeef4e
[IMP] beesdoo_pos_email_ticket: improve layout of ticket sentby email
tfrancoi Feb 19, 2022
f62ad0e
[IMP] beesdoo_product: suggested price rounding can be configure on p…
tfrancoi Feb 19, 2022
9e5dea9
[IMP] beesdoo_shift: add constraint on time of the shift + fix durati…
tfrancoi Feb 19, 2022
632bee2
[IMP] beesdoo_shift_welcome_screen: improve layout
tfrancoi Feb 19, 2022
d9c0829
[IMP] polln_shift: remove constraint on shift status, show shifts on …
tfrancoi Feb 19, 2022
199f5a9
[FIX] polln_shift: various fix
tfrancoi Feb 19, 2022
2207844
[WIP]
tfrancoi Feb 24, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion beesdoo_base/models/partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,11 @@ def _new_eater(self, surname, name, email):
partner_data = {
"lastname": name,
"firstname": surname,
"is_customer": True,
"customer": True,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"eater": "eater",
"parent_eater_id": self.id,
"email": email,
"country_id": self.country_id.id,
"member_card_to_be_printed": True,
}
return self.env["res.partner"].create(partner_data)
19 changes: 12 additions & 7 deletions beesdoo_base/views/partner.xml
Original file line number Diff line number Diff line change
Expand Up @@ -41,18 +41,22 @@
<group
attrs="{'invisible': ['|', ('customer', '=', False), ('eater', '!=', 'worker_eater')]}"
>
<separator string="Eaters" />
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done in #284

<field
name="child_eater_ids"
widget="many2many_tags"
options="{'no_create': True}"
context="{'default_eater' : 'eater', 'default_customer' : True}"
/>
<group>
<field
name="child_eater_ids"
string="Eaters"
widget="many2many_tags"
options="{'no_create': True}"
context="{'default_eater' : 'eater', 'default_customer' : True}"
/>
</group>
<group>
<button
string="New Eater"
name="%(action_eater_wizard)d"
type="action"
class="btn btn-primary"

/>
</group>
<separator string="Cards" />
Expand All @@ -71,6 +75,7 @@
string="New Card"
name="%(action_membercard_wizard)d"
type="action"
class="btn btn-primary"
/>
</group>
</group>
Expand Down
15 changes: 9 additions & 6 deletions beesdoo_easy_my_coop/models/res_partner.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def _cooperator_share_type(self):
Return the share.type that correspond to the cooperator_type.
"""
self.ensure_one()
share_type = None
share_type = self.env['product.template']
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if self.cooperator_type:
share_type = (
self.env["product.template"].search(
Expand All @@ -38,6 +38,7 @@ def _cooperator_share_type(self):
"share_ids.share_product_id.default_code",
"share_ids.share_product_id.allow_working",
"share_ids.share_number",
"worker_store",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

)
def _compute_is_worker(self):
"""
Expand All @@ -47,19 +48,21 @@ def _compute_is_worker(self):
for rec in self:
share_type = rec._cooperator_share_type()
if share_type:
rec.is_worker = share_type.allow_working
is_worker = share_type.allow_working
else:
rec.is_worker = False
is_worker = False
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rec.is_worker = is_worker or rec.worker_store

def _search_worker(self, operator, value):
lines = self.env["share.line"].search(
[("share_product_id.allow_working", "=", "True")]
)
partner_ids = lines.mapped("partner_id").ids
partner_ids = lines.mapped("partner_id")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

partner_ids |= self.search([('worker_store', '=', True)])
if (operator, value) in [("=", True), ("!=", False)]:
return [("id", "in", partner_ids)]
return [("id", "in", partner_ids.ids)]
else:
return [("id", "not in", partner_ids)]
return [("id", "not in", partner_ids.ids)]

@api.depends(
"cooperative_status_ids",
Expand Down
2 changes: 1 addition & 1 deletion beesdoo_pos/static/src/js/beesdoo.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ odoo.define("beesdoo_pos.screens", function(require) {
);
})
.fail(function(type, error) {
loaded.reject(err);
loaded.reject(error);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done #278

});
},

Expand Down
1 change: 1 addition & 0 deletions beesdoo_pos_email_ticket/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #277

28 changes: 28 additions & 0 deletions beesdoo_pos_email_ticket/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2017 - 2020 BEES coop SCRLfs
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #277

# - Elouan Lebars <[email protected]>
# - Rémy Taymans <[email protected]>
# - Vincent Van Rossem <[email protected]>
# - Elise Dupont
# - Thibault François
# - Grégoire Leeuwerck
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
{
"name": "Beescoop Send POS ticket by email",
"summary": """This module adds the eaters of the customer to the POS
ActionpadWidget and PaymentScreenWidget.""",
"author": "Beescoop - Cellule IT, Coop IT Easy SCRLfs",
"website": "https://github.com/beescoop/Obeesdoo",
"category": "Point Of Sale",
"version": "12.0.1.1.0",
"depends": ["point_of_sale"],
"data": [
"views/beesdoo_pos.xml",
"data/cron.xml",
"data/email.xml",
],
"qweb": [
"static/src/xml/templates.xml"
],
"installable": True,
"license": "AGPL-3",
}
14 changes: 14 additions & 0 deletions beesdoo_pos_email_ticket/data/cron.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<odoo>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #277

<record id="ir_cron_sent_pos_ticket" model="ir.cron">
<field name="name">send ticket</field>
<field name="model_id" ref="point_of_sale.model_pos_order" />
<field name="state">code</field>
<field name="code">model._send_order_cron()</field>
<field name="interval_number">1</field>
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>
<field name="active" eval="True"/>
<field name="numbercall">-1</field>
<field name="doall" eval="False" />
</record>
</odoo>
183 changes: 183 additions & 0 deletions beesdoo_pos_email_ticket/data/email.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,183 @@

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done in #277

<odoo>
<data noupdate="1">
<record id="paperformat_posreceipt" model="report.paperformat">
<field name="name">Point Of Sale Receipt</field>
<field name="default" eval="True"/>
<field name="format">custom</field>
<field name="page_height">150</field>
<field name="page_width">65</field>
<field name="orientation">Portrait</field>
<field name="margin_top">3</field>
<field name="margin_bottom">3</field>
<field name="margin_left">3</field>
<field name="margin_right">3</field>
<field name="header_line" eval="False" />
<field name="header_spacing">3</field>
<field name="dpi">140</field>
</record>
<!-- TODO tare hasattr-->
<template id="report_receipt">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-set="unit" t-value="o.env.ref('uom.product_uom_unit')" />
<t t-set="taxes" t-value="[t for t in o._get_taxes_amount() if 'Consigne' not in t['name']]" />
<t t-set="consignes" t-value="[t for t in o._get_taxes_amount() if 'Consigne' in t['name']]" />
<div class="page">
<div class="row">
<div class="col-xs-12 text-center">
<h2 t-esc="o.user_id.company_id.name"/>
Customer: <span t-field="o.partner_id"/><br/><br/>
Cashier: <span t-field="o.user_id"/><br/>
Date: <span t-field="o.date_order"/><br/>
</div>
</div>

<div class="row">
<br/>
</div>

<table class="table table-condensed">
<thead>
<tr>
<th class="text-left">Product</th>
<th class="text-right">Total</th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.lines" t-as="line">
<td class="text-left">
<span t-field="line.product_id"/>
<t t-if="line.discount != 0.0 or line.qty != 1 or line.product_id.uom_id != unit">
<br />
</t>
<t t-if="o.state != 'cancel' and (o.statement_ids and line.qty != 1 or line.product_id.uom_id != unit or line.discount != 0.0)">
<span style="margin-left:10px"> <span t-field="line.qty"/> *
<span t-field="line.price_unit"/>
<t t-if="line.product_id.uom_id != unit">
/ <span t-field="line.product_id.uom_id.name"/>
</t>
</span>
</t>
<t t-if="line.discount != 0.0">
<span style="margin-left:10px">-<span t-esc="line.discount"/>%</span>
</t>
</td>
<td class="text-right">
<t t-if="o.state != 'cancel' and o.statement_ids">
<span t-esc="line.qty*line.price_unit * (1 - (line.discount / 100))" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.company_id.currency_id}"/>
</t>
</td>
</tr>
</tbody>
</table>
<div class="row" t-if="consignes">
<div class="col-xs-12 pull-right">
<h4>Consignes</h4>
<table class="table table-condensed">
<tr t-foreach="consignes" t-as="t">
<td style="width:60%">
<t t-esc="t['name']"/>
</td>
<td class="text-right" style="width:30%">
<strong t-esc="t['amount']" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.company_id.currency_id}"/>
</td>
</tr>
</table>
</div>
</div>
<div class="row">
<br/>
</div>
<div class="row">
<br/>
</div>
<div class="row">
<div class="col-xs-12 pull-right">
<table class="table table-condensed">
<tr>
<td><strong>Total</strong></td>
<td class="text-right">
<strong t-esc="o.amount_total" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.company_id.currency_id}"/>
</td>
</tr>
</table>
</div>
</div>
<div class="row">
<br/>
</div>
<div class="row">
<div class="col-xs-12 pull-right">
<h4>Taxes</h4>
<table class="table table-condensed">
<tr t-foreach="taxes" t-as="t">
<td style="width:60%"><t t-esc="t['name']"/></td>
<td class="text-right" style="width:30%">
<strong t-esc="t['amount']" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.company_id.currency_id}"/>
</td>
</tr>
</table>
</div>
</div>
<div class="row">
<br/>
</div>
<table class="table table-condensed">
<thead>
<tr>
<th>Payment Mode</th>
<th>Amount</th>
</tr>
</thead>
<tbody>
<tr t-foreach="o.statement_ids.filtered(lambda x: x.amount &gt; 0)" t-as="st">
<td>
<span t-esc="st.journal_id.name"/>
</td>
<td>
<span t-esc="st.amount" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.company_id.currency_id}"/>
</td>
</tr>
<tr t-foreach="o.statement_ids.filtered(lambda x: x.amount &lt; 0)" t-as="st">
<td>
Change
</td>
<td>
<span t-esc="-st.amount" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.company_id.currency_id}"/>
</td>
</tr>
</tbody>
</table>
</div>
</t>
</t>
</template>

<report
id="action_report_pos_receipt"
string="Receipt"
model="pos.order"
report_type="qweb-pdf"
name="beesdoo_pos_email_ticket.report_receipt"
file="beesdoo_pos_email_ticket.report_receipt"
paperformat="paperformat_posreceipt"
/>
<!--Email template -->
<record id="email_send_ticket" model="mail.template">
<field name="name">Envoyer Reçu</field>
<field name="email_from">${(object.user_id.email and '%s &lt;%s&gt;' % (object.user_id.name, object.user_id.email) or '')|safe}</field>
<field name="subject">${object.pos_reference}</field>
<field name="partner_to">${object.partner_id.id}</field>
<field name="model_id" ref="point_of_sale.model_pos_order" />
<field name="auto_delete" eval="True" />
<field name="report_template" ref="action_report_pos_receipt" />
<field name="report_name">Ticket ${object.pos_reference}</field>
<field name="lang">${object.partner_id.lang}</field>
<field name="body_html"><![CDATA[
Votre Ticket ${object.pos_reference}
]]></field>
</record>

</data>
</odoo>
Loading