Преглед изворни кода

[FIX] Simplificación en el formulario de nominas.

adrielso пре 6 година
родитељ
комит
d7b75ffd64

+ 0 - 1
.gitignore

@@ -1,2 +1 @@
 *.pyc
-.scannerwork

+ 2 - 2
static/src/css/style.css

@@ -46,8 +46,8 @@
     float: left;
 }
 .payslip-payment-unity {
-    width: auto !important;
-    height: auto !important;
+    width: auto;
+    float: left;
 }
 .label-descrip {
     float: left;

+ 3 - 3
static/src/js/payslip_payments_unity.js

@@ -296,15 +296,15 @@
 
                 if (openerp.widgetInstanceUnity) {
                     openerp.widgetInstanceUnity.updateId(record.id);
+                    if (this.$el.find('.payments-unity').length !== 0 )
+                        return;
                 }
 
                 if (this.$el.find('.payments-unity').length !== 0 )
                     return;
 
                 openerp.widgetInstanceUnity = new openerp.payslipPaymentsUnity(this);
-
-                var elemento = this.$el.find('.oe_form_sheet.oe_form_sheet_width');
-                elemento = elemento.find('.payslip-payment-unity');
+                var elemento = this.$el.find('.oe_form').find('.payslip-payment-unity');
 
                 openerp.widgetInstanceUnity.appendTo(elemento[0]);
                 openerp.widgetInstanceUnity.updateId(record.id);

+ 2 - 3
static/src/xml/eiru_payslip_payments_unity.xml

@@ -2,9 +2,8 @@
 
 <templates xml:space="preserve">
     <t t-name="eiru_payslip_payments.PayslipUnityWidget">
-        <button class="payments-unity oe_stat_button btn btn-default oe_inline">
-            <div class="stat_button_icon fa fa-money"></div>
-            <div>Pagar Nómina</div>
+        <button class="payments-unity oe_button oe_form_button oe_highlight">
+            <span>Pagar Nómina</span>
         </button>
   </t>
 </templates>

+ 27 - 3
view/payslip_payments.xml

@@ -18,10 +18,34 @@
 			<field name="model">hr.payslip</field>
 			<field name="inherit_id" ref="hr_payroll.view_hr_payslip_form"/>
 			<field name="arch" type="xml">
-				<xpath expr="//div[@class='oe_title']"  position="before">
-					<div class="oe_right oe_button_box payslip-payment-unity" attrs="{'invisible': [('state','!=','done')]}"></div>
-				</xpath>
+				<!-- from  -->
+				<form position="attributes">
+					<attribute name="create">0</attribute>
+				</form>
+				<!-- Payments pauslip -->
+				<field name="state" position="before">
+					<div class="payslip-payment-unity" attrs="{'invisible': [('state','!=','done')]}"></div>
+				</field>
+				<!-- Abono  -->
+				<field name="credit_note" position="replace"></field>
+				<!-- Factura crédito -->
+				<xpath expr="//button[@name='refund_sheet']" position="replace"></xpath>
 			</field>
 		</record>
+
+		<!--Tree -->
+		<record id="view_eiru_payment_payslip_unity_tree" model="ir.ui.view">
+			<field name="name">view.eiru.payment.payslip.unity.tree</field>
+			<field name="model">hr.payslip</field>
+			<field name="inherit_id" ref="hr_payroll.view_hr_payslip_tree"/>
+			<field name="arch" type="xml">
+				<!-- tree -->
+				<tree position="attributes">
+					<attribute name="create">0</attribute>
+				</tree>
+			</field>
+		</record>
+
+
 	</data>
 </openerp>