Initial commit: Vertical Industry packages

This commit is contained in:
Ernad Husremovic 2025-08-29 15:20:52 +02:00
commit d5567a0017
766 changed files with 733028 additions and 0 deletions

View file

@ -0,0 +1,118 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="lunch_alert_view_search" model="ir.ui.view">
<field name="name">lunch.alert.search</field>
<field name="model">lunch.alert</field>
<field name="arch" type="xml">
<search string="Search">
<field name="message"/>
<filter name="inactive_today" string="Currently inactive" domain="[('available_today', '=', False)]"/>
<separator/>
<filter name="active" string="Active" domain="[('active', '=', True)]"/>
<filter name="inactive" string="Archived" domain="[('active', '=', False)]"/>
</search>
</field>
</record>
<record id="lunch_alert_view_tree" model="ir.ui.view">
<field name="name">lunch.alert.tree</field>
<field name="model">lunch.alert</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="mode"/>
<field name="message" invisible="1"/>
<field name="available_today"/>
<field name="active" widget="boolean_toggle"/>
</tree>
</field>
</record>
<record id="lunch_alert_view_form" model="ir.ui.view">
<field name="name">lunch.alert.form</field>
<field name="model">lunch.alert</field>
<field name="arch" type="xml">
<form string="alert form">
<sheet>
<div class="oe_title" name="title">
<label for="name"/>
<h1>
<field name="name" placeholder="e.g. Order before 11am"/>
</h1>
</div>
<group>
<group>
<field name="mode" widget="radio"/>
<field name="recipients" attrs="{'invisible': [['mode', '!=', 'chat']]}" widget="radio"/>
<field name="location_ids" widget="many2many_tags" required="1"/>
<field name="until"/>
<field name="active" widget="boolean_toggle"/>
</group>
<group>
<div class="o_td_label">
<label for="notification_time" attrs="{'invisible': [['mode', '!=', 'chat']]}"/>
</div>
<div class="o_col">
<widget name="week_days"/>
<div class="o_row" attrs="{'invisible': [['mode', '!=', 'chat']]}">
<field name="notification_time" attrs="{'required': [('mode', '=', 'chat')]}" widget="float_time"/>
<field name="notification_moment"/>
</div>
</div>
<field name="tz" groups="base.group_no_one"/>
</group>
<group>
<field name="message"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="lunch_alert_view_kanban" model="ir.ui.view">
<field name="name">lunch.alert.kanban</field>
<field name="model">lunch.alert</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_card oe_kanban_global_click">
<div class="oe_kanban_content">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title"><field name="name"/></strong>
<span><br/><field name="mode"/></span>
<span attrs="{'invisible':[['mode', '!=', 'chat']]}">
to <field name="recipients"/>
on <field name="notification_time"/>
<field name="notification_moment"/>
</span>
</div>
</div>
<div class="o_kanban_record_body">
<field name="location_ids" widget="many2many_tags"/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="lunch_alert_action" model="ir.actions.act_window">
<field name="name">Lunch Alerts</field>
<field name="res_model">lunch.alert</field>
<field name="search_view_id" ref="lunch_alert_view_search"/>
<field name="view_mode">tree,form,kanban</field>
<field name="domain">['|', ('active', '=', True), ('active', '=', False)]</field>
<field name="context">{}</field>
<field name="view_id" ref="lunch_alert_view_tree"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create new lunch alerts
</p>
</field>
</record>
</odoo>

View file

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="lunch_cashmove_view_search" model="ir.ui.view">
<field name='name'>lunch.cashmove.search</field>
<field name='model'>lunch.cashmove</field>
<field name='arch' type='xml'>
<search string="lunch employee payment">
<field name="description"/>
<field name="user_id"/>
<filter name='is_mine_group' string="My Account grouped" domain="[('user_id','=',uid)]" context="{'group_by':'user_id'}"/>
<filter name="group_by_user" string="By User" context="{'group_by':'user_id'}"/>
</search>
</field>
</record>
<record id="lunch_cashmove_view_tree" model="ir.ui.view">
<field name="name">lunch.cashmove.tree</field>
<field name="model">lunch.cashmove</field>
<field name="arch" type="xml">
<tree string="cashmove tree">
<field name="currency_id" invisible="1"/>
<field name="date"/>
<field name="user_id"/>
<field name="description"/>
<field name="amount" sum="Total" widget="monetary"/>
</tree>
</field>
</record>
<record id="lunch_cashmove_view_form" model="ir.ui.view">
<field name="name">lunch.cashmove.form</field>
<field name="model">lunch.cashmove</field>
<field name="arch" type="xml">
<form string="cashmove form">
<sheet>
<group>
<field name="currency_id" invisible="1"/>
<field name="user_id" required="1"/>
<field name="date"/>
<field name="amount" widget="monetary"/>
</group>
<label for='description'/>
<field name="description"/>
</sheet>
</form>
</field>
</record>
<record id="view_lunch_cashmove_kanban" model="ir.ui.view">
<field name="name">lunch.cashmove.kanban</field>
<field name="model">lunch.cashmove</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<field name="date"/>
<field name="user_id"/>
<field name="description"/>
<field name="amount"/>
<field name="currency_id" invisible="1"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click">
<div class="row mb4">
<div class="col-8">
<span>
<strong class="o_kanban_record_title"><t t-esc="record.description.value"/></strong>
</span>
</div>
<div class="col-4 text-end">
<span class="badge rounded-pill">
<strong><i class="fa fa-money" role="img" aria-label="Amount" title="Amount"/> <field name="amount" widget="monetary"/></strong>
</span>
</div>
</div>
<div class="row">
<div class="col-6">
<i class="fa fa-clock-o" role="img" aria-label="Date" title="Date"/>
<t t-esc="record.date.value"/>
</div>
<div class="col-6">
<div class="float-end">
<field name="user_id" widget="many2one_avatar_user"/>
</div>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="lunch_cashmove_action_payment" model="ir.actions.act_window">
<field name="name">Cash Moves</field>
<field name="res_model">lunch.cashmove</field>
<field name="view_mode">tree,kanban,form</field>
<field name="search_view_id" ref="lunch_cashmove_view_search"/>
<field name="view_id" ref="lunch_cashmove_view_tree"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Register a payment
</p><p>
Payments are used to register liquidity movements. You can process those payments by your own means or by using installed facilities.
</p>
</field>
</record>
</odoo>

View file

@ -0,0 +1,82 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="lunch_location_view_search" model="ir.ui.view">
<field name="name">lunch.location.view.search</field>
<field name="model">lunch.location</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<field name="address"/>
</search>
</field>
</record>
<record id="lunch_location_form_view" model="ir.ui.view">
<field name="name">lunch.location.view.form</field>
<field name="model">lunch.location</field>
<field name="arch" type="xml">
<form>
<sheet>
<group>
<group>
<field name="name"/>
<field name="address"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
</group>
</sheet>
</form>
</field>
</record>
<record id="lunch_location_tree_view" model="ir.ui.view">
<field name="name">lunch.location.view.form</field>
<field name="model">lunch.location</field>
<field name="arch" type="xml">
<tree editable="bottom">
<field name="name"/>
<field name="address"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record id="lunch_location_kanban_view" model="ir.ui.view">
<field name="name">lunch.location.view.kanban</field>
<field name="model">lunch.location</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_card oe_kanban_global_click">
<div class="oe_kanban_content">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title"><field name="name"/></strong>
</div>
</div>
<div class="o_kanban_record_body">
<field name="company_id" groups="base.group_multi_company"/><br/>
<field name="address"/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="lunch_location_action" model="ir.actions.act_window">
<field name="name">Lunch Locations</field>
<field name="res_model">lunch.location</field>
<field name="view_mode">tree,form,kanban</field>
<field name="search_view_id" ref="lunch_location_view_search"/>
<field name="help" type="html">
<!-- TODO: better help message -->
<p class="o_view_nocontent_smiling_face">
To see some locations, create one using the create button
</p>
</field>
</record>
</odoo>

View file

@ -0,0 +1,285 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="lunch_order_view_search" model="ir.ui.view">
<field name="name">lunch.order.search</field>
<field name="model">lunch.order</field>
<field name="arch" type="xml">
<search string="Search">
<field name="name" string="Product" filter_domain="['|', ('name', 'ilike', self), ('note', 'ilike', self)]"/>
<field name="user_id"/>
<filter name='is_mine' string="My Orders" domain="[('user_id', '=', uid)]"/>
<separator/>
<filter name="not_confirmed" string="Not Received" domain="[('state', '!=', ('confirmed'))]"/>
<filter name="confirmed" string="Received" domain="[('state', '=', 'confirmed')]"/>
<filter name="cancelled" string="Cancelled" domain="[('state', '=', 'cancelled')]"/>
<separator/>
<filter name="date_filter" string="Today" domain="[('date', '=', context_today().strftime('%Y-%m-%d'))]" />
<separator/>
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
<group expand="0" string="Group By">
<filter name="group_by_user" string="User" context="{'group_by': 'user_id'}"/>
<filter name="group_by_supplier" string="Vendor" context="{'group_by': 'supplier_id'}"/>
<filter name="group_by_date" string="Order Date" context="{'group_by': 'date:day'}" help="Vendor Orders by Date"/>
</group>
</search>
</field>
</record>
<record id="lunch_order_view_tree" model="ir.ui.view">
<field name="name">lunch.order.tree</field>
<field name="model">lunch.order</field>
<field name="arch" type="xml">
<tree string="Order lines Tree" create="false" edit="false" decoration-muted="state == 'cancelled'" class="o_lunch_list" expand="1">
<header>
<button name="action_confirm" type="object" string="Receive"/>
</header>
<field name='date'/>
<field name='supplier_id'/>
<field name='product_id'/>
<field name="display_toppings" class="o_text_overflow"/>
<field name='note' class="o_text_overflow"/>
<field name='user_id'/>
<field name="lunch_location_id"/>
<field name="currency_id" invisible="1"/>
<field name='price' sum="Total" string="Price" widget="monetary"/>
<field name='state' widget="badge" decoration-warning="state == 'new'" decoration-success="state == 'confirmed'" decoration-info="state == 'sent'" decoration-danger="state == 'ordered'"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="display_reorder_button" invisible="1"/>
<field name="notified" invisible="1"/>
<button name="action_reorder" string="Re-order" type="object" icon="fa-history" attrs="{'invisible': [('display_reorder_button', '=', False)]}" groups="lunch.group_lunch_user"/>
<button name="action_confirm" string="Confirm" type="object" icon="fa-check" attrs="{'invisible': [('state', '!=', 'sent')]}" groups="lunch.group_lunch_manager"/>
<button name="action_cancel" string="Cancel" type="object" icon="fa-times" attrs="{'invisible': [('state', 'in', ['cancelled', 'confirmed'])]}" groups="lunch.group_lunch_manager"/>
<button name="action_reset" string="Reset" type="object" icon="fa-undo" attrs="{'invisible': [('state', '!=', 'cancelled')]}" groups="lunch.group_lunch_manager"/>
<button name="action_notify" string="Send Notification" type="object" icon="fa-envelope" attrs="{'invisible': ['|', ('state', '!=', 'confirmed'), ('notified', '=', True)]}" groups="lunch.group_lunch_manager"/>
<groupby name="supplier_id">
<field name="show_order_button" invisible="1" />
<field name="show_confirm_button" invisible="1" />
<button string="Send Orders" type="object" name="action_send_orders" attrs="{'invisible': [('show_order_button', '=', False)]}"/>
<button string="Confirm Orders" type="object" name="action_confirm_orders" attrs="{'invisible': [('show_confirm_button', '=', False)]}"/>
</groupby>
</tree>
</field>
</record>
<record id='lunch_order_view_kanban' model='ir.ui.view'>
<field name="name">lunch.order.kanban</field>
<field name="model">lunch.order</field>
<field name="arch" type="xml">
<kanban create="false" edit="false">
<field name="product_id"/>
<field name="note"/>
<field name="state"/>
<field name="user_id"/>
<field name="date"/>
<field name="company_id"/>
<field name="currency_id"/>
<field name="notified"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title"><field name="product_id"/></strong>
</div>
<field name="state" widget="label_selection" options="{'classes': {'new': 'default', 'confirmed': 'success', 'cancelled':'danger'}}"/>
</div>
<div>
<field name="note"/>
</div>
<div class="row">
<div class="col-6">
<i class="fa fa-money" role="img" aria-label="Money" title="Money"/> <field name="price"/>
</div>
<div class="col-6 text-end">
<i class="fa fa-clock-o" role="img" aria-label="Date" title="Date"/> <field name="date"/>
</div>
</div>
<div class="row mt4">
<div class="col-6">
<a class="btn btn-sm btn-success" role="button" name="action_order" string="Order" type="object" attrs="{'invisible': [('state', 'in', ['sent', 'ordered', 'confirmed'])]}" groups="lunch.group_lunch_manager">
<i class="fa fa-phone" role="img" aria-label="Order button" title="Order button"/>
</a>
<a class="btn btn-sm btn-primary" role="button" name="action_send" string="Send" type="object" attrs="{'invisible': [('state', '!=', 'ordered')]}" groups="lunch.group_lunch_manager">
<i class="fa fa-paper-plane" role="img" aria-label="Send button" title="Send button"/>
</a>
<a class="btn btn-sm btn-info" role="button" name="action_confirm" string="Receive" type="object" attrs="{'invisible': [('state','!=','sent')]}" groups="lunch.group_lunch_manager">
<i class="fa fa-check" role="img" aria-label="Receive button" title="Receive button"/>
</a>
<a class="btn btn-sm btn-danger" role="button" name="action_cancel" string="Cancel" type="object" attrs="{'invisible': [('state','in', ['cancelled', 'confirmed'])]}" groups="lunch.group_lunch_manager">
<i class="fa fa-times" role="img" aria-label="Cancel button" title="Cancel button"/>
</a>
<a class="btn btn-sm btn-info" role="button" name="action_notify" string="Send Notification" type="object" attrs="{'invisible': ['|', ('state', '!=', 'confirmed'), ('notified', '=', True)]}" groups="lunch.group_lunch_manager">
<i class="fa fa-envelope" role="img" aria-label="Send notification" title="Send notification"/>
</a>
</div>
<div class="col-6">
<span class="float-end">
<field name="user_id" widget="many2one_avatar_user"/>
</span>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="lunch_order_view_pivot" model="ir.ui.view">
<field name="name">lunch.order.pivot</field>
<field name="model">lunch.order</field>
<field name="arch" type="xml">
<pivot sample="1">
<field name="date" type="col"/>
<field name="supplier_id" type="row"/>
</pivot>
</field>
</record>
<record id="lunch_order_view_graph" model="ir.ui.view">
<field name="name">lunch.order.graph</field>
<field name="model">lunch.order</field>
<field name="arch" type="xml">
<graph sample="1">
<field name="product_id"/>
</graph>
</field>
</record>
<record id="lunch_order_action" model="ir.actions.act_window">
<field name="name">My Orders</field>
<field name="res_model">lunch.order</field>
<field name="view_mode">tree,kanban,pivot</field>
<field name="search_view_id" ref="lunch_order_view_search"/>
<field name="context">{"search_default_is_mine":1, "search_default_group_by_date": 1, 'show_reorder_button': True}</field>
<field name="help" type="html">
<p class="o_view_nocontent_empty_folder">
No previous order found
</p><p>
There is no previous order recorded. Click on "My Lunch" and then create a new lunch order.
</p>
</field>
</record>
<record id="lunch_order_action_by_supplier" model="ir.actions.act_window">
<field name="name">Today's Orders</field>
<field name="res_model">lunch.order</field>
<field name="view_mode">tree,kanban</field>
<field name="search_view_id" ref="lunch_order_view_search"/>
<field name="context">{"search_default_group_by_supplier":1, "search_default_date_filter":1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_empty_folder">
Nothing to order today
</p><p>
Here you can see today's orders grouped by vendors.
</p>
</field>
</record>
<record id="lunch_order_action_control_suppliers" model="ir.actions.act_window">
<field name="name">Control Vendors</field>
<field name="res_model">lunch.order</field>
<field name="view_mode">tree,kanban,pivot</field>
<field name="search_view_id" ref="lunch_order_view_search"/>
<field name="context">{"search_default_group_by_supplier":1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_empty_folder">
No lunch order yet
</p><p>
Summary of all lunch orders, grouped by vendor and by date.
</p><p>
Click on the <span class="fa fa-phone text-success" role="img" aria-label="Order button" title="Order button"/> to announce that the order is ordered.<br/>
Click on the <span class="fa fa-check text-success" role="img" aria-label="Receive button" title="Receive button"/> to announce that the order is received.<br/>
Click on the <span class="fa fa-times-circle text-danger" role="img" aria-label="Cancel button" title="Cancel button"/> red X to announce that the order isn't available.
</p>
</field>
</record>
<record id="lunch_order_view_form" model="ir.ui.view">
<field name="name">lunch.order.view.form</field>
<field name="model">lunch.order</field>
<field name="arch" type="xml">
<form class="flex-column">
<field name="company_id" invisible="1"/>
<field name="date" invisible="1"/>
<field name="currency_id" invisible="1"/>
<field name="quantity" invisible="1"/>
<field name="product_id" invisible="1"/>
<field name="state" invisible="1"/>
<field name="category_id" invisible="1"/>
<field name="available_toppings_1" invisible="1"/>
<field name="available_toppings_2" invisible="1"/>
<field name="available_toppings_3" invisible="1"/>
<field name="supplier_id" invisible="1"/>
<field name="order_deadline_passed" invisible="1"/>
<field name="available_today" invisible="1"/>
<div class="d-flex">
<div class="flex-grow-0 pe-5">
<field name="image_1920" widget="image" class="o_lunch_image" options="{'image_preview': 'image_128'}"/>
</div>
<div class="flex-grow-1 pe-5">
<h2><field name="name"/></h2>
<h3 class="pt-3"><field name="price"/></h3>
</div>
</div>
<div class="o_lunch_wizard">
<div class="row py-3 py-md-0">
<div class="o_td_label col-3 col-md-2">
<field name="topping_label_1" nolabel="1" attrs="{'invisible': [('available_toppings_1', '=', False)]}" class="o_form_label"/>
</div>
<div class="col-9 col-md-10">
<field name="topping_ids_1" attrs="{'invisible': [('available_toppings_1', '=', False)]}" widget="many2many_checkboxes" nolabel="1" domain="[('topping_category', '=', 1), ('supplier_id', '=', supplier_id)]" class="o_field_widget o_quick_editable"/>
</div>
</div>
<div class="row">
<div class="o_td_label col-3 col-md-2">
<field name="topping_label_2" nolabel="1" attrs="{'invisible': [('available_toppings_2', '=', False)]}" class="o_form_label"/>
</div>
<div class="col-9 col-md-10">
<field name="topping_ids_2" attrs="{'invisible': [('available_toppings_2', '=', False)]}" widget="many2many_checkboxes" nolabel="1" domain="[('topping_category', '=', 2), ('supplier_id', '=', supplier_id)]" class="o_field_widget o_quick_editable"/>
</div>
</div>
<div class="row">
<div class="o_td_label col-3 col-md-2">
<field name="topping_label_3" nolabel="1" attrs="{'invisible': [('available_toppings_3', '=', False)]}" class="o_form_label"/>
</div>
<div class="col-9 col-md-10">
<field name="topping_ids_3" attrs="{'invisible': [('available_toppings_3', '=', False)]}" widget="many2many_checkboxes" nolabel="1" domain="[('topping_category', '=', 3), ('supplier_id', '=', supplier_id)]" class="o_field_widget o_quick_editable"/>
</div>
</div>
<div class="row">
<div class="o_td_label col-3 col-md-2">
<label for="product_description" class="o_form_label"/>
</div>
<div class="col-9 col-md-10">
<field name="product_description" nolabel="1" class="o_field_widget o_quick_editable"/>
</div>
</div>
<div class="row">
<div class="o_td_label col-3 col-md-2">
<label for="note" class="o_form_label" />
</div>
<div class="col-9 col-md-10">
<field name="note" nolabel="1" placeholder="Information, allergens, ..." class="o_field_widget o_quick_editable"/>
</div>
</div>
<div class="row" attrs="{'invisible': [('order_deadline_passed', '=', False)]}">
<div class="col-12">
<div class="alert alert-warning" role="alert">
The orders for this vendor have already been sent.
</div>
</div>
</div>
</div>
<footer>
<button string="Save" special="save" data-hotkey="v" class="oe_highlight" invisible="not context.get('active_id', False)"/>
<button string="Add To Cart" name="add_to_cart" type="object" class="oe_highlight" invisible="context.get('active_id', False)" attrs="{'invisible': [('order_deadline_passed', '=', True)]}" data-hotkey="w"/>
<button string="Discard" special="cancel" data-hotkey="z"/>
</footer>
</form>
</field>
</record>
</odoo>

View file

@ -0,0 +1,342 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="lunch_product_view_search" model="ir.ui.view">
<field name="name">lunch.product.search</field>
<field name="model">lunch.product</field>
<field name="arch" type="xml">
<search string="Product Search">
<field name="name" string="Product"/>
<field name="category_id" string="Category"/>
<field name="supplier_id"/>
<field name="description"/>
<separator/>
<filter name="available_today" string="Available Today" domain="[('supplier_id.available_today', '=', True)]"/>
<separator/>
<filter name="available_on_mon" string="Monday" domain="[('supplier_id.mon', '=', True)]"/>
<filter name="available_on_tue" string="Tuesday" domain="[('supplier_id.tue', '=', True)]"/>
<filter name="available_on_wed" string="Wednesday" domain="[('supplier_id.wed', '=', True)]"/>
<filter name="available_on_thu" string="Thursday" domain="[('supplier_id.thu', '=', True)]"/>
<filter name="available_on_fri" string="Friday" domain="[('supplier_id.fri', '=', True)]"/>
<filter name="available_on_sat" string="Saturday" domain="[('supplier_id.sat', '=', True)]"/>
<filter name="available_on_sun" string="Sunday" domain="[('supplier_id.sun', '=', True)]"/>
<separator/>
<filter name="inactive" string="Archived" domain="[('active', '=', False)]"/>
<group expand="0" string="Group By">
<filter name="group_by_supplier" string="Vendor" context="{'group_by': 'supplier_id'}"/>
<filter name="group_by_category" string="Category" context="{'group_by': 'category_id'}"/>
</group>
<searchpanel>
<field name="category_id" select="multi" string="Categories" icon="fa-cutlery" color="#875A7B" enable_counters="1"/>
<field name="supplier_id" select="multi" string="Vendors" icon="fa-truck" enable_counters="1"/>
</searchpanel>
</search>
</field>
</record>
<record id="lunch_product_view_tree" model="ir.ui.view">
<field name="name">lunch.product.tree</field>
<field name="model">lunch.product</field>
<field name="arch" type="xml">
<tree string="Products Tree">
<field name="currency_id" invisible="1"/>
<field name="name"/>
<field name="category_id"/>
<field name="supplier_id"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="description"/>
<field name="price" widget="monetary"/>
</tree>
</field>
</record>
<record id="lunch_product_view_tree_order" model="ir.ui.view">
<field name="name">lunch.product.tree.order</field>
<field name="inherit_id" ref="lunch_product_view_tree"/>
<field name="model">lunch.product</field>
<field name="mode">primary</field>
<field name="arch" type="xml">
<xpath expr="//tree" position="attributes">
<attribute name="js_class">lunch_list</attribute>
<attribute name="create">0</attribute>
</xpath>
</field>
</record>
<record id="lunch_product_view_form" model="ir.ui.view">
<field name="name">lunch.product.form</field>
<field name="model">lunch.product</field>
<field name="arch" type="xml">
<form string="Products Form">
<field name="company_id" invisible="1"/>
<field name="currency_id" invisible="1"/>
<sheet>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<field name="image_1920" widget="image" class="oe_avatar" options="{'preview_image': 'image_128'}"/>
<div class="oe_title">
<label for="name" class="oe-edit-only"/>
<h1>
<field name='name'/>
</h1>
</div>
<group>
<group>
<field name="active" invisible="1"/>
<field name='category_id'/>
<field name='supplier_id'/>
<field name='price' widget="monetary"/>
</group>
<group>
<field name="new_until"/>
<field name="company_id" groups="base.group_multi_company"/>
</group>
<label for="description"/>
<field name='description'/>
</group>
</sheet>
</form>
</field>
</record>
<record id="view_lunch_product_kanban_order" model="ir.ui.view">
<field name="name">lunch.product.kanban</field>
<field name="model">lunch.product</field>
<field name="priority">999</field>
<field name="arch" type="xml">
<kanban js_class="lunch_kanban" create="0" edit="0" group_create="0" class="o_kanban_mobile">
<field name="id"/>
<field name="name"/>
<field name="category_id"/>
<field name="supplier_id"/>
<field name="description"/>
<field name="currency_id"/>
<field name="company_id"/>
<field name="is_new"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click o_kanban_record_has_image_fill">
<field name="image_128" class="o_lunch_image o_kanban_image_fill_left" options="{'placeholder': '/lunch/static/img/lunch.png', 'size': [94, 94]}" widget="image"/>
<div class="oe_kanban_details ml8">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title">
<div class="d-flex align-items-center justify-content-between">
<div>
<field class="pe-1" name="is_favorite" widget="boolean_favorite" nolabel="1"/>
<strong><span t-esc="record.name.value"/></strong>
</div>
<div class="text-odoo">
<div t-if="record.is_new.raw_value" class="o_lunch_new_product me-1 py-1 fs-6 badge rounded-pill text-bg-success">
New
</div>
<field name="price" widget="monetary"/>
</div>
</div>
</strong>
<span class="o_kanban_record_subtitle"><span t-esc="record.supplier_id.value"/></span>
</div>
</div>
<div class="o_kanban_record_bottom">
<ul>
<li t-out="record.description.value" class="text-muted"/>
</ul>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="view_lunch_product_kanban" model="ir.ui.view">
<field name="name">lunch.product.kanban</field>
<field name="model">lunch.product</field>
<field name="priority">5</field>
<field name="arch" type="xml">
<kanban create="1" edit="0" class="o_kanban_mobile">
<field name="id"/>
<field name="name"/>
<field name="category_id"/>
<field name="supplier_id"/>
<field name="description"/>
<field name="currency_id"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click o_kanban_record_has_image_fill">
<div class="o_kanban_image_fill_left d-none d-md-block"
t-attf-style="background-image:url('#{kanban_image('lunch.product', 'image_128', record.id.raw_value)}')"/>
<div class="oe_kanban_details">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<strong class="o_kanban_record_title">
<div>
<div class="float-end">
<field name="price" widget="monetary"/>
</div>
<strong><span t-esc="record.name.value"/></strong>
</div>
</strong>
<span class="o_kanban_record_subtitle"><span t-esc="record.supplier_id.value"/></span>
</div>
</div>
<div class="o_kanban_record_bottom">
<ul>
<li t-out="record.description.value" class="text-muted"/>
</ul>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="lunch_product_action_statbutton" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="res_model">lunch.product</field>
<field name="view_mode">kanban,tree,form</field>
<field name="context">{'search_default_group_by_supplier': 1}</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new product for lunch
</p><p>
A product is defined by its name, category, price and vendor.
</p>
</field>
</record>
<record id="lunch_product_category_view_tree" model="ir.ui.view">
<field name="name">Product category Tree</field>
<field name="model">lunch.product.category</field>
<field name="arch" type="xml">
<tree string="Products List">
<field name='name' string="Product Category"/>
<field name="company_id" groups="base.group_multi_company"/>
</tree>
</field>
</record>
<record id="lunch_product_category_view_form" model="ir.ui.view">
<field name="name">Product category Form</field>
<field name="model">lunch.product.category</field>
<field name="arch" type="xml">
<form string="Product Categories Form">
<sheet>
<div class="oe_button_box" name="button_box">
<button class="oe_stat_button" type="action" name="%(lunch.lunch_product_action_statbutton)d"
context="{'search_default_category_id': active_id,'default_category_id': active_id}"
attrs="{'invisible': [('product_count', '=', 0)]}"
icon="fa-cutlery">
<field string="Products" name="product_count" widget="statinfo"/>
</button>
</div>
<field name="image_1920" widget="image" class="oe_avatar" options="{'preview_image': 'image_128'}"/>
<div class="oe_title">
<label for="name" class="oe-edit-only"/>
<h1>
<field name="name"/>
</h1>
</div>
<label for="company_id" groups="base.group_multi_company"/>
<field name="company_id" groups="base.group_multi_company"/>
</sheet>
</form>
</field>
</record>
<record id="lunch_product_category_view_kanban" model="ir.ui.view">
<field name="name">Product category Kanban</field>
<field name="model">lunch.product.category</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<field name="id"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click o_kanban_record_has_image_fill o_kanban_record">
<div class="o_kanban_image_fill_left d-none d-md-block"
t-attf-style="background-image:url('#{kanban_image('lunch.product.category', 'image_128', record.id.raw_value)}')"/>
<div class="oe_kanban_details">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
<div class="float-end">
<button class="badge text-bg-primary" type="action"
name="%(lunch.lunch_product_action_statbutton)d"
context="{'search_default_category_id': active_id,'default_category_id': active_id}"
attrs="{'invisible': [('product_count', '=', 0)]}">
<field string="Products" name="product_count" widget="statinfo"/>
</button>
</div>
</div>
</div>
<div class="o_kanban_record_body">
<strong><field name="name"/></strong><br/>
<field name="company_id" groups="base.group_multi_company"/>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="lunch_product_category_view_search" model="ir.ui.view">
<field name="name">lunch.product.category.search</field>
<field name="model">lunch.product.category</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
</search>
</field>
</record>
<record id="lunch_product_action" model="ir.actions.act_window">
<field name="name">Products</field>
<field name="res_model">lunch.product</field>
<field name="view_mode">tree,kanban,form</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new product for lunch
</p><p>
A product is defined by its name, category, price and vendor.
</p>
</field>
</record>
<record id="lunch_product_action_order" model="ir.actions.act_window">
<field name="name">Order Your Lunch</field>
<field name="res_model">lunch.product</field>
<field name="view_mode">kanban,tree</field>
<field name="view_ids" eval="[
(5, 0, 0),
(0, 0, {'view_mode': 'kanban', 'view_id': ref('view_lunch_product_kanban_order')}),
(0, 0, {'view_mode': 'tree', 'view_id': ref('lunch_product_view_tree_order')})
]"/>
<field name="search_view_id" ref="lunch_product_view_search"/>
<field name="context">{'search_default_available_today': 1}</field>
<field name="domain">[]</field>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
There is no product available today
</p><p>
To see some products, check if your vendors are available today and that you have configured some products
</p>
</field>
</record>
<record id="lunch_product_category_action" model="ir.actions.act_window">
<field name="name">Product Categories</field>
<field name="res_model">lunch.product.category</field>
<field name="view_mode">tree,form,kanban</field>
<field name="search_view_id" ref="lunch_product_category_view_search"/>
<field name="help" type="html">
<p class="o_view_nocontent_smiling_face">
Create a new product category
</p><p>
Here you can access all categories for the lunch products.
</p>
</field>
</record>
</odoo>

View file

@ -0,0 +1,164 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="lunch_supplier_view_tree" model="ir.ui.view">
<field name="name">lunch.supplier.view.tree</field>
<field name="model">lunch.supplier</field>
<field name="arch" type="xml">
<tree>
<field name="name"/>
<field name="phone" class="o_force_ltr"/>
<field name="email"/>
</tree>
</field>
</record>
<record id="lunch_supplier_view_form" model="ir.ui.view">
<field name="name">lunch.supplier.view.form</field>
<field name="model">lunch.supplier</field>
<field name="arch" type="xml">
<form>
<sheet>
<widget name="web_ribbon" title="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<div class="oe_title">
<label for="name" string="Vendor"/>
<h1><field name="name" required="1" placeholder="e.g. The Pizzeria Inn"/></h1>
</div>
<group>
<group>
<field name="partner_id" context="{'default_is_company': True, 'default_city': city, 'default_name': name, 'default_street': street, 'default_street2': street2, 'default_state_id': state_id, 'default_zip': zip_code, 'default_country_id': country_id, 'default_phone': phone}"/>
<label for="street" string="Address"/>
<div class="o_address_format">
<field name="street" placeholder="Street..." class="o_address_street"/>
<field name="street2" placeholder="Street 2..." class="o_address_street"/>
<field name="city" placeholder="City" class="o_address_city"/>
<field name="state_id" class="o_address_state" placeholder="State" options="{'no_open': True}" context="{'country_id': country_id, 'zip': zip_code}"/>
<field name="zip_code" placeholder="ZIP" class="o_address_zip"/>
<field name="country_id" placeholder="Country" class="o_address_country" options="{'no_open': True, 'no_create': True}"/>
</div>
</group>
<group>
<field name="active" invisible="1"/>
<field name="email" attrs="{'required': [('send_by', '=', 'mail')]}"/>
<field name="phone" class="o_force_ltr" attrs="{'required': [('send_by', '=', 'phone')]}"/>
<field name="company_id" groups="base.group_multi_company"/>
<field name="responsible_id" attrs="{'required': [('send_by', '=', 'mail')]}" groups="base.group_no_one" domain="[('share', '=', False)]"/>
</group>
</group>
<group>
<group string="Availability">
<field name="tz" groups="base.group_no_one"/>
<label for="sun" class="d-none"/>
<field name="sun" invisible="1"/>
<widget name="week_days"/>
<field name="recurrency_end_date" groups="base.group_no_one"/>
</group>
<group string="Orders">
<field name="delivery"/>
<field name="available_location_ids" widget="many2many_tags"/>
<field name="send_by" widget="radio"/>
<label for="automatic_email_time" attrs="{'invisible': [('send_by', '!=', 'mail')]}"/>
<div class="o_row" attrs="{'invisible': [('send_by', '!=', 'mail')]}"><field name="automatic_email_time" widget="float_time"/> <field name="moment"/></div>
</group>
</group>
<group>
<group>
<field name="active" invisible="1"/>
<field name="topping_label_1"/>
<field name="topping_quantity_1" class="w-50"/>
</group>
<div>
<field name="topping_ids_1" nolabel="1">
<tree editable="bottom">
<field name="name"/>
<field name="company_id" invisible="1"/>
<field name="currency_id" invisible="1"/>
<field name="price" widget="monetary"/>
</tree>
</field>
</div>
<group>
<field name="topping_label_2"/>
<field name="topping_quantity_2" class="w-50"/>
</group>
<div>
<field name="topping_ids_2" nolabel="1">
<tree editable="bottom">
<field name="name"/>
<field name="company_id" invisible="1"/>
<field name="currency_id" invisible="1"/>
<field name="price" widget="monetary"/>
</tree>
</field>
</div>
<group>
<field name="topping_label_3"/>
<field name="topping_quantity_3" class="w-50"/>
</group>
<div>
<field name="topping_ids_3" nolabel="1">
<tree editable="bottom">
<field name="name"/>
<field name="company_id" invisible="1"/>
<field name="currency_id" invisible="1"/>
<field name="price" widget="monetary"/>
</tree>
</field>
</div>
</group>
</sheet>
<div class="oe_chatter">
<field name="message_follower_ids" groups="base.group_user"/>
<field name="activity_ids"/>
<field name="message_ids"/>
</div>
</form>
</field>
</record>
<record id="lunch_supplier_view_kanban" model="ir.ui.view">
<field name="name">lunch.supplier.view.kanban</field>
<field name="model">lunch.supplier</field>
<field name="arch" type="xml">
<kanban>
<field name="partner_id"/>
<field name="city"/>
<field name="country_id"/>
<field name="email"/>
<templates>
<t t-name="kanban-box">
<div class="oe_kanban_global_click o_kanban_record_has_image_fill o_res_partner_kanban">
<div class="oe_kanban_details">
<strong class="o_kanban_record_title oe_partner_heading"><field name="display_name"/></strong>
<ul>
<li t-if="record.city.raw_value and !record.country_id.raw_value"><field name="city"/></li>
<li t-if="!record.city.raw_value and record.country_id.raw_value"><field name="country_id"/></li>
<li t-if="record.city.raw_value and record.country_id.raw_value"><field name="city"/>, <field name="country_id"/></li>
<li t-if="record.email.raw_value" class="o_text_overflow"><field name="email"/></li>
</ul>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="lunch_supplier_view_search" model="ir.ui.view">
<field name="name">lunch.supplier.view.search</field>
<field name="model">lunch.supplier</field>
<field name="arch" type="xml">
<search>
<field name="name"/>
<separator/>
<filter string="Archived" name="inactive" domain="[('active', '=', False)]"/>
</search>
</field>
</record>
<record id="lunch_vendors_action" model="ir.actions.act_window">
<field name="name">Vendors</field>
<field name="res_model">lunch.supplier</field>
<field name="view_mode">kanban,tree,form</field>
<field name="search_view_id" ref="lunch_supplier_view_search"/>
</record>
</odoo>

View file

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="lunch_payment_dialog" name="Lunch Payment Dialog">
To add some money to your wallet, please contact your lunch manager.
</template>
</odoo>

View file

@ -0,0 +1,25 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<!-- Top menu item -->
<menuitem id='menu_lunch' name='Lunch' sequence="235" groups="group_lunch_user" web_icon="lunch,static/description/icon.svg">
<menuitem name="My Lunch" id="menu_lunch_title" sequence="50">
<menuitem name="New Order" id="lunch_order_menu_form" action="lunch.lunch_product_action_order" sequence="1"/>
<menuitem name="My Order History" id="lunch_order_menu_tree" action="lunch_order_action" sequence="2"/>
<menuitem name="My Account History" id="lunch_cashmove_report_menu_form" action="lunch_cashmove_report_action_account" sequence="3"/>
</menuitem>
<menuitem name="Manager" id="menu_lunch_admin" sequence="51" groups="group_lunch_manager">
<menuitem name="Today's Orders" id="lunch_order_menu_by_supplier" action="lunch_order_action_by_supplier" />
<menuitem name="Control Vendors" id="lunch_order_menu_control_suppliers" action="lunch_order_action_control_suppliers" />
<menuitem name="Control Accounts" id="lunch_cashmove_report_menu_control_accounts" action="lunch_cashmove_report_action_control_accounts"/>
<menuitem name="Cash Moves" id="lunch_cashmove_report_menu_payment" action="lunch_cashmove_action_payment"/>
</menuitem>
<menuitem name="Configuration" id="menu_lunch_config" sequence="53" groups="group_lunch_manager">
<menuitem name="Settings" id="lunch_settings_menu" action="lunch_config_settings_action" sequence="1"/>
<menuitem name="Vendors" id="lunch_vendors_menu" action="lunch_vendors_action" sequence="2"/>
<menuitem name="Locations" id="lunch_location_menu" action="lunch_location_action" sequence="3"/>
<menuitem name="Products" id="lunch_product_menu" action="lunch_product_action" sequence="4"/>
<menuitem name="Product Categories" id="lunch_product_category_menu" action="lunch_product_category_action" sequence="5"/>
<menuitem name="Alerts" id="lunch_alert_menu" action="lunch_alert_action" sequence="6"/>
</menuitem>
</menuitem>
</odoo>

View file

@ -0,0 +1,61 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field name="name">res.config.settings.view.form.inherit.lunch</field>
<field name="model">res.config.settings</field>
<field name="priority" eval="90"/>
<field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml">
<xpath expr="//div[hasclass('settings')]" position="inside">
<div class="app_settings_block" data-string="Lunch" string="Lunch" data-key="lunch" groups="lunch.group_lunch_manager">
<field name="currency_id" invisible="1"/>
<h2>Lunch</h2>
<div class="row mt16 o_settings_container" name="lunch_overdraft_setting_container">
<div class="col-12 col-lg-6 o_setting_box" id="lunch_minimum_threshold"
title="None">
<div class="o_setting_right_pane">
<span class="o_form_label">Lunch Overdraft</span>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." aria-label="Values set here are company-specific." groups="base.group_multi_company" role="img"/>
<div class="text-muted">
Maximum overdraft that your employees can reach
</div>
<div class="content-group">
<div class="mt16 row">
<label for="company_lunch_minimum_threshold" string="Overdraft" class="col-3 col-lg-3 o_light_label"/>
<field name="company_lunch_minimum_threshold" widget="monetary"/>
</div>
</div>
</div>
</div>
</div>
<div class="row mt16 o_settings_container" name="lunch_notification_setting_container">
<div class="col-12 col-lg-6 o_setting_box" id="lunch_notification">
<div class="o_setting_right_pane">
<span class="o_form_label">Reception notification</span>
<span class="fa fa-lg fa-building-o" title="Values set here are company-specific." aria-label="Values set here are company-specific." groups="base.group_multi_company" role="img"/>
<div class="text-mutex">
Send this message to your users when their order has been delivered.
</div>
<div class="content-group">
<div class="mt16 row">
<field name="company_lunch_notify_message" widget="html" class="col col-lg w-100"/>
</div>
</div>
</div>
</div>
</div>
</div>
</xpath>
</field>
</record>
<record id="lunch_config_settings_action" model="ir.actions.act_window">
<field name="name">Settings</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">res.config.settings</field>
<field name="view_id" ref="res_config_settings_view_form"/>
<field name="view_mode">form</field>
<field name="target">inline</field>
<field name="context">{'module' : 'lunch', 'bin_size': False}</field>
</record>
</odoo>