Mayur Maheshwari(OpenERP) has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-elnvoicing-supplier-mma into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-elnvoicing-supplier-mma/+merge/108898

Hello Sir,

I have Improved following things

==> Improve menu tips 
==> Added OpenChatter in voucher
==> Added a class and group on some filed and Button


Thanks.
mma
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-elnvoicing-supplier-mma/+merge/108898
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-elnvoicing-supplier-mma.
=== modified file 'account/account_invoice_view.xml'
--- account/account_invoice_view.xml	2012-06-04 12:20:53 +0000
+++ account/account_invoice_view.xml	2012-06-06 08:59:21 +0000
@@ -144,7 +144,7 @@
             <field name="arch" type="xml">
                 <form layout="manual">
                 <header>
-                    <button name="invoice_open" states="draft,proforma2" string="Validate"/>
+                    <button name="invoice_open" states="draft,proforma2" string="Validate" class="oe_form_button_hi"/>
                     <button name="%(action_account_invoice_refund)d" type='action' string='Ask Refund' states='open,paid'/>
                     <button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel" groups="base.group_no_one"/>
                     <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
@@ -153,7 +153,7 @@
                 </header>
                 <sheet string="Supplier Invoice" layout="auto">
                     <group col="8" colspan="4" class="oe_form_header">
-                        <field name="journal_id" on_change="onchange_journal_id(journal_id)" widget="selection"/>
+                        <field name="journal_id" on_change="onchange_journal_id(journal_id)" widget="selection" groups="account.group_account_user"/>
                         <field name="number" readonly="1" placeholder="PO0025"/>
                         <field name="type" invisible="1"/>
                         <field name="currency_id" width="50"/>
@@ -177,7 +177,7 @@
                             <field colspan="4" context="{'partner_id': partner_id, 'price_type': 'price_type' in dir() and price_type or False, 'type': type}" name="invoice_line" nolabel="1">
                                 <tree string="Invoice lines">
                                     <field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
-                                    <field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id" on_change="onchange_account_id(product_id,parent.partner_id,parent.type,parent.fiscal_position,account_id)"/>
+                                    <field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id" on_change="onchange_account_id(product_id,parent.partner_id,parent.type,parent.fiscal_position,account_id)" groups="base.group_account_user"/>
                                     <field name="invoice_line_tax_id" view_mode="2" context="{'type':parent.type}" domain="[('parent_id','=',False)]"/>
                                     <field domain="[('type','&lt;&gt;','view'), ('company_id', '=', parent.company_id), ('parent_id', '!=', False)]" name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
                                     <field name="quantity"/>
@@ -465,7 +465,7 @@
             <field name="domain">[('type','=','in_invoice')]</field>
             <field name="context">{'default_type': 'in_invoice', 'type': 'in_invoice', 'journal_type': 'purchase'}</field>
             <field name="search_view_id" ref="view_account_invoice_filter"/>
-            <field name="help">With Supplier Invoices you can enter and manage invoices issued by your suppliers. OpenERP can also generate draft invoices automatically from purchase orders or receipts. This way, you can control the invoice from your supplier according to what you purchased or received.</field>
+            <field name="help">Click here to create Supplier invoice.you can control the invoice from your supplier according to what you purchased or received. OpenERP can also generate draft invoices automatically from purchase orders or receipts.</field>
         </record>
         <menuitem action="action_invoice_tree2" id="menu_action_invoice_tree2" parent="menu_finance_payables"/>
 
@@ -504,7 +504,7 @@
             <field name="domain">[('type','=','in_refund')]</field>
             <field name="context">{'default_type': 'in_refund', 'type': 'in_refund', 'journal_type': 'purchase_refund'}</field>
             <field name="search_view_id" ref="view_account_invoice_filter"/>
-            <field name="help">With Supplier Refunds you can manage the credit notes you receive from your suppliers. 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 supplier refund.Track Refund you receive from your supplier. You can also generate refunds and reconcile them directly from the invoice form</field>
         </record>
         <menuitem action="action_invoice_tree4" id="menu_action_invoice_tree4" parent="menu_finance_payables"/>
 

=== 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-06 08:59:21 +0000
@@ -250,6 +250,7 @@
 
     _name = 'account.voucher'
     _description = 'Accounting Voucher'
+    _inherit = ['mail.thread']
     _order = "date desc, id desc"
 #    _rec_name = 'number'
     _columns = {
@@ -1249,14 +1250,26 @@
                 '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 create(self, cr, uid, vals, context=None):
+        voucher =  super(account_voucher, self).create(cr, uid, vals, context=context)
+        if voucher:
+            self.create_send_note(cr, uid, [voucher], context=context)
+        return voucher
+    
     def copy(self, cr, uid, id, default={}, context=None):
         default.update({
             'state': 'draft',
@@ -1270,6 +1283,27 @@
             default['date'] = time.strftime('%Y-%m-%d')
         return super(account_voucher, self).copy(cr, uid, id, default, context)
 
+    # --------------------------------------
+    # OpenChatter methods and notifications
+    # --------------------------------------
+    
+    def _get_document_type(self, type):
+        type_dict = {
+                'payment': 'Supplier Payment',
+                'purchase': 'Purchase Receipt',
+                'sale': 'Sales Receipt',
+                'receipt': 'Customer Payment',
+        }
+        return type_dict.get(type, 'payment')
+
+    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 <b>reconciled</b>.") % (self._get_document_type(obj.type)), context=context)
+
 account_voucher()
 
 class account_voucher_line(osv.osv):

=== 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-06 08:59:21 +0000
@@ -18,9 +18,11 @@
             <field name="type">form</field>
             <field name="inherit_id" ref="account.invoice_supplier_form"/>
             <field name="arch" type="xml">
-                <button name="invoice_open" position="after">
-                    <button name="invoice_pay_customer" type="object" string="Pay" states="open" icon="gtk-go-forward"/>
-                </button>
+                <xpath expr="//button[@name='invoice_open']" position="after">
+                <div>
+                    <button name="invoice_pay_customer" type="object" string="Pay" states="open" class="oe_form_button_hi"/>
+                </div>
+                </xpath>
             </field>
         </record>
     </data>

=== modified file 'account_voucher/voucher_payment_receipt_view.xml'
--- account_voucher/voucher_payment_receipt_view.xml	2012-06-04 12:20:53 +0000
+++ account_voucher/voucher_payment_receipt_view.xml	2012-06-06 08:59:21 +0000
@@ -145,7 +145,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)"/>
@@ -185,8 +185,8 @@
                                     <field name="date_original" readonly="1"/>
                                     <field name="date_due" readonly="1"/>
                                     <field name="amount_original" readonly="1"/>
-                                    <field name="amount_unreconciled" readonly="1"/>
-                                    <field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)"/>
+                                    <field name="amount_unreconciled" readonly="1" groups="account.group_account_user"/>
+                                    <field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)" groups="account.group_account_user"/>
                                     <field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)"/>
                                 </tree>
                             </field>
@@ -201,8 +201,8 @@
                                     <field name="date_original" readonly="1"/>
                                     <field name="date_due" readonly="1"/>
                                     <field name="amount_original" readonly="1"/>
-                                    <field name="amount_unreconciled" readonly="1"/>
-                                    <field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)"/>
+                                    <field name="amount_unreconciled" readonly="1" groups="account.group_account_user"/>
+                                    <field name="reconcile" on_change="onchange_reconcile(reconcile, amount, amount_unreconciled, context)" groups="account.group_account_user"/>
                                     <field name="amount" sum="Total Allocation" on_change="onchange_amount(amount, amount_unreconciled, context)"/>
                                 </tree>
                             </field>
@@ -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>
@@ -271,7 +274,7 @@
             <field name="view_id" eval="False"/>
             <field name="search_view_id" ref="view_voucher_filter_vendor_pay"/>
             <field name="target">current</field>
-            <field name="help">The supplier payment form allows you to track the payment you do to your suppliers. When you select a supplier, the payment method and an amount for the payment, OpenERP will propose to reconcile your payment with the open supplier invoices or bills.</field>
+            <field name="help">Click on "Create" to register a supplier payment. Track payments you do to your supplier and amounts you pay</field>
         </record>
         <record id="action_vendor_payment_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-06 08:59:21 +0000
@@ -208,8 +208,8 @@
             <field name="arch" type="xml">
                 <form layout="manual">
                 <header>
-                    <button name="proforma_voucher" string="Validate" states="draft"/>
-                    <button name="%(act_pay_bills)d" context="{'narration':narration, 'title':'Bill Payment', 'type':'payment', 'partner_id': partner_id, 'reference':reference}" type="action" string="Pay Bill" 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_bills)d" context="{'narration':narration, 'title':'Bill Payment', 'type':'payment', 'partner_id': partner_id, 'reference':reference}" type="action" string="Pay Bill" 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"/>
@@ -233,7 +233,7 @@
                         <page string="Bill Information">
                             <field name="line_dr_ids" on_change="onchange_price(line_dr_ids, tax_id, partner_id)" context="{'journal_id':journal_id,'partner_id':partner_id}" colspan="4" nolabel="1" height="180">
                                 <tree string="Expense Lines" editable="bottom">
-                                    <field name="account_id" widget="selection" domain="[('user_type.report_type','=','expense'), ('type','!=','view')]"/>
+                                    <field name="account_id" widget="selection" domain="[('user_type.report_type','=','expense'), ('type','!=','view')]"  groups="account.group_account_user"/>
                                     <field name="name"/>
                                     <field name="amount"/>
                                     <field name="account_analytic_id" groups="analytic.group_analytic_accounting"/>
@@ -279,6 +279,9 @@
                         </page>
                     </notebook>
                     </sheet>
+                    <div class="oe_form_sheet_width">
+                        <field name="message_ids" colspan="4" widget="ThreadView" nolabel="1"/>
+                    </div>
                 </form>
             </field>
         </record>
@@ -291,6 +294,7 @@
             <field name="view_id" eval="False"/>
             <field name="search_view_id" eval="view_voucher_filter_vendor"/>
             <field name="target">current</field>
+            <field name="help"> Click here to create a Purchase Receipt.When the purchase receipt is confirmed, you can record the supplier payment related to this Purchase receipt.</field>
         </record>
         <record id="action_purchase_receipt_tree" model="ir.actions.act_window.view">
             <field eval="1" name="sequence"/>

_______________________________________________
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

Reply via email to