*corrected proforma stuff: a proforma invoice do NOT have to create entries
authorqdp <qdp@tinyerp.com>
Tue, 7 Oct 2008 10:02:21 +0000 (12:02 +0200)
committerqdp <qdp@tinyerp.com>
Tue, 7 Oct 2008 10:02:21 +0000 (12:02 +0200)
*corrected label for tax code and base code (the ones for invoices and refunds had the same label so it was confusing. Specially when the user tried to export these
fields
*added a menuitem for legal statements

bzr revid: qdp@tinyerp.com-20081007100221-4azxnr4ac0ac8wxz

addons/account/account.py
addons/account/account_invoice_view.xml
addons/account/account_invoice_workflow.xml
addons/account/account_menuitem.xml
addons/account/invoice.py

index b29427d..27075fb 100644 (file)
@@ -1121,8 +1121,8 @@ class account_tax(osv.osv):
 
         # Same fields for refund invoices
 
-        'ref_base_code_id': fields.many2one('account.tax.code', 'Base Code', help="Use this code for the VAT declaration."),
-        'ref_tax_code_id': fields.many2one('account.tax.code', 'Tax Code', help="Use this code for the VAT declaration."),
+        'ref_base_code_id': fields.many2one('account.tax.code', 'Refund Base Code', help="Use this code for the VAT declaration."),
+        'ref_tax_code_id': fields.many2one('account.tax.code', 'Refund Tax Code', help="Use this code for the VAT declaration."),
         'ref_base_sign': fields.float('Base Code Sign', help="Usualy 1 or -1."),
         'ref_tax_sign': fields.float('Tax Code Sign', help="Usualy 1 or -1."),
         'include_base_amount': fields.boolean('Include in base amount', help="Indicate if the amount of tax must be included in the base amount for the computation of the next taxes"),
@@ -1781,8 +1781,8 @@ class account_tax_template(osv.osv):
 
         # Same fields for refund invoices
 
-        'ref_base_code_id': fields.many2one('account.tax.code.template', 'Base Code', help="Use this code for the VAT declaration."),
-        'ref_tax_code_id': fields.many2one('account.tax.code.template', 'Tax Code', help="Use this code for the VAT declaration."),
+        'ref_base_code_id': fields.many2one('account.tax.code.template', 'Refund Base Code', help="Use this code for the VAT declaration."),
+        'ref_tax_code_id': fields.many2one('account.tax.code.template', 'Refund Tax Code', help="Use this code for the VAT declaration."),
         'ref_base_sign': fields.float('Base Code Sign', help="Usually 1 or -1."),
         'ref_tax_sign': fields.float('Tax Code Sign', help="Usually 1 or -1."),
         'include_base_amount': fields.boolean('Include in base amount', help="Indicate if the amount of tax must be included in the base amount for the computation of the next taxes."),
index 3b1aaba..1f76270 100644 (file)
                                 <field name="state" select="2"/>
                                 <field name="residual"/>
                                 <group col="3" colspan="4">
-                                    <button name="invoice_open" states="draft,proforma" string="Validate"/>
-                                    <button name="invoice_cancel" states="draft,proforma,sale,open" string="Cancel"/>
+                                    <button name="invoice_open" states="draft,proforma2" string="Validate"/>
+                                    <button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel"/>
                                     <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
                                     <button name='%(wizard_paid_open)d' type='action' string='Re-Open' states='paid'/>
                                 </group>
                                 <field name="state" select="2"/>
                                 <field name="residual"/>
                                 <group col="3" colspan="4">
-                                    <button name="invoice_proforma" states="draft" string="PRO-FORMA"/>
-                                    <button name="invoice_open" states="draft,proforma" string="Create"/>
-                                    <button name="invoice_cancel" states="draft,proforma,sale,open" string="Cancel"/>
+                                    <button name="invoice_proforma2" states="draft" string="PRO-FORMA"/>
+                                    <button name="invoice_open" states="draft,proforma2" string="Create"/>
+                                    <button name="invoice_cancel" states="draft,proforma2,sale,open" string="Cancel"/>
                                     <button name="action_cancel_draft" states="cancel" string="Set to Draft" type="object"/>
                                     <button name='%(wizard_paid_open)d' type='action' string='Re-Open' states='paid'/>
                                 </group>
             <field name="res_model">account.invoice</field>
             <field name="view_type">form</field>
             <field name="view_mode">tree,form,calendar,graph</field>
-            <field name="domain">[('state','=','proforma'),('type','=','out_invoice')]</field>
+            <field name="domain">[('state','=','proforma2'),('type','=','out_invoice')]</field>
             <field name="context">{'type':'out_invoice'}</field>
         </record>
         <record id="action_invoice_tree6_view1" model="ir.actions.act_window.view">
index 0a60b30..3bd7d10 100644 (file)
 write({'state':'proforma'})</field>
             <field name="kind">function</field>
         </record>
+
+               <record id="act_proforma2" model="workflow.activity">
+            <field name="wkf_id" ref="account.wkf"/>
+            <field name="name">proforma2</field>
+            <field name="action">write({'state':'proforma2'})</field>
+            <field name="kind">function</field>
+        </record>
+
         <record id="act_open" model="workflow.activity">
             <field name="wkf_id" ref="wkf"/>
             <field name="name">open</field>
@@ -114,5 +122,31 @@ write({'state':'cancel'})</field>
                <field name="act_to" ref="act_cancel"/>
                <field name="signal">invoice_cancel</field>
            </record>
+
+               <record id="draft_to_pro2" model="workflow.transition">
+            <field name="act_from" ref="account.act_draft"/>
+            <field name="act_to" ref="act_proforma2"/>
+            <field name="signal">invoice_proforma2</field>
+        </record>
+
+        <record id="pro2_to_open" model="workflow.transition">
+            <field name="act_from" ref="act_proforma2"/>
+            <field name="act_to" ref="account.act_open"/>
+            <field name="signal">invoice_open</field>
+        </record>
+
+        <record id="pro2_to_paid" model="workflow.transition">
+            <field name="act_from" ref="act_proforma2"/>
+            <field name="act_to" ref="account.act_paid"/>
+            <field name="trigger_model">account.move.line</field>
+            <field name="trigger_expr_id">move_line_id_payment_get()</field>
+            <field name="condition">test_paid()</field>
+        </record>
+
+        <record id="pro2_to_cancel" model="workflow.transition">
+            <field name="act_from" ref="act_proforma2"/>
+            <field name="act_to" ref="account.act_cancel"/>
+            <field name="signal">invoice_cancel</field>
+        </record>
     </data>
 </openerp>
index 9ed14c0..299e592 100644 (file)
@@ -9,6 +9,7 @@
         <menuitem id="menu_analytic_accounting" name="Analytic Accounting" parent="menu_finance_configuration"/>
 
         <menuitem id="menu_finance_reporting" name="Reporting" parent="account.menu_finance" sequence="8"/>
+        <menuitem id="menu_finance_legal_statement" name="Legal Statements" parent="account.menu_finance" sequence="8"/>
 
         <menuitem id="menu_finance_entries" name="Entries Encoding" parent="account.menu_finance" sequence="2"/>
         <menuitem id="account.menu_finance_recurrent_entries" name="Recurrent Entries" parent="account.menu_finance_entries" sequence="15"/>
index 8d23f83..b81c624 100644 (file)
@@ -165,6 +165,7 @@ class account_invoice(osv.osv):
         'state': fields.selection([
             ('draft','Draft'),
             ('proforma','Pro-forma'),
+            ('proforma2','Pro-forma'),
             ('open','Open'),
             ('paid','Done'),
             ('cancel','Canceled')