Divyesh Makwana(OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-first_10_clicks_customer_invoice-mdi
into lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-first_10_clicks_customer_invoice-mdi/+merge/109077
Hello Sir,
In Order to improve user experience, i have improved the following things:
1. Improved the menu-tips.
2. Added Open-chatter Notification System.
3. Highlighted buttons depending on the states.
4. Restricted some fields to appropriate groups.
Thanks,
Divyesh
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-first_10_clicks_customer_invoice-mdi/+merge/109077
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-first_10_clicks_customer_invoice-mdi.
=== modified file 'account/account_invoice_view.xml'
--- account/account_invoice_view.xml 2012-06-06 10:01:50 +0000
+++ account/account_invoice_view.xml 2012-06-07 06:46:23 +0000
@@ -39,7 +39,7 @@
<field name="quantity"/>
<field name="uos_id" groups="product.group_uom"/>
<field name="price_unit"/>
- <field name="discount"/>
+ <field name="discount" groups="sale.group_discount_per_so_line"/>
<field name="price_subtotal"/>
</tree>
</field>
@@ -60,7 +60,7 @@
</group>
<field name="price_unit"/>
<field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '<>', 'view')]" name="account_id" on_change="onchange_account_id(product_id, parent.partner_id, parent.type, parent.fiscal_position,account_id)" groups="account.group_account_user"/>
- <field name="discount"/>
+ <field name="discount" groups="sale.group_discount_per_so_line"/>
<field domain="[('type','<>','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
<field name="company_id" groups="base.group_multi_company" readonly="1"/>
<separator string="Notes" colspan="4"/>
@@ -257,9 +257,10 @@
<field name="arch" type="xml">
<form layout="manual">
<header>
- <button name="action_invoice_sent" type="object" string="Send by Email" states="open" attrs="{'invisible':['|',('sent','=',True), ('state', '=', 'draft')]}"/>
- <button name="invoice_print" string="Print Invoice" type="object" states="open" attrs="{'invisible':['|',('sent','=',True), ('state', '=', 'draft')]}"/>
- <button name="invoice_open" states="draft,proforma2" string="Validate"/>
+ <button name="action_invoice_sent" type="object" string="Send by Email" states="open" attrs="{'invisible':['|',('sent','=',True), ('state', '=', 'draft')]}" class="oe_form_button_hi"/>
+ <button name="invoice_print" string="Print Invoice" type="object" states="open" attrs="{'invisible':['|',('sent','=',True), ('state', '=', 'draft')]}" class="oe_form_button_hi"/>
+ <button name="invoice_open" states="draft" string="Validate" class="oe_form_button_hi"/>
+ <button name="invoice_open" states="proforma2" string="Validate"/>
<button name="invoice_proforma2" states="draft" string="PRO-FORMA" groups="account.group_proforma_invoices"/>
<button name="%(action_account_invoice_refund)d" type='action' string='Refund Invoice' states='paid'/>
<button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" groups="base.group_no_one"/>
@@ -291,10 +292,10 @@
<page string="Invoice">
<field colspan="4" name="invoice_line" nolabel="1" widget="one2many_list" context="{'type': type}"/>
<group col="1" colspan="2">
- <field name="tax_line" nolabel="1">
+ <field name="tax_line" nolabel="1" widget="many2many_tags">
<tree editable="bottom" string="Taxes">
<field name="name"/>
- <field name="account_id" groups="account.group_account_invoice"/>
+ <field name="account_id" groups="account.group_account_user"/>
<field name="base" on_change="base_change(base,parent.currency_id,parent.company_id,parent.date_invoice)" readonly="1"/>
<field name="amount" on_change="amount_change(amount,parent.currency_id,parent.company_id,parent.date_invoice)"/>
<field invisible="True" name="base_amount"/>
@@ -437,7 +438,11 @@
<field name="domain">[('type','=','out_invoice')]</field>
<field name="context">{'default_type':'out_invoice', 'type':'out_invoice', 'journal_type': 'sale'}</field>
<field name="search_view_id" ref="view_account_invoice_filter"/>
- <field name="help">With Customer Invoices you can create and manage sales invoices issued to your customers. OpenERP can also generate draft invoices automatically from sales orders or deliveries. You should only confirm them before sending them to your customers.</field>
+ <field name="help">
+ Click here to create a new Invoice.
+ <p>
+ The Invoice can be generated automatically from a sale order or a delivery order. The invoice can be send by email.
+ </field>
</record>
@@ -478,7 +483,11 @@
<field name="domain">[('type','=','out_refund')]</field>
<field name="context">{'default_type':'out_refund', 'type':'out_refund', 'journal_type': 'sale_refund'}</field>
<field name="search_view_id" ref="view_account_invoice_filter"/>
- <field name="help">With Customer Refunds you can manage the credit notes for your customers. A refund is a document that credits an invoice completely or partially. You can easily generate refunds and reconcile them directly from the invoice form.</field>
+ <field name="help">
+ Click here to create a new customer refund.
+ <p>
+ A refund is a document that credits an invoice completely or partially. You can also generate refunds and reconcile them directly from the invoice form.
+ </field>
</record>
<record id="action_invoice_tree3_view1" model="ir.actions.act_window.view">
=== modified file 'account_voucher/account_voucher.py'
--- account_voucher/account_voucher.py 2012-05-23 06:53:42 +0000
+++ account_voucher/account_voucher.py 2012-06-07 06:46:23 +0000
@@ -248,10 +248,37 @@
res[voucher.id] = voucher.amount / rate
return res
+ # -----------------------------------------
+ # OpenChatter notifications and need_action
+ # -----------------------------------------
+
+ def _get_document_type(self, type):
+ type_dict = {
+ 'sale': 'Sales Receipt',
+ 'purchase': 'Purchase Receipt',
+ 'payment': 'Supplier Payment',
+ 'receipt': 'Customer Payment',
+ }
+ return type_dict.get(type, 'Voucher')
+
+ def create(self, cr, uid, vals, context=None):
+ res = super(account_voucher, self).create(cr, uid, vals, context=context)
+ self.create_send_note(cr, uid, [res], context=context)
+ return res
+
+ def create_send_note(self, cr, uid, ids, context=None):
+ for obj in self.browse(cr, uid, ids, context=context):
+ self.message_append_note(cr, uid, [obj.id], body=_("%s <b>created</b>.") % (self._get_document_type(obj.type)), context=context)
+
+ def reconcile_send_note(self, cr, uid, ids, context=None):
+ for obj in self.browse(cr, uid, ids, context=context):
+ self.message_append_note(cr, uid, [obj.id], body=_("%s is <b>reconciled</b>.") % (self._get_document_type(obj.type)), context=context)
+
_name = 'account.voucher'
_description = 'Accounting Voucher'
_order = "date desc, id desc"
# _rec_name = 'number'
+ _inherit = ['mail.thread']
_columns = {
'type':fields.selection([
('sale','Sale'),
@@ -323,7 +350,7 @@
'amount': _get_amount,
'type':_get_type,
'state': 'draft',
- 'pay_now': 'pay_later',
+ 'pay_now': 'pay_now',
'name': '',
'date': lambda *a: time.strftime('%Y-%m-%d'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.voucher',context=c),
@@ -556,7 +583,7 @@
@return: Returns a dict which contains new values, and context
"""
def _remove_noise_in_o2m():
- """if the line is partially reconciled, then we must pay attention to display it only once and
+ """if the line is partially reconciled, then we must pay attention to display it only once and
in the good o2m.
This function returns True if the line is considered as noise and should not be displayed
"""
@@ -1249,12 +1276,17 @@
'state': 'posted',
'number': name,
})
+ message = _("%s '%s' is <b>posted</b>.") % (self._get_document_type(voucher.type), name)
+ self.message_append_note(cr, uid, [voucher.id], body=message, context=context)
if voucher.journal_id.entry_posted:
move_pool.post(cr, uid, [move_id], context={})
# We automatically reconcile the account move lines.
+ reconcile = False
for rec_ids in rec_list_ids:
if len(rec_ids) >= 2:
- move_line_pool.reconcile_partial(cr, uid, rec_ids, writeoff_acc_id=voucher.writeoff_acc_id.id, writeoff_period_id=voucher.period_id.id, writeoff_journal_id=voucher.journal_id.id)
+ reconcile = move_line_pool.reconcile_partial(cr, uid, rec_ids, writeoff_acc_id=voucher.writeoff_acc_id.id, writeoff_period_id=voucher.period_id.id, writeoff_journal_id=voucher.journal_id.id)
+ if reconcile:
+ self.reconcile_send_note(cr, uid, [voucher.id], context=context)
return True
def copy(self, cr, uid, id, default={}, context=None):
=== modified file 'account_voucher/account_voucher_pay_invoice.xml'
--- account_voucher/account_voucher_pay_invoice.xml 2012-05-25 15:17:40 +0000
+++ account_voucher/account_voucher_pay_invoice.xml 2012-06-07 06:46:23 +0000
@@ -7,9 +7,12 @@
<field name="type">form</field>
<field name="inherit_id" ref="account.invoice_form"/>
<field name="arch" type="xml">
- <button name="invoice_open" position="after">
- <button name="invoice_pay_customer" type="object" string="Register Payment" states="open" icon="gtk-go-forward"/>
- </button>
+ <xpath expr="//button[@name='invoice_open']" position="after">
+ <div>
+ <button name="invoice_pay_customer" type="object" string="Register Payment" attrs="{'invisible':['|',('sent','=',True), ('state', '!=', 'open')]}"/>
+ <button name="invoice_pay_customer" type="object" string="Register Payment" attrs="{'invisible':['|',('sent','=',False), ('state', '!=', 'open')]}" class="oe_form_button_hi"/>
+ </div>
+ </xpath>
</field>
</record>
<record id="view_invoice_supplier" model="ir.ui.view">
=== modified file 'account_voucher/account_voucher_view.xml'
--- account_voucher/account_voucher_view.xml 2012-06-04 12:20:53 +0000
+++ account_voucher/account_voucher_view.xml 2012-06-07 06:46:23 +0000
@@ -109,6 +109,9 @@
</page>
</notebook>
</sheet>
+ <div class="oe_form_sheet_width">
+ <field name="message_ids" colspan="4" widget="ThreadView" nolabel="1"/>
+ </div>
</form>
</field>
</record>
=== modified file 'account_voucher/voucher_payment_receipt_view.xml'
--- account_voucher/voucher_payment_receipt_view.xml 2012-06-06 10:01:50 +0000
+++ account_voucher/voucher_payment_receipt_view.xml 2012-06-07 06:46:23 +0000
@@ -258,6 +258,9 @@
</page>
</notebook>
</sheet>
+ <div class="oe_form_sheet_width">
+ <field name="message_ids" colspan="4" widget="ThreadView" nolabel="1"/>
+ </div>
</form>
</field>
</record>
@@ -296,7 +299,7 @@
<field name="arch" type="xml">
<form layout="manual">
<header>
- <button name="proforma_voucher" string="Validate" states="draft" invisible="context.get('line_type', False)"/>
+ <button name="proforma_voucher" string="Validate" states="draft" invisible="context.get('line_type', False)" class="oe_form_button_hi"/>
<button name="cancel_voucher" string="Cancel" states="draft,proforma" invisible="context.get('line_type', False)"/>
<button name="cancel_voucher" string="Unreconcile" type="object" states="posted" invisible="context.get('line_type', False)" confirm="Are you sure to unreconcile and cancel this record ?"/>
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft" invisible="context.get('line_type', False)"/>
@@ -412,6 +415,9 @@
</page>
</notebook>
</sheet>
+ <div class="oe_form_sheet_width">
+ <field name="message_ids" colspan="4" widget="ThreadView" nolabel="1"/>
+ </div>
</form>
</field>
</record>
@@ -425,7 +431,11 @@
<field name="search_view_id" ref="view_voucher_filter_customer_pay"/>
<field name="view_id" eval="False"/>
<field name="target">current</field>
- <field name="help">Sales payment allows you to register the payments you receive from your customers. In order to record a payment, you must enter the customer, the payment method (=the journal) and the payment amount. OpenERP will propose to you automatically the reconciliation of this payment with the open invoices or sales receipts.</field>
+ <field name="help">
+ Click on create to register a payment.
+ <p>
+ Enter the customer and the payment method and then, either create manually a payment record or OpenERP will propose to you automatically the reconciliation of this payment with the open invoices or sales receipts.
+ </field>
</record>
<record id="action_vendor_receipt_tree" model="ir.actions.act_window.view">
<field eval="1" name="sequence"/>
=== modified file 'account_voucher/voucher_sales_purchase_view.xml'
--- account_voucher/voucher_sales_purchase_view.xml 2012-06-04 12:11:39 +0000
+++ account_voucher/voucher_sales_purchase_view.xml 2012-06-07 06:46:23 +0000
@@ -82,8 +82,8 @@
<field name="arch" type="xml">
<form layout="manual">
<header>
- <button name="proforma_voucher" string="Validate" states="draft"/>
- <button name="%(act_pay_voucher)d" context="{'narration':narration, 'title':'Customer Payment', 'type':'receipt', 'partner_id':partner_id, 'reference':reference, 'amount':amount}" type="action" string="Pay" attrs="{'invisible':['|',('pay_now','=','pay_now'),'|',('state','=','draft'), ('paid','=',True)]}"/>
+ <button name="proforma_voucher" string="Validate" states="draft" class="oe_form_button_hi"/>
+ <button name="%(act_pay_voucher)d" context="{'narration':narration, 'title':'Customer Payment', 'type':'receipt', 'partner_id':partner_id, 'reference':reference, 'amount':amount}" type="action" string="Pay" attrs="{'invisible':['|',('pay_now','=','pay_now'),'|',('state','=','draft'), ('paid','=',True)]}" class="oe_form_button_hi"/>
<button name="cancel_voucher" string="Cancel" states="draft,proforma" />
<button name="cancel_voucher" string="Cancel" type="object" states="posted" confirm="Are you sure to confirm this record ?"/>
<button name="action_cancel_draft" type="object" states="cancel" string="Set to Draft"/>
@@ -93,7 +93,7 @@
<group col="6" colspan="4" class="oe_form_header">
<field name="partner_id" domain="[('customer','=',True)]" required="1" on_change="onchange_partner_id(partner_id, journal_id, amount, currency_id, type, date, context)" string="Customer" context="{'search_default_customer': 1}"/>
<field name="date" on_change="onchange_date(date, currency_id, currency_id, amount, company_id, context)"/>
- <field name="journal_id" domain="[('type','in',['sale','sale_refund'])]" widget="selection" on_change="onchange_journal(journal_id, line_cr_ids, tax_id, partner_id, date, amount, type, company_id, context)"/>
+ <field name="journal_id" domain="[('type','in',['sale','sale_refund'])]" widget="selection" on_change="onchange_journal(journal_id, line_cr_ids, tax_id, partner_id, date, amount, type, company_id, context)" groups="account.group_account_user"/>
<field name="number"/>
<field name="name" colspan="2"/>
<field name="company_id" select="1" widget="selection" groups="base.group_multi_company"/>
@@ -104,7 +104,7 @@
<page string="Sales Information">
<field name="line_cr_ids" on_change="onchange_price(line_cr_ids, tax_id, partner_id)" context="{'journal_id':journal_id, 'type':type, 'partner_id':partner_id}" colspan="4" nolabel="1" height="180">
<tree string="Sales Lines" editable="bottom">
- <field name="account_id" domain="[('user_type.report_type','=','income'),('type','!=','view')]" widget="selection"/>
+ <field name="account_id" domain="[('user_type.report_type','=','income'),('type','!=','view')]" widget="selection" groups="account.group_account_user"/>
<field name="name"/>
<field name="amount" sum="Total"/>
<field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
@@ -158,6 +158,9 @@
</page>
</notebook>
</sheet>
+ <div class="oe_form_sheet_width">
+ <field name="message_ids" colspan="4" widget="ThreadView" nolabel="1"/>
+ </div>
</form>
</field>
</record>
@@ -172,7 +175,11 @@
<field name="view_id" eval="False"/>
<field name="search_view_id" ref="view_voucher_filter_sale"/>
<field name="target">current</field>
- <field name="help">When you sell products to a customer, you can give him a sales receipt or an invoice. When the sales receipt is confirmed, it creates journal items automatically and you can record the customer payment related to this sales receipt.</field>
+ <field name="help">
+ Click here to create a sale receipt.
+ <p>
+ When the sales receipt is confirmed, you can record the customer payment related to this sales receipt.
+ </field>
</record>
<record id="action_sale_receipt_tree" model="ir.actions.act_window.view">
<field eval="1" name="sequence"/>
@@ -279,6 +286,9 @@
</page>
</notebook>
</sheet>
+ <div class="oe_form_sheet_width">
+ <field name="message_ids" colspan="4" widget="ThreadView" nolabel="1"/>
+ </div>
</form>
</field>
</record>
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp