import_cost_calculation.xml 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <openerp>
  3. <data>
  4. <record model="ir.ui.view" id="import_cost_form">
  5. <field name="name">import_cost_form</field>
  6. <field name="model">import.cost</field>
  7. <field name="arch" type="xml">
  8. <form string="Import">
  9. <header>
  10. <div class="import_cost_button" style="position:absolute"></div>
  11. <field name="state" widget="statusbar" statusbar_visible="draft,approved" statusbar_colors='{"draft":"red","approved":"blue"}'/>
  12. </header>
  13. <sheet>
  14. <h1>
  15. <label string="Importación "/>
  16. <field name="name" class="oe_inline" readonly="1"/>
  17. </h1>
  18. <group>
  19. <group>
  20. <field name="date"/>
  21. <field name="customs_broker"/>
  22. <field name="customs_clearance"/>
  23. <field name="note"/>
  24. </group>
  25. <group>
  26. <field name="product_qty" readonly="1"/>
  27. <field name="currency_id"/>
  28. <field name="weight" readonly="1"/>
  29. <field name="created_by" readonly="1"/>
  30. <field name="approved_by" readonly="1"/>
  31. </group>
  32. </group>
  33. <group string="Facturas de compras"></group>
  34. <group>
  35. <field name="purchases" nolabel="1" attrs="{'readonly': [('state','=', 'approved')]}">
  36. <tree string="Detalles" editable="bottom" >
  37. <field name="purchase_id" domain="['|',('origin', 'ilike', 'PO'),('origin', '!=', False),('type', '=', 'in_invoice'),('state','=','paid')]"/>
  38. <field name="product_qty" readonly="1"/>
  39. <field name="purchase_subtotal"/>
  40. <field name="purchase_taxes"/>
  41. <field name="purchase_total"/>
  42. </tree>
  43. </field>
  44. </group>
  45. <group class="oe_subtotal_footer" colspan="2" style="float:right; margin-right:10px !important">
  46. <field name="purchases_subtotal" widget='monetary'/>
  47. <field name="purchases_taxes" widget='monetary'/>
  48. <div class="oe_subtotal_footer_separator oe_inline">
  49. <label for="purchases_total"/>
  50. <button name="button_dummy"
  51. states="draft" string="Actualizar" type="object" class="oe_edit_only oe_link"/>
  52. </div>
  53. <field name="purchases_total" nolabel="1" class="oe_subtotal_footer_separator" widget='monetary'/>
  54. </group>
  55. <group string="Facturas de gastos"></group>
  56. <group>
  57. <field name="expenses" nolabel="1" attrs="{'readonly': [('state','=', 'approved')]}">
  58. <tree string="Detalles" editable="bottom" >
  59. <field name="expense_id" domain="['|',('origin', 'ilike', 'AA'),('origin', '=', False),('type', '=', 'in_invoice'),('state','=','paid')]"/>
  60. <field name="expense_subtotal"/>
  61. <field name="expense_taxes"/>
  62. <field name="expense_total"/>
  63. </tree>
  64. </field>
  65. </group>
  66. <group class="oe_subtotal_footer" colspan="2" style="float:right; margin-right:10px !important">
  67. <field name="expenses_subtotal" widget='monetary' />
  68. <field name="expenses_taxes" widget='monetary' />
  69. <div class="oe_subtotal_footer_separator oe_inline">
  70. <label for="expenses_total"/>
  71. <button name="button_dummy"
  72. states="draft,sent" string="Actualizar" type="object" class="oe_edit_only oe_link"/>
  73. </div>
  74. <field name="expenses_total" nolabel="1" class="oe_subtotal_footer_separator" widget='monetary'/>
  75. </group>
  76. </sheet>
  77. </form>
  78. </field>
  79. </record>
  80. <record model="ir.ui.view" id="import_cost_tree">
  81. <field name="name">import_cost_tree</field>
  82. <field name="model">import.cost</field>
  83. <field name="arch" type="xml">
  84. <tree string="Import Cost Tree" colors="grey:state=='draft';blue:state=='approved'">
  85. <field name="name" />
  86. <field name="date" />
  87. <field name="purchases_total" string="Total compra"/>
  88. <field name="expenses_total" string="Total gasto"/>
  89. <field name="factor" />
  90. <field name="state" />
  91. </tree>
  92. </field>
  93. </record>
  94. <record model="ir.actions.act_window" id="action_import_cost">
  95. <field name="name">Gastos de Importación</field>
  96. <field name="type">ir.actions.act_window</field>
  97. <field name="res_model">import.cost</field>
  98. <field name="view_type">form</field>
  99. <field name="view_mode">tree,form</field>
  100. </record>
  101. <menuitem name="Importación" id="import_main_menu" parent="expense_menu.expense_main_menu" sequence="20" />
  102. <menuitem name="Gastos de Importación" id="import_submenu_1" parent="import_main_menu" action="action_import_cost" />
  103. </data>
  104. </openerp>