work_logic_setting.xml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. <openerp>
  2. <data>
  3. <!-- explicit list view definition -->
  4. <record model="ir.ui.view" id="archives_work_logic_setting_list">
  5. <field name="name">控制设置列表</field>
  6. <field name="model">archives.work_logic_setting</field>
  7. <field name="arch" type="xml">
  8. <tree>
  9. <field name="name"/>
  10. <field name="available"/>
  11. <field name="module_id"/>
  12. <field name="model_id"/>
  13. <field name="run_before_method"/>
  14. <field name="not_replace_method"/>
  15. <field name="work_logic_type_id"/>
  16. </tree>
  17. </field>
  18. </record>
  19. <record model="ir.ui.view" id="archives_work_logic_setting_edit">
  20. <field name="name">控制设置新建</field>
  21. <field name="model">archives.work_logic_setting</field>
  22. <field name="arch" type="xml">
  23. <form>
  24. <header>
  25. <field name="id" attrs="{'invisible': True}"/>
  26. <field name="available" attrs="{'invisible': True}"/>
  27. </header>
  28. <sheet>
  29. <notebook>
  30. <page name="控制设置" string="控制设置">
  31. <group name="group_top" col="4">
  32. <field name="module_id" options="{'no_open':True,'no_create':True}"/>
  33. <field name="model_id" options="{'no_open':True,'no_create':True}"/>
  34. <field name="company_id" options="{'no_open':True,'no_create':True}" readonly="1"/>
  35. <field name="work_logic_type_id" options="{'no_open':True,'no_create':True}"/>
  36. <field name="run_before_method"/>
  37. <field name="not_replace_method"/>
  38. <field name="code_flag" options="{'no_open':True,'no_create':True}" invisible="1"/>
  39. <field name="code1_flag" options="{'no_open':True,'no_create':True}" invisible="1"/>
  40. <field name="code2_flag" options="{'no_open':True,'no_create':True}" invisible="1"/>
  41. <field name="code3_flag" options="{'no_open':True,'no_create':True}" invisible="1"/>
  42. <field name="code4_flag" options="{'no_open':True,'no_create':True}" invisible="1"/>
  43. <field name="code5_flag" options="{'no_open':True,'no_create':True}" invisible="1"/>
  44. <field name="code6_flag" options="{'no_open':True,'no_create':True}" invisible="1"/>
  45. <field name="code7_flag" options="{'no_open':True,'no_create':True}" invisible="1"/>
  46. <field name="code8_flag" options="{'no_open':True,'no_create':True}" invisible="1"/>
  47. <field name="code" widget="ace" options="{'mode': 'python'}" colspan="4"
  48. attrs="{'invisible': [('code_flag','!=',True)]}"/>
  49. <field name="code1" widget="ace" options="{'mode': 'python'}" colspan="4"
  50. attrs="{'invisible': [('code1_flag','!=',True)]}"/>
  51. <field name="code2" widget="ace" options="{'mode': 'python'}" colspan="4"
  52. attrs="{'invisible': [('code2_flag','!=',True)]}"/>
  53. <field name="code3" widget="ace" options="{'mode': 'python'}" colspan="4"
  54. attrs="{'invisible': [('code3_flag','!=',True)]}"/>
  55. <field name="code4" widget="ace" options="{'mode': 'python'}" colspan="4"
  56. attrs="{'invisible': [('code4_flag','!=',True)]}"/>
  57. <field name="code5" widget="ace" options="{'mode': 'python'}" colspan="4"
  58. attrs="{'invisible': [('code5_flag','!=',True)]}"/>
  59. <field name="code6" widget="ace" options="{'mode': 'python'}" colspan="4"
  60. attrs="{'invisible': [('code6_flag','!=',True)]}"/>
  61. <field name="code7" widget="ace" options="{'mode': 'python'}" colspan="4"
  62. attrs="{'invisible': [('code7_flag','!=',True)]}"/>
  63. <field name="code8" widget="ace" options="{'mode': 'python'}" colspan="4"
  64. attrs="{'invisible': [('code8_flag','!=',True)]}"/>
  65. </group>
  66. </page>
  67. <page string="字段对照">
  68. <group name="group_top" col="2">
  69. <field name="model_detail_id" options="{'no_open':True,'no_create':True}"/>
  70. <field name="field_contrast" colspan="4"/>
  71. </group>
  72. </page>
  73. <page string="说明">
  74. <field name="code_content" widget="ace" options="{'mode': 'python'}"/>
  75. <div style="color:rgb(170,170,170)">
  76. <div>
  77. <span style="color:red">事例:</span>
  78. </div>
  79. <div style="margin-left:16%">
  80. </div>
  81. <div>
  82. <div>
  83. <span style="color:black">1、[销售订单明细]{单价}不能低于{原价} 的比例
  84. 10(%)
  85. </span>
  86. <div>
  87. <div>if self.detail:</div>
  88. <div style="margin-left:20px">
  89. for rec in self.detail:
  90. </div>
  91. <div style="margin-left:40px">
  92. if rec.price &lt; rec.origin_price *0.1:
  93. </div>
  94. <div style="margin-left:60px">
  95. raise ValidationError('[销售订单明细]{单价}不能低于{原价} 的比例
  96. 10(%)')
  97. </div>
  98. </div>
  99. </div>
  100. <div>
  101. <span style="color:black">2、[销售订单明细]{单价}为0不能审核 :</span>
  102. </div>
  103. <div>
  104. <div>if self.detail:</div>
  105. <div style="margin-left:20px">
  106. for rec in self.detail:
  107. </div>
  108. <div style="margin-left:40px">
  109. if not rec.price:
  110. </div>
  111. <div style="margin-left:60px">
  112. raise ValidationError('[销售订单明细]{单价}为0不能审核')
  113. </div>
  114. </div>
  115. <div>
  116. <span style="color:black">3、[销售订单]保存时,明细产品不允许重复</span>
  117. </div>
  118. <div>
  119. <div>if self.detail:</div>
  120. <div style="margin-left:20px">
  121. ids = self.detail.mapped('goods_id').ids
  122. </div>
  123. <div style="margin-left:40px">
  124. if len(ids) != len(self.detail):
  125. </div>
  126. <div style="margin-left:60px">
  127. raise ValidationError('3、[销售订单]保存时,明细产品不允许重复')
  128. </div>
  129. </div>
  130. </div>
  131. </div>
  132. </page>
  133. </notebook>
  134. </sheet>
  135. </form>
  136. </field>
  137. </record>
  138. <record model="ir.ui.view" id="work_logic_setting_search_view">
  139. <field name="name">archives.work_logic_setting.search</field>
  140. <field name="model">archives.work_logic_setting</field>
  141. <field name="arch" type="xml">
  142. <search>
  143. <field name="name" filter_domain="['|', ('spell', 'ilike', self), ('name', 'ilike', self)]"/>
  144. <field name="module_id"/>
  145. <field name="model_id"/>
  146. <field name="work_logic_type_id"/>
  147. </search>
  148. </field>
  149. </record>
  150. <!-- actions opening views on models -->
  151. <record model="ir.actions.act_window" id="archives_work_logic_setting_action_window">
  152. <field name="name">控制设置</field>
  153. <field name="res_model">archives.work_logic_setting</field>
  154. <field name="view_mode">tree,form</field>
  155. </record>
  156. <!-- actions -->
  157. <menuitem name="控制设置" id="archives.menu_work_logic_setting" parent="archives.menu_system"
  158. action="archives_work_logic_setting_action_window" sequence="14"/>
  159. </data>
  160. </openerp>