-
Notifications
You must be signed in to change notification settings - Fork 41
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
base: 12.0
Are you sure you want to change the base?
12.0 polln #275
Changes from all commits
be3b007
ad374d3
9a03392
9748e5a
5ac77b5
59289b7
de86038
6ce287f
128ef94
0aac4cb
50f9a7f
951cc26
5138708
547a3a5
2467f1e
bc1c9c8
f827ea1
3bc7f19
61fd134
78a41f9
f894f1b
8b88aae
244770b
4d619c1
ceeef4e
f62ad0e
9e5dea9
632bee2
d9c0829
199f5a9
2207844
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -41,18 +41,22 @@ | |
<group | ||
attrs="{'invisible': ['|', ('customer', '=', False), ('eater', '!=', 'worker_eater')]}" | ||
> | ||
<separator string="Eaters" /> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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" /> | ||
|
@@ -71,6 +75,7 @@ | |
string="New Card" | ||
name="%(action_membercard_wizard)d" | ||
type="action" | ||
class="btn btn-primary" | ||
/> | ||
</group> | ||
</group> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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'] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
if self.cooperator_type: | ||
share_type = ( | ||
self.env["product.template"].search( | ||
|
@@ -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", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
) | ||
def _compute_is_worker(self): | ||
""" | ||
|
@@ -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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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", | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -111,7 +111,7 @@ odoo.define("beesdoo_pos.screens", function(require) { | |
); | ||
}) | ||
.fail(function(type, error) { | ||
loaded.reject(err); | ||
loaded.reject(error); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done #278 |
||
}); | ||
}, | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
from . import models | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done in #277 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# Copyright 2017 - 2020 BEES coop SCRLfs | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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", | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
<odoo> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,183 @@ | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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="{"widget": "monetary", "display_currency": 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="{"widget": "monetary", "display_currency": 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="{"widget": "monetary", "display_currency": 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="{"widget": "monetary", "display_currency": 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 > 0)" t-as="st"> | ||
<td> | ||
<span t-esc="st.journal_id.name"/> | ||
</td> | ||
<td> | ||
<span t-esc="st.amount" t-options="{"widget": "monetary", "display_currency": o.company_id.currency_id}"/> | ||
</td> | ||
</tr> | ||
<tr t-foreach="o.statement_ids.filtered(lambda x: x.amount < 0)" t-as="st"> | ||
<td> | ||
Change | ||
</td> | ||
<td> | ||
<span t-esc="-st.amount" t-options="{"widget": "monetary", "display_currency": 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 <%s>' % (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> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#285