The lunch application works fine, but some usability points need to be improved in order to have a smoother onboarding. These include: Making lunch location tree view editable, instead of having to use the form view Auto filling partner details from vendor form Fixing typos in various labels Add a name field on lunch.alert instead of using the message as _rec_name Adding a stat button on lunch category to see the associated products Task 1942776 closes odoo/odoo#33091 Signed-off-by: Romain Libert (rli) <rli@odoo.com>
113 lines
6.3 KiB
XML
113 lines
6.3 KiB
XML
<?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"/>
|
|
<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>
|
|
<div class="oe_button_box" name="button_box">
|
|
<button name="toggle_active" type="object" class="oe_stat_button" icon="fa-archive">
|
|
<field name="active" widget="boolean_button" options="{"terminology": "archive"}"/>
|
|
</button>
|
|
</div>
|
|
<div class="oe_title">
|
|
<label for="name" class="oe_edit_only"/>
|
|
<h1><field name="name" required="1"/></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="email" attrs="{'required': [('send_by', '=', 'mail')]}"/>
|
|
<field name="phone" attrs="{'required': [('send_by', '=', 'phone')]}"/>
|
|
<field name="responsible_id" attrs="{'required': [('send_by', '=', 'mail')]}" groups="base.group_no_one"/>
|
|
</group>
|
|
</group>
|
|
<group>
|
|
<group string="Availability">
|
|
<field name="tz" groups="base.group_no_one"/>
|
|
<field name="recurrency_monday"/>
|
|
<field name="recurrency_tuesday"/>
|
|
<field name="recurrency_wednesday"/>
|
|
<field name="recurrency_thursday"/>
|
|
<field name="recurrency_friday"/>
|
|
<field name="recurrency_saturday"/>
|
|
<field name="recurrency_sunday"/>
|
|
<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"/>
|
|
<div class="o_row"><field name="automatic_email_time" widget="float_time"/> <field name="moment"/></div>
|
|
</group>
|
|
</group>
|
|
</sheet>
|
|
<div class="oe_chatter">
|
|
<field name="message_follower_ids" widget="mail_followers" groups="base.group_user"/>
|
|
<field name="activity_ids" widget="mail_activity"/>
|
|
<field name="message_ids" widget="mail_thread"/>
|
|
</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_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>
|
|
</record>
|
|
</odoo>
|