[FIX] Product view opens as a list view

[IMP] improved planner content
[IMP] Misc usability improvement:
	cost instead of sale price on product form
	improved views and terminologies
	journal entry is RO
This commit is contained in:
Fabien Pinckaers
2016-06-21 17:23:49 -07:00
parent 8be3781501
commit b0c9ee669b
4 changed files with 94 additions and 81 deletions
+4 -4
View File
@@ -27,13 +27,13 @@
</record>
<record id="product_product_fixed_cost" model="product.product">
<field name="name">Fixed Cost</field>
<field name="list_price">1.0</field>
<field name="name">Expenses</field>
<field name="list_price">0.0</field>
<field name="standard_price">1.0</field>
<field name="type">service</field>
<field name="default_code">FC</field>
<field name="default_code">EXP</field>
<field name="categ_id" ref="hr_expense.cat_expense"/>
<field name="can_be_expensed" eval="True" />
<field name="can_be_expensed" eval="True"/>
</record>
<!-- Expense-related subtypes for messaging / Chatter -->
+49 -61
View File
@@ -5,68 +5,56 @@
<template id="hr_expense_planner">
<t t-call="web_planner.pages">
<t t-call="web_planner.category">
<t t-set="menu_categorytitle">Automation</t>
<t t-set="menu_categorytitle">Setup</t>
<t t-set="menu_categoryclasses" t-value="'fa-magic'"/>
<t t-call="web_planner.page">
<t t-set="page_title">Incoming Emails</t>
<p class="text-muted">
There are several ways for your company to create expenses with Odoo.
One of them is using your company's generic email address as a trigger
to create a new expense in the system. Try it! Send an email with the
receipt in attachment to the email address below. This will create an
expense in the system with your information automatically set on it.
Be sure that your email address is correctly set on your employee or your
employee's user. Try to set the price in your mail subject and see what
happens.
</p>
<p>
That's the easiest way to integrate Odoo with third party apps.
</p>
<h4>The point of contact <strong>for all your expenses when you're out of office</strong></h4>
<div class="row">
<div class="col-md-4">
<div class="well well-sm text-center">
<h6><span class="fa" data-icon="&#xe01e;"/><t t-if="alias_name and alias_domain"> <t t-esc="alias_name"/>@<t t-esc="alias_domain"/></t></h6>
</div>
<div class="well well-sm text-center relative">
<p>
This email address has been preconfigured as the default
for your sales department.<br/>
<a t-att-href="prepare_backend_url('hr_expense.action_hr_expense_configuration')">(you can change it here)</a>
</p>
<span class="arrow-down"></span>
</div>
<t t-set="page_title">Get Mobile</t>
<t t-if="not (alias_name and alias_domain)">
<div class="alert alert-warning" role="alert">
<strong>Your email gateway is not configured.</strong> Please configure your email
gateway from the Settings app, menu <i>General Settings</i>.
</div>
<div class="col-md-4 text-center">
<div class="well well-lg">
<h4><span class="label label-default text-center odoo_purple">Incoming email</span></h4>
<span class="fa fa-angle-down fa-2x"></span>
<h4><span class="label label-default text-center odoo_purple">Expense</span></h4>
<span class="fa fa-angle-down fa-2x"></span>
<h4><span class="label label-default text-center odoo_purple">Report</span></h4>
<span class="fa fa-angle-down fa-2x"></span>
<h4><span class="label label-default text-center odoo_purple">Validation</span></h4>
<span class="fa fa-angle-down fa-2x"></span>
<h4><span class="label label-default text-center odoo_purple">Payment</span></h4>
</div>
<p>
Once your email gateway is configured, come back to this screen
to setup the next steps.
</p>
</t>
<t t-if="alias_name and alias_domain">
<p>
To create expenses by email, take photos of your
receipts and send them by email with the following
information:
</p>
<dl class="dl-horizontal">
<dt>From: Your Email</dt>
<dd>Your Email Address</dd>
<dt>To:</dt>
<dd><t t-esc="alias_name"/>@<t t-esc="alias_domain"/></dd>
<dt>Subject: </dt>
<dd><strong class="text-info">[PRODUCT CODE]</strong> Free Description <strong class="text-primary">PRICE</strong></dd>
</dl>
<hr class="mb32"/>
<p>
The <strong class="text-info">PRODUCT CODE</strong> is optional and should be the
internal code of one of your expense product. This
will set the right product automatically on your
expense Odoo.
</p><p>
You can set an optionnal <strong class="text-primary">PRICE</strong>
at the end of the subject of your email.
</p><p class="mb32">
The photo of the receipt and the description of the email will
be attached to the expense. That way, you get everything attached
to fill the remaining fields later on.
</p>
<div class="alert alert-info" role="alert">
<b>Note:</b> Set the same email address on your employee form than
the one you use are your "From:". Otherwise, your
expenses will not be accepted by email.
</div>
<div class="col-md-4">
<div class="well well-lg">
<p><strong>
<h4><a href="mailto:info@odoo.com?subject=HrExpense%20Planner" target="_blank">Contact Us</a></h4>to setup your own domain
name (e.g. sales@yourcompany.com)</strong></p>
</div>
</div>
</div>
<div class="alert alert-info" role="alert">
<p>Don't forget:</p>
<ul>
<li>Set your email address on your employee. Otherwise, the expense will not be created.</li>
<li>Put your receipt as an attachement. You'll need it one day or another as proof. Let's start directly.</li>
<li>Communicate the email address to your colleagues.</li>
<li>Tip: You can type the expense amount on the mail subject to set it automatically in Odoo. You can also put the product code into brackets if you often use it. By default the product 'Fixed Cost' will be used.</li>
</ul>
</div>
</t>
</t>
</t>
@@ -78,10 +66,10 @@
<h1 class="text-center o_planner_trophy" data-icon="&#xe006;" />
<div class="text-center">
<h1>Congratulations, you're done!</h1>
<h3>We hope this process helped your managing your expenses in a new way.</h3>
<h3>We hope this feature helped you manage your expenses efficiently.</h3>
<h4>Don't hesitate to <a href="mailto:info@odoo.com?subject=HrExpense%20Planner" target="_blank">send us an email</a> to describe<br/> your experience or to suggest improvements!</h4>
<p>Have a wonderful day!<br/>- The Odoo Team</p>
<p>Have a wonderful day,<br/>- The Odoo Team</p>
<img src="/web_planner/static/src/img/odoo_logo.png"/>
</div>
</t>
@@ -95,7 +83,7 @@
<field name="menu_id" ref="hr_expense.menu_hr_expense_root"/>
<field name="planner_application">planner_hr_expense</field>
<field name="tooltip_planner"><![CDATA[
Manage your expenses more efficiently! Create them immediatly by sending the receipts by email!
Send receipts by email to create expenses efficiently.
]]>
</field>
</record>
+1 -1
View File
@@ -283,7 +283,7 @@ class HrExpense(models.Model):
if help_message:
alias_record = self.env.ref('hr_expense.mail_alias_expense')
if alias_record and alias_record.alias_domain and alias_record.alias_name:
dynamic_help = '<p>%s</p>' % _("""Create a new expense, or send receipts by email to %(link)s to automatically create a new expense. Send an email right now and see it here.""") % {
dynamic_help = '<p>%s</p>' % _("""Create a new expense, or send receipts by email to %(link)s to automatically create new expenses.""") % {
'link': "<a href='mailto:%(email)s'>%(email)s</a>" % {'email': '%s@%s' % (alias_record.alias_name, alias_record.alias_domain)}
}
return '<p class="oe_view_nocontent_create">%s</p>%s%s' % (
+40 -15
View File
@@ -205,7 +205,7 @@
</record>
<record id="hr_expense_actions_my_all" model="ir.actions.act_window">
<field name="name">All My Expenses</field>
<field name="name">My Expenses</field>
<field name="res_model">hr.expense</field>
<field name="view_mode">tree,kanban,form,graph,pivot</field>
<field name="search_view_id" ref="view_hr_expense_filter"/>
@@ -225,7 +225,7 @@
</record>
<record id="hr_expense_actions_my_unsubmitted" model="ir.actions.act_window">
<field name="name">All My Unsubmitted Expenses</field>
<field name="name">My Expenses to Report</field>
<field name="res_model">hr.expense</field>
<field name="view_mode">tree,kanban,form,graph,pivot</field>
<field name="search_view_id" ref="view_hr_expense_filter"/>
@@ -298,7 +298,7 @@
<field name="image_medium" widget="image" class="oe_avatar"/>
<div class="oe_title">
<label class="oe_edit_only" for="name" string="Product Name"/>
<h1><field name="name" placeholder="Product Name"/></h1>
<h1><field name="name" placeholder="e.g. Lunch"/></h1>
<div name="options" groups="base.group_user" invisible="1">
<div>
<field name="can_be_expensed"/>
@@ -309,9 +309,14 @@
<group>
<group string="General Information">
<field name="type"/>
<field name="lst_price"/>
<field name="default_code"/>
<field name="uom_id"/>
<field name="standard_price"/>
<field name="uom_id" on_change="onchange_uom(uom_id,uom_po_id)" groups="product.group_uom" options="{'no_create': True}"/>
<field name="uom_po_id" invisible="1"/>
<label for="default_code"/>
<div>
<field name="default_code"/>
<i class="text-muted oe_edit_only">Use [Reference] as a subject prefix for incoming receipts</i>
</div>
</group>
<group string="Accounting">
<field name="property_account_expense_id"/>
@@ -328,8 +333,7 @@
<field name="res_model">product.product</field>
<field name="view_type">form</field>
<field name="view_mode">kanban,tree,form</field>
<field name="view_id" ref="product_product_expense_form_view"/>
<field name="context">{"default_can_be_expensed": 1}</field>
<field name="context">{"default_can_be_expensed": 1, 'default_type': 'service'}</field>
<field name="domain">[('can_be_expensed', '=', True)]</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
@@ -338,6 +342,27 @@
</field>
</record>
<record id="hr_expense_product_tree" model="ir.actions.act_window.view">
<field name="sequence" eval="2"/>
<field name="view_mode">tree</field>
<field name="act_window_id" ref="hr_expense_product"/>
</record>
<record id="hr_expense_product_kanban" model="ir.actions.act_window.view">
<field name="sequence" eval="1"/>
<field name="view_mode">kanban</field>
<field name="act_window_id" ref="hr_expense_product"/>
</record>
<record id="hr_expense_product_form" model="ir.actions.act_window.view">
<field name="sequence" eval="3"/>
<field name="view_mode">form</field>
<field name="view_id" ref="product_product_expense_form_view"/>
<field name="act_window_id" ref="hr_expense_product"/>
</record>
<record id="action_approved_expense" model="ir.actions.act_window">
<field name="name">Employee Expenses</field>
<field name="res_model">hr.expense</field>
@@ -439,7 +464,7 @@
<field name="journal_id" domain="[('type', '=', 'purchase')]" groups="account.group_account_user" options="{'no_open': True, 'no_create': True}" attrs="{'invisible': [('payment_mode', '!=', 'own_account')]}"/>
<field name="bank_journal_id" groups="account.group_account_user" options="{'no_open': True, 'no_create': True}" attrs="{'invisible': [('payment_mode', '!=', 'company_account')]}" domain="[('type', 'in', ['cash', 'bank'])]"/>
<field name="accounting_date" groups="account.group_account_user" attrs="{'invisible': [('state', 'not in', ['approve', 'post', 'done'])]}"/>
<field name="account_move_id" attrs="{'invisible': [('state', 'not in', ['post', 'done'])]}" groups="account.group_account_user"/>
<field name="account_move_id" attrs="{'invisible': [('state', 'not in', ['post', 'done'])]}" groups="account.group_account_user" readonly="1"/>
</group>
</group>
<field name="expense_line_ids" nolabel="1" widget="many2many" domain="[('state', '=', 'draft')]" options="{'no_delete': True}">
@@ -753,8 +778,8 @@
<menuitem id="menu_hr_expense_root" name="Expenses" sequence="100" web_icon="hr_expense,static/description/icon.png"/>
<menuitem id="menu_hr_expense_my_expenses" name="My Expenses" sequence="10" parent="menu_hr_expense_root"/>
<menuitem id="menu_hr_expense_my_unsubmitted" name="Unreported Expenses" sequence="1" parent="menu_hr_expense_my_expenses" action="hr_expense_actions_my_unsubmitted"/>
<menuitem id="menu_hr_expense_my_expenses" name="My Expenses" sequence="1" parent="menu_hr_expense_root"/>
<menuitem id="menu_hr_expense_my_unsubmitted" name="My Expenses to Report" sequence="10" parent="menu_hr_expense_my_expenses" action="hr_expense_actions_my_unsubmitted"/>
<menuitem id="menu_hr_expense_my_all" name="All Expenses" sequence="2" parent="menu_hr_expense_my_expenses"
action="hr_expense_actions_my_all"/>
@@ -763,13 +788,13 @@
<menuitem id="menu_hr_expense_sheet_my_all" name="All Reports" sequence="2" parent="menu_hr_expense_sheet_my_reports" action="action_hr_expense_sheet_my_all"/>
<menuitem id="menu_hr_expense_sheet_all" name="All Reports" sequence="20" parent="menu_hr_expense_root"/>
<menuitem id="menu_hr_expense_sheet_all_to_approve" name="To Approve" sequence="1" parent="menu_hr_expense_sheet_all"
<menuitem id="menu_hr_expense_sheet_all_to_approve" name="Reports To Approve" sequence="1" parent="menu_hr_expense_sheet_all"
action="action_hr_expense_sheet_all_to_approve" groups="base.group_hr_user"/>
<menuitem id="menu_hr_expense_sheet_all_to_post" name="To Post" sequence="2" parent="menu_hr_expense_sheet_all"
<menuitem id="menu_hr_expense_sheet_all_to_post" name="Reports To Post" sequence="2" parent="menu_hr_expense_sheet_all"
action="action_hr_expense_sheet_all_to_post" groups="base.group_hr_manager"/>
<menuitem id="menu_hr_expense_sheet_all_to_pay" name="To Pay" sequence="3" parent="menu_hr_expense_sheet_all"
<menuitem id="menu_hr_expense_sheet_all_to_pay" name="Reports To Pay" sequence="3" parent="menu_hr_expense_sheet_all"
action="action_hr_expense_sheet_all_to_pay" groups="base.group_hr_manager"/>
<menuitem id="menu_hr_expense_sheet_all_all" name="All" sequence="4" parent="menu_hr_expense_sheet_all"
<menuitem id="menu_hr_expense_sheet_all_all" name="All Reports" sequence="4" parent="menu_hr_expense_sheet_all"
action="action_hr_expense_sheet_all_all" groups="base.group_hr_manager"/>
<menuitem id="menu_hr_expense_configuration" name="Configuration" parent="menu_hr_expense_root"