@@ -1052,6 +1052,7 @@
|
||||
<field name="signature">Administrator</field>
|
||||
<field name="address_id" ref="main_address"/>
|
||||
<field name="company_id" ref="main_company"/>
|
||||
<field name="menu_id" ref="action_menu_admin"/>
|
||||
<field name="company_ids" eval="[(4, ref('main_company'))]"/>
|
||||
</record>
|
||||
|
||||
|
||||
@@ -5,24 +5,24 @@
|
||||
<menuitem icon="terp-administration" id="menu_administration_shortcut" parent="menu_administration" name="Custom Shortcuts" sequence="50"/>
|
||||
<menuitem id="next_id_4" name="Low Level Objects"
|
||||
parent="base.menu_administration" sequence="3"
|
||||
groups="base.group_extended"/>
|
||||
<menuitem id="menu_low_workflow" name="Workflow Items" parent="base.next_id_4"/>
|
||||
groups="base.group_no_one"/>
|
||||
<menuitem id="menu_low_workflow" name="Workflows" parent="base.next_id_4"/>
|
||||
<menuitem id="menu_custom" name="Customization"
|
||||
parent="base.menu_administration" sequence="2"
|
||||
groups="base.group_extended"/>
|
||||
<menuitem id="menu_custom_action" name="Actions" parent="base.menu_custom" groups="base.group_extended" sequence="20"/>
|
||||
<menuitem id="menu_config" name="Configuration" parent="base.menu_administration" sequence="1"/>
|
||||
<menuitem id="menu_translation" name="Translations" parent="base.menu_administration" sequence="4"/>
|
||||
<menuitem id="menu_translation_app" name="Application Terms" parent="base.menu_translation" sequence="4"/>
|
||||
<menuitem id="menu_translation_app" name="Application Terms" parent="base.menu_translation" sequence="4" groups="base.group_extended"/>
|
||||
<menuitem id="menu_translation_export" name="Import / Export"
|
||||
groups="base.group_extended"
|
||||
parent="base.menu_translation" sequence="4"/>
|
||||
groups="base.group_extended" parent="base.menu_translation" sequence="3"/>
|
||||
<menuitem id="menu_users" name="Users" parent="base.menu_administration" sequence="6"/>
|
||||
<menuitem id="menu_security" name="Security" parent="base.menu_administration" sequence="8"
|
||||
groups="base.group_extended"/>
|
||||
<menuitem id="menu_management" name="Modules Management" parent="base.menu_administration" sequence="10"
|
||||
<menuitem id="menu_management" name="Modules" parent="base.menu_administration" sequence="10"
|
||||
groups="base.group_extended"/>
|
||||
<menuitem icon="terp-graph" id="reporting_menu" name="Reporting" sequence="45"
|
||||
groups="group_extended"/>
|
||||
<menuitem id="reporting_menu"
|
||||
parent="base.menu_custom" name="Reporting" sequence="30"
|
||||
/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -114,21 +114,30 @@
|
||||
<newline/>
|
||||
<notebook colspan="4">
|
||||
<page string="User">
|
||||
<field name="company_id" required="1"
|
||||
context="{'user_id': self, 'user_preference': 1}"
|
||||
on_change="on_change_company_id(company_id)"
|
||||
groups="base.group_multi_company"
|
||||
/>
|
||||
<field name="address_id" select="1"/>
|
||||
<field name="user_email" widget="email"/>
|
||||
<field name="context_lang"/>
|
||||
<field domain="[('usage','=','menu')]" name="menu_id" required="True"/>
|
||||
<field name="action_id"/>
|
||||
|
||||
|
||||
<field name="context_tz"/>
|
||||
<field name="view" readonly="0"/>
|
||||
<field name="menu_tips" colspan="2"/>
|
||||
<group colspan="1" col="2">
|
||||
<separator string="Contact" colspan="2"/>
|
||||
<field name="company_id" required="1"
|
||||
context="{'user_id': self, 'user_preference': 1}"
|
||||
on_change="on_change_company_id(company_id)"
|
||||
groups="base.group_multi_company"
|
||||
/>
|
||||
<field name="address_id"/>
|
||||
<field name="user_email" widget="email"/>
|
||||
</group>
|
||||
<group colspan="1" col="2" groups="base.group_extended">
|
||||
<separator string="Action" colspan="2"/>
|
||||
<field name="action_id"/>
|
||||
<field domain="[('usage','=','menu')]" name="menu_id" required="True"/>
|
||||
</group>
|
||||
<group colspan="1" col="2">
|
||||
<separator string="Preferences" colspan="2"/>
|
||||
<field name="context_lang"/>
|
||||
<field name="context_tz"/>
|
||||
<group colspan="2" col="4">
|
||||
<field name="view" readonly="0"/>
|
||||
<field name="menu_tips" colspan="2"/>
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Signature" colspan="2"/>
|
||||
@@ -142,7 +151,7 @@
|
||||
<page string="Roles">
|
||||
<field colspan="4" nolabel="1" name="roles_id"/>
|
||||
</page>
|
||||
<page string="Companies">
|
||||
<page string="Companies" groups="base.group_multi_company">
|
||||
<field colspan="4" nolabel="1" name="company_ids" select="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
@@ -157,8 +166,8 @@
|
||||
<tree string="Users">
|
||||
<field name="name"/>
|
||||
<field name="login"/>
|
||||
<field name="address_id" string="Address" />
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="context_lang"/>
|
||||
<field name="date"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -172,7 +181,7 @@
|
||||
<field name="name"/>
|
||||
<field name="login"/>
|
||||
<field name="address_id" string="Address"/>
|
||||
<field name="company_ids" string="Company"/>
|
||||
<field name="company_ids" string="Company" groups="base.group_multi_company"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -25,7 +25,6 @@ import ir_ui_menu
|
||||
import ir_ui_view
|
||||
import ir_default
|
||||
import ir_actions
|
||||
import ir_report_custom
|
||||
import ir_attachment
|
||||
import ir_cron
|
||||
import ir_filters
|
||||
|
||||
+256
-303
@@ -10,17 +10,41 @@
|
||||
<field name="priority">20</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Connect Events to Actions">
|
||||
<field name="name" required="1"/>
|
||||
<field name="model_id" on_change="onchange_object_id(model_id)"/>
|
||||
<field name="action_id" on_change="onchange_action_id(action_id)"/>
|
||||
<field name="key2" required="1"/>
|
||||
<field name="object" readonly="1"/>
|
||||
<field name="res_id"/>
|
||||
<field name="value_unpickle"/>
|
||||
<field name="meta_unpickle"/>
|
||||
<field name="name" required="1"/>
|
||||
<newline/>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Action Source" colspan="2"/>
|
||||
<field name="model_id" on_change="onchange_object_id(model_id)"/>
|
||||
<field name="res_id"/>
|
||||
<field name="key2" required="1"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Action To Launch" colspan="2"/>
|
||||
<field name="action_id" on_change="onchange_action_id(action_id)"/>
|
||||
|
||||
<field name="object" readonly="1"/>
|
||||
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator string="Values for Event Type" colspan="2"/>
|
||||
<label string="client_action_multi, client_action_relate" colspan="2"/>
|
||||
<label string="tree_but_action, client_print_multi" colspan="2"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Value"/>
|
||||
<field name="value_unpickle" nolabel="1" colspan="4"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string="Metadata"/>
|
||||
<field name="meta_unpickle" nolabel="1"/>
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<separator colspan="2" string=""/>
|
||||
<field name="user_id"/>
|
||||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
</form>
|
||||
</group>
|
||||
</form>
|
||||
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -47,12 +71,17 @@
|
||||
<field name="name"/>
|
||||
<field name="model"/>
|
||||
<field name="key2"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Object" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'model'}"/>
|
||||
<filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'key2'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="act_values_form_action" model="ir.actions.act_window">
|
||||
<field name="name">Client Actions</field>
|
||||
<field name="name">Client Events</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">ir.values</field>
|
||||
<field name="view_type">form</field>
|
||||
@@ -63,20 +92,20 @@
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window.view" id="action_values_tree_view">
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="values_view_tree_action"/>
|
||||
<field name="act_window_id" ref="act_values_form_action"/>
|
||||
</record>
|
||||
<field name="sequence" eval="1"/>
|
||||
<field name="view_mode">tree</field>
|
||||
<field name="view_id" ref="values_view_tree_action"/>
|
||||
<field name="act_window_id" ref="act_values_form_action"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window.view" id="action_values_form_view">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="values_view_form_action"/>
|
||||
<field name="act_window_id" ref="act_values_form_action"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.actions.act_window.view" id="action_values_form_view">
|
||||
<field name="sequence" eval="2"/>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="values_view_form_action"/>
|
||||
<field name="act_window_id" ref="act_values_form_action"/>
|
||||
</record>
|
||||
|
||||
<menuitem action="act_values_form_action" id="menu_values_form_action" parent="base.menu_custom_action"/>
|
||||
|
||||
|
||||
<!-- Values -->
|
||||
@@ -254,7 +283,7 @@
|
||||
</record>
|
||||
|
||||
<record id="ir_sequence_type" model="ir.actions.act_window">
|
||||
<field name="name">Sequence Types</field>
|
||||
<field name="name">Sequence Codes</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">ir.sequence.type</field>
|
||||
<field name="view_type">form</field>
|
||||
@@ -310,8 +339,9 @@
|
||||
<field name="view_id" ref="action_view_tree"/>
|
||||
<field name="search_view_id" ref="action_view_search"/>
|
||||
</record>
|
||||
<menuitem id="next_id_6" name="Actions" parent="base.next_id_4"/>
|
||||
<menuitem id="next_id_6" name="Actions" parent="base.next_id_4" sequence="1"/>
|
||||
<menuitem action="ir_sequence_actions" id="menu_ir_sequence_actions" parent="next_id_6"/>
|
||||
<menuitem action="act_values_form_action" id="menu_values_form_action" parent="next_id_6"/>
|
||||
|
||||
<!--Filters form view-->
|
||||
|
||||
@@ -321,10 +351,10 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Filters">
|
||||
<group colspan="4" >
|
||||
<group colspan="4" col="6" >
|
||||
<field name="name"/>
|
||||
<field name="user_id"/>
|
||||
<field name="model_id"/>
|
||||
<field name="user_id"/>
|
||||
</group>
|
||||
<group col="4" expand="1">
|
||||
<separator string="Domain" colspan="2" />
|
||||
@@ -362,13 +392,14 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Filters">
|
||||
<group colspan="4" col="10">
|
||||
<field name="name"/>
|
||||
<field name="user_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By" colspan="4">
|
||||
<filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
</group>
|
||||
<field name="name"/>
|
||||
<field name="user_id"/>
|
||||
<field name="model_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By" colspan="4">
|
||||
<filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -389,72 +420,18 @@
|
||||
<menuitem parent="base.next_id_6" name="Filters"
|
||||
id="menu_ir_filters" action="actions_ir_filters_view" />
|
||||
|
||||
|
||||
<record id="act_report_custom_view" model="ir.ui.view">
|
||||
<field name="name">ir.actions.report.custom</field>
|
||||
<field name="model">ir.actions.report.custom</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Report custom">
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="report_id"/>
|
||||
<field name="usage"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="act_report_custom_view_tree" model="ir.ui.view">
|
||||
<field name="name">ir.actions.report.custom.tree</field>
|
||||
<field name="model">ir.actions.report.custom</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Report custom">
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
<record id="act_report_custom_search_view" model="ir.ui.view">
|
||||
<field name="name">ir.actions.report.custom.search</field>
|
||||
<field name="model">ir.actions.report.custom</field>
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Report custom">
|
||||
<group colspan="4" col="10">
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By" colspan="4">
|
||||
<filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="ir_action_report_custom" model="ir.actions.act_window">
|
||||
<field name="name">Report Custom</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">ir.actions.report.custom</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="act_report_custom_view_tree"/>
|
||||
<field name="search_view_id" ref="act_report_custom_search_view"/>
|
||||
</record>
|
||||
<menuitem action="ir_action_report_custom" id="menu_ir_action_report_custom" parent="base.next_id_6"/>
|
||||
|
||||
<record id="act_report_xml_view" model="ir.ui.view">
|
||||
<field name="name">ir.actions.report.xml</field>
|
||||
<field name="model">ir.actions.report.xml</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Report xml">
|
||||
<form string="Report">
|
||||
<group col="6" colspan="4">
|
||||
<field name="name" select="1"/>
|
||||
<field name="model" select="1"/>
|
||||
<field name="type" select="1"/>
|
||||
<field name="usage"/>
|
||||
|
||||
<field name="report_name" select="1"/>
|
||||
<field name="usage"/>
|
||||
<field name="report_type"/>
|
||||
</group>
|
||||
|
||||
@@ -525,7 +502,7 @@
|
||||
</record>
|
||||
|
||||
<record id="ir_action_report_xml" model="ir.actions.act_window">
|
||||
<field name="name">Report Xml</field>
|
||||
<field name="name">Reports</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">ir.actions.report.xml</field>
|
||||
<field name="view_type">form</field>
|
||||
@@ -600,8 +577,6 @@
|
||||
</group>
|
||||
</page>
|
||||
<page string="Security">
|
||||
<separator colspan="4" string="Select Users" />
|
||||
<field colspan="4" name="default_user_ids" nolabel="1"/>
|
||||
<separator colspan="4" string="Select Groups" />
|
||||
<field name="groups_id" nolabel="1" colspan="4" />
|
||||
</page>
|
||||
@@ -668,10 +643,14 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Wizards">
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="wiz_name"/>
|
||||
<field name="multi"/>
|
||||
<group colspan="4" col="6">
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="wiz_name"/>
|
||||
</group>
|
||||
<group colspan="2" col="4">
|
||||
<field name="multi"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Security">
|
||||
<field colspan="4" name="groups_id" nolabel="1"/>
|
||||
@@ -826,29 +805,23 @@
|
||||
<search string="Role">
|
||||
<field name="name"/>
|
||||
<field name="parent_id"/>
|
||||
<field name="description"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="11" col="11" groups="base.group_extended">
|
||||
<filter string="Parent" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'parent_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_res_roles" model="ir.actions.act_window">
|
||||
<field name="name">Roles Structure</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">res.roles</field>
|
||||
<field name="view_type">tree</field>
|
||||
<field eval="[('parent_id','=',False)]" name="domain"/>
|
||||
</record>
|
||||
<menuitem action="action_res_roles"
|
||||
groups="base.group_extended"
|
||||
id="menu_action_res_roles" parent="base.menu_users"/>
|
||||
|
||||
<record id="action_res_roles_form" model="ir.actions.act_window">
|
||||
<record id="action_res_roles_form" model="ir.actions.act_window">
|
||||
<field name="name">Roles</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">res.roles</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="search_view_id" ref="view_roles_search"/>
|
||||
</record>
|
||||
<menuitem action="action_res_roles_form" id="menu_action_res_roles_form" parent="menu_action_res_roles"/>
|
||||
<menuitem action="action_res_roles_form" id="menu_action_res_roles_form" parent="base.menu_users"/>
|
||||
|
||||
<!-- View -->
|
||||
<record id="view_view_form" model="ir.ui.view">
|
||||
@@ -857,21 +830,25 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Views">
|
||||
<group colspan="2" col="2">
|
||||
<separator string="General" colspan="2"/>
|
||||
<field name="name" select="1"/>
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" select="1" colspan="6"/>
|
||||
<field name="type" select="1"/>
|
||||
<field name="model" select="1"/>
|
||||
<field name="priority"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Advanced" colspan="2"/>
|
||||
<field name="field_parent"/>
|
||||
<field name="inherit_id" select="1"/>
|
||||
<field name="xml_id" select="1"/>
|
||||
</group>
|
||||
<separator string="View architecture" colspan="4"/>
|
||||
<field colspan="4" nolabel="1" name="arch"/>
|
||||
<notebook colspan="4">
|
||||
<page string="Architecture">
|
||||
<field colspan="4" nolabel="1" name="arch"/>
|
||||
</page>
|
||||
<page string="Extra Info">
|
||||
<separator string="Advanced" colspan="4"/>
|
||||
<newline/>
|
||||
<field name="field_parent"/>
|
||||
<field name="inherit_id" select="1"/>
|
||||
<field name="xml_id" select="1"/>
|
||||
</page>
|
||||
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -898,6 +875,18 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Views">
|
||||
<filter icon="terp-stock_zoom"
|
||||
string="Search"
|
||||
domain="[('type', '=', 'search')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="gtk-indent"
|
||||
string="Tree"
|
||||
domain="[('type', '=', 'tree')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="gtk-new"
|
||||
string="Form"
|
||||
domain="[('type', '=','form')]"/>
|
||||
<newline/>
|
||||
<field name="name"/>
|
||||
<field name="type"/>
|
||||
<field name="model"/>
|
||||
@@ -905,7 +894,7 @@
|
||||
<field name="xml_id"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Object" icon="terp-stage" domain="[]" context="{'group_by':'model'}"/>
|
||||
<filter string="Object" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'model'}"/>
|
||||
<filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
|
||||
</group>
|
||||
</search>
|
||||
@@ -927,14 +916,12 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Attachments">
|
||||
<group colspan="4" col="2">
|
||||
<field name="name" select="1" />
|
||||
</group>
|
||||
<field name="name" />
|
||||
<field name="type"/>
|
||||
<notebook colspan="4">
|
||||
<page string="Attachment">
|
||||
<group col="4" colspan="4">
|
||||
<separator string="Data" colspan="2"/>
|
||||
<field name="type"/>
|
||||
<separator string="Data" colspan="4"/>
|
||||
<newline />
|
||||
<group col="2" colspan="4" attrs="{'invisible':[('type','=','url')]}">
|
||||
<field name="datas" filename="datas_fname"/>
|
||||
@@ -983,13 +970,21 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Attachments">
|
||||
<group colspan="4" col="10">
|
||||
<filter icon="terp-stage"
|
||||
string="URL"
|
||||
domain="[('type','=','url')]"/>
|
||||
<filter icon="terp-stock_align_left_24"
|
||||
string="Binary"
|
||||
domain="[('type','=','binary')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="datas_fname"/>
|
||||
<field name="type"/>
|
||||
<field name="datas_fname"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By" colspan="4">
|
||||
<filter string="File Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Creator" icon="terp-personal" domain="[]" context="{'group_by':'create_uid'}"/>
|
||||
<filter string="Month" help="Creation Month" icon="terp-go-month" domain="[]" context="{'group_by':'create_date'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -1005,106 +1000,6 @@
|
||||
</record>
|
||||
<menuitem action="action_attachment" id="menu_action_attachment" parent="base.next_id_4"/>
|
||||
|
||||
<!-- Report -->
|
||||
<record id="view_report_custom_fields_tree" model="ir.ui.view">
|
||||
<field name="name">ir.report.custom.fields.tree</field>
|
||||
<field name="model">ir.report.custom.fields</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Report Fields">
|
||||
<field name="sequence"/>
|
||||
<field name="name"/>
|
||||
<field name="width"/>
|
||||
<field name="field_child0"/>
|
||||
<field name="field_child1"/>
|
||||
<field name="field_child2"/>
|
||||
<field name="field_child3"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_report_custom_fields_form" model="ir.ui.view">
|
||||
<field name="name">ir.report.custom.fields</field>
|
||||
<field name="model">ir.report.custom.fields</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Report Fields">
|
||||
<field name="name"/>
|
||||
<field name="alignment"/>
|
||||
<field name="width"/>
|
||||
<field name="sequence"/>
|
||||
<newline/>
|
||||
<field name="bgcolor"/>
|
||||
<field name="fontcolor"/>
|
||||
<newline/>
|
||||
<field name="operation"/>
|
||||
<field name="groupby"/>
|
||||
<field name="cumulate"/>
|
||||
<newline/>
|
||||
<field domain="[('model_id','=',parent['model_id'])]" name="field_child0" on_change="onchange_field_child0(field_child0)"/>
|
||||
<field domain="[('model_id','=',parent['model_id'])]" name="fc0_operande"/>
|
||||
<field name="fc0_op"/>
|
||||
<field name="fc0_condition"/>
|
||||
<newline/>
|
||||
<field name="field_child1" on_change="onchange_field_child1(field_child1)"/>
|
||||
<field name="fc1_operande"/>
|
||||
<field name="fc1_op"/>
|
||||
<field name="fc1_condition"/>
|
||||
<newline/>
|
||||
<field name="field_child2" on_change="onchange_field_child2(field_child2)"/>
|
||||
<field name="fc2_operande"/>
|
||||
<field name="fc2_op"/>
|
||||
<field name="fc2_condition"/>
|
||||
<newline/>
|
||||
<field name="field_child3"/>
|
||||
<field name="fc3_operande"/>
|
||||
<field name="fc3_op"/>
|
||||
<field name="fc3_condition"/>
|
||||
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="view_report_custom_form" model="ir.ui.view">
|
||||
<field name="name">ir.report.custom</field>
|
||||
<field name="model">ir.report.custom</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Custom Report">
|
||||
<field name="name" select="1"/>
|
||||
<field name="model_id" on_change="onchange_model_id(model_id)" select="1"/>
|
||||
<field name="title"/>
|
||||
<field name="type"/>
|
||||
<field name="print_format"/>
|
||||
<field name="print_orientation"/>
|
||||
<field name="repeat_header"/>
|
||||
<field name="footer"/>
|
||||
<field name="sortby"/>
|
||||
<field name="field_parent"/>
|
||||
<field name="frequency"/>
|
||||
<field name="limitt"/>
|
||||
<field name="menu_id"/>
|
||||
<field colspan="4" name="fields_child0" widget="one2many_list"/>
|
||||
<field name="state" readonly="1" select="1"/>
|
||||
<group col="2" colspan="2">
|
||||
<button name="subscribe" states="unsubscribed" string="Subscribe Report" type="object"/>
|
||||
<button name="unsubscribe" states="subscribed" string="Unsubscribe Report" type="object"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_report_custom" model="ir.actions.act_window">
|
||||
<field name="name">Custom Report</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">ir.report.custom</field>
|
||||
<field name="view_type">tree</field>
|
||||
<field name="view_id" ref="view_report_custom_form"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
<menuitem name="Administration/Report/Report Custom" action="action_report_custom"/>
|
||||
-->
|
||||
|
||||
<!-- model -->
|
||||
<record id="view_model_form" model="ir.ui.view">
|
||||
<field name="name">ir.model.form</field>
|
||||
@@ -1155,7 +1050,7 @@
|
||||
<field name="translate"/>
|
||||
<field name="on_delete" attrs="{'readonly': [('ttype','!=','many2one')]}"/>
|
||||
</group>
|
||||
<separator string="Security on Groups" colspan="4"/>
|
||||
<separator string="Groups" colspan="4"/>
|
||||
<field name="groups" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
</field>
|
||||
@@ -1208,12 +1103,26 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Model Description">
|
||||
<filter icon="terp-camera_test"
|
||||
string="In Memory"
|
||||
domain="[('osv_memory', '=', True)]"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
||||
<filter icon="terp-stock_align_left_24"
|
||||
string="Custom"
|
||||
domain="[('state', '=', 'manual')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
|
||||
<filter icon="terp-translate"
|
||||
string="Base"
|
||||
domain="[('state', '=', 'base')]"/>
|
||||
|
||||
<separator orientation="vertical"/>
|
||||
|
||||
<field name="name"/>
|
||||
<field name="model"/>
|
||||
<field name="osv_memory"/>
|
||||
<field name="state"/>
|
||||
<field name="access_ids"/>
|
||||
<field name="info"/>
|
||||
|
||||
<newline/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -1225,12 +1134,12 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Fields">
|
||||
<group colspan="4" col="4">
|
||||
<field name="name" select="1"/>
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" select="1" />
|
||||
<field name="model_id" attrs="{'readonly': [('state','!=', 'manual')]}"/>
|
||||
<field name="field_description"/>
|
||||
<field name="state"/>
|
||||
</group>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Properties">
|
||||
<group colspan="2" col="2">
|
||||
@@ -1280,12 +1189,29 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Fields">
|
||||
<filter icon="terp-camera_test"
|
||||
string="Required"
|
||||
domain="[('required', '=', True)]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-stock_align_left_24"
|
||||
string="Readonly"
|
||||
domain="[('readonly', '=', True)]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter icon="terp-translate"
|
||||
string="Translate"
|
||||
domain="[('translate', '=', True)]"/>
|
||||
<newline/>
|
||||
<field name="name"/>
|
||||
<field name="field_description"/>
|
||||
<field name="model_id"/>
|
||||
<field name="ttype"/>
|
||||
<field name="required"/>
|
||||
<field name="readonly"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Object" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'model_id'}"/>
|
||||
</group>
|
||||
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -1328,6 +1254,10 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Module Data">
|
||||
<filter icon="terp-camera_test"
|
||||
string="Updatable"
|
||||
domain="[('noupdate', '=', False)]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="module"/>
|
||||
<field name="name"/>
|
||||
<field name="model"/>
|
||||
@@ -1335,8 +1265,8 @@
|
||||
<field name="noupdate"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Module" icon="terp-stage" domain="[]" context="{'group_by':'module'}"/>
|
||||
<filter string="Object" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'model'}"/>
|
||||
<filter string="Module" icon="terp-folder-blue" domain="[]" context="{'group_by':'module'}"/>
|
||||
<filter string="Object" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'model'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -1379,7 +1309,7 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Translations">
|
||||
<filter icon="terp-project"
|
||||
<filter icon="terp-document-new"
|
||||
string="Untranslated"
|
||||
domain="['|',('value', '=', False),('value','=','')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
@@ -1400,16 +1330,15 @@
|
||||
<field name="type"/>
|
||||
<field name="name"/>
|
||||
<field name="res_id"/>
|
||||
<group colspan="4" col="4">
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Source Term" colspan="2"/>
|
||||
<field name="src" nolabel="1" height="400"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Tranlsation Term" colspan="2"/>
|
||||
<field name="value" nolabel="1" height="400"/>
|
||||
</group>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Source Term" colspan="2"/>
|
||||
<field name="src" nolabel="1" height="400"/>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<separator string="Translation" colspan="2"/>
|
||||
<field name="value" nolabel="1" height="400"/>
|
||||
</group>
|
||||
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -1434,7 +1363,7 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_translation_tree"/>
|
||||
</record>
|
||||
<menuitem action="action_translation" id="menu_action_translation" parent="base.menu_translation_app"/>
|
||||
<menuitem action="action_translation" id="menu_action_translation" parent="base.menu_translation_app" />
|
||||
|
||||
<!--
|
||||
=============================================================
|
||||
@@ -1494,10 +1423,10 @@
|
||||
<field name="icon_pict" widget="picture" nolabel="1" colspan="2"/>
|
||||
</group>
|
||||
<notebook colspan="4">
|
||||
<page string="Security on Groups">
|
||||
<field name="groups_id" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
<page string="Groups">
|
||||
<field name="groups_id" colspan="4" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -1508,20 +1437,20 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Menu">
|
||||
<field name="name" string="Menu" />
|
||||
<field name="parent_id"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
<field name="name" string="Menu" />
|
||||
<field name="parent_id"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="grant_menu_access" model="ir.actions.act_window">
|
||||
<field name="name">Manage Menus</field>
|
||||
<field name="name">Menu Items</field>
|
||||
<field name="res_model">ir.ui.menu</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="edit_menu"/>
|
||||
<field name="search_view_id" ref="edit_menu_access_search"/>
|
||||
</record>
|
||||
<menuitem action="grant_menu_access" id="menu_grant_menu_access" parent="base.menu_security" sequence="1"/>
|
||||
<menuitem action="grant_menu_access" id="menu_grant_menu_access" parent="base.next_id_2" sequence="1"/>
|
||||
|
||||
<!--
|
||||
=============================================================
|
||||
@@ -1568,7 +1497,8 @@
|
||||
<separator string="Action to Trigger" colspan="4"/>
|
||||
<field name="model" groups="base.group_extended"/>
|
||||
<field name="function"/>
|
||||
<field colspan="4" name="args"/>
|
||||
<separator string="Arguments" colspan="4"/>
|
||||
<field colspan="4" name="args" nolabel="1"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</form>
|
||||
@@ -1587,8 +1517,8 @@
|
||||
<field name="active"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="User" icon="terp-personal-" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Next Call" icon="terp-go-month"
|
||||
<filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
|
||||
<filter string="Execution" icon="terp-go-month"
|
||||
domain="[]" context="{'group_by':'nextcall'}" />
|
||||
</group>
|
||||
</search>
|
||||
@@ -1617,7 +1547,7 @@
|
||||
<field name="view_id" ref="ir_cron_view_tree"/>
|
||||
</record>
|
||||
|
||||
<menuitem id="next_id_10" name="Scheduler" parent="base.menu_config"/>
|
||||
<menuitem id="next_id_10" name="Scheduler" parent="base.menu_config" groups="base.group_extended"/>
|
||||
<menuitem action="ir_cron_act" id="menu_ir_cron_act" parent="next_id_10"/>
|
||||
|
||||
|
||||
@@ -1643,14 +1573,18 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Access Controls">
|
||||
<field colspan="4" name="name"/>
|
||||
<field name="model_id"/>
|
||||
<field name="group_id"/>
|
||||
<newline/>
|
||||
<field name="perm_read"/>
|
||||
<field name="perm_write"/>
|
||||
<field name="perm_create"/>
|
||||
<field name="perm_unlink"/>
|
||||
<group col="6" colspan="4">
|
||||
<field name="name"/>
|
||||
<field name="model_id"/>
|
||||
<field name="group_id"/>
|
||||
</group>
|
||||
<separator string="Access" colspan="4"/>
|
||||
<group col="4" colspan="4">
|
||||
<field name="perm_read"/>
|
||||
<field name="perm_write"/>
|
||||
<field name="perm_create"/>
|
||||
<field name="perm_unlink"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -1660,9 +1594,22 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Access Controls">
|
||||
<field name="name"/>
|
||||
<field name="model_id"/>
|
||||
<field name="group_id"/>
|
||||
<group>
|
||||
<filter string="Global" icon="terp-stage" domain="[('group_id','=',False)]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Full Access" icon="terp-gtk-select-all" domain="[('perm_read','=',True),('perm_write','=',True),('perm_create','=',True),('perm_unlink','=',True)]"/>
|
||||
<filter string="Read Access" icon="terp-stock_align_left_24" domain="[('perm_read','=',True)]"/>
|
||||
<filter string="Write Access" icon="terp-tools" domain="[('perm_write','=',True)]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="model_id"/>
|
||||
<field name="group_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="11" col="11" groups="base.group_extended">
|
||||
<filter string="Group" icon="terp-personal" domain="[]" context="{'group_by':'group_id'}"/>
|
||||
<filter string="Object" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'model_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -1674,8 +1621,7 @@
|
||||
<field name="view_id" ref="ir_access_view_tree"/>
|
||||
<field name="search_view_id" ref="ir_access_view_search"/>
|
||||
</record>
|
||||
<menuitem name="Access Controls" id="menu_security_access" parent="menu_security" sequence="5"/>
|
||||
<menuitem action="ir_access_act" id="menu_ir_access_act" parent="menu_security_access"/>
|
||||
<menuitem action="ir_access_act" id="menu_ir_access_act" parent="base.menu_security"/>
|
||||
|
||||
<!-- Rules -->
|
||||
|
||||
@@ -1741,9 +1687,21 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Record rules">
|
||||
<field name="model_id"/>
|
||||
<field name="global"/>
|
||||
<field name="groups"/>
|
||||
<group>
|
||||
<filter string="Global" icon="terp-stage" domain="[('global','=',True)]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Full Access" icon="terp-gtk-select-all" domain="[('perm_read','=',True),('perm_write','=',True),('perm_create','=',True),('perm_unlink','=',True)]"/>
|
||||
<filter string="Read Access" icon="terp-stock_align_left_24" domain="[('perm_read','=',True)]"/>
|
||||
<filter string="Write Access" icon="terp-tools" domain="[('perm_write','=',True)]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="model_id"/>
|
||||
<field name="global"/>
|
||||
<field name="groups"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By..." colspan="11" col="11" groups="base.group_extended">
|
||||
<filter string="Object" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'model_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -1866,13 +1824,13 @@
|
||||
<field name="arch" type="xml">
|
||||
<search string="Server Actions">
|
||||
<group col="10" colspan="4">
|
||||
<field name="name"/>
|
||||
<field name="state"/>
|
||||
<field name="model_id"/>
|
||||
</group>
|
||||
<field name="name"/>
|
||||
<field name="state"/>
|
||||
<field name="model_id"/>
|
||||
</group>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By" colspan="4" col="4">
|
||||
<filter string="Action Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'state'}"/>
|
||||
<filter string="Action Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'state'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
@@ -1888,15 +1846,7 @@
|
||||
<field name="search_view_id" ref="view_server_action_search"/>
|
||||
<field name="context">{'key':'server_action'}</field>
|
||||
</record>
|
||||
<menuitem action="action_server_action" id="menu_server_action" parent="base.menu_custom_action"/>
|
||||
|
||||
<record model="ir.actions.act_window" id="action_model_grid_security">
|
||||
<field name="name">Access Controls Grid</field>
|
||||
<field name="res_model">ir.model.grid</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
</record>
|
||||
<menuitem action="action_model_grid_security" id="menu_ir_access_grid" parent="menu_security_access"/>
|
||||
<menuitem action="action_server_action" id="menu_server_action" parent="base.next_id_6"/>
|
||||
|
||||
<record id="ir_actions_todo_tree" model="ir.ui.view">
|
||||
<field name="model">ir.actions.todo</field>
|
||||
@@ -1908,8 +1858,10 @@
|
||||
<field name="action_id"/>
|
||||
<field name="restart"/>
|
||||
<field name="state" readonly="1"/>
|
||||
<button name="action_open" states="cancel,skip,done" string="Set as todo" type="object" icon="gtk-convert"/>
|
||||
<button name="action_launch" states="open" string="Launch this wizard" type="object" icon="gtk-execute"/>
|
||||
<button name="action_launch" states="open" string="Launch" type="object" icon="gtk-execute" help="Launch Configuration Wizard"/>
|
||||
<button name="action_open" states="cancel,skip,done"
|
||||
string="Todo" type="object" help="Set as Todo"
|
||||
icon="gtk-convert"/>
|
||||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
@@ -1929,8 +1881,10 @@
|
||||
<field name="groups_id" nolabel="1" colspan="4"/>
|
||||
<group colspan="4" col="4">
|
||||
<field name="state" colspan="2" readonly="1"/>
|
||||
<button name="action_launch" states="open" string="Launch" type="object" icon="gtk-execute" help="Launch this wizard"/>
|
||||
<button name="action_open" states="cancel,skip,done" string="Set as todo" type="object" icon="gtk-convert"/>
|
||||
<button name="action_launch" states="open" string="Launch" type="object" icon="gtk-execute" help="Launch Configuration Wizard"/>
|
||||
<button name="action_open" states="cancel,skip,done"
|
||||
string="Set as Todo" type="object"
|
||||
icon="gtk-convert"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
@@ -1942,8 +1896,8 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Search Actions">
|
||||
<filter string="To Do" name="todo" icon="terp-camera_test" domain=" ['|',('state','=','open'),'&',('state','=','skip'),('restart','=','onskip')]" help="Todo State Or (Skip State And Onskip Restart)"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="To Do" name="todo" icon="terp-camera_test" domain=" ['|',('state','=','open'),'&',('state','=','skip'),('restart','=','onskip')]" help="Todo State Or (Skip State And Onskip Restart)"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="state"/>
|
||||
<field name="restart"/>
|
||||
</search>
|
||||
@@ -1960,6 +1914,5 @@
|
||||
|
||||
<menuitem action="act_ir_actions_todo_form" id="menu_ir_actions_todo_form"
|
||||
parent="next_id_11" groups="base.group_extended" sequence="20"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -37,7 +37,7 @@ class actions(osv.osv):
|
||||
_table = 'ir_actions'
|
||||
_columns = {
|
||||
'name': fields.char('Action Name', required=True, size=64),
|
||||
'type': fields.char('Action Type', required=True, size=32),
|
||||
'type': fields.char('Action Type', required=True, size=32,readonly=True),
|
||||
'usage': fields.char('Action Usage', size=32),
|
||||
}
|
||||
_defaults = {
|
||||
@@ -45,23 +45,6 @@ class actions(osv.osv):
|
||||
}
|
||||
actions()
|
||||
|
||||
class report_custom(osv.osv):
|
||||
_name = 'ir.actions.report.custom'
|
||||
_table = 'ir_act_report_custom'
|
||||
_sequence = 'ir_actions_id_seq'
|
||||
_columns = {
|
||||
'name': fields.char('Report Name', size=64, required=True, translate=True),
|
||||
'type': fields.char('Report Type', size=32, required=True),
|
||||
'model':fields.char('Object', size=64, required=True),
|
||||
'report_id': fields.integer('Report Ref.', required=True),
|
||||
'usage': fields.char('Action Usage', size=32),
|
||||
'multi': fields.boolean('On multiple doc.', help="If set to true, the action will not be displayed on the right toolbar of a form view.")
|
||||
}
|
||||
_defaults = {
|
||||
'multi': lambda *a: False,
|
||||
'type': lambda *a: 'ir.actions.report.custom',
|
||||
}
|
||||
report_custom()
|
||||
|
||||
class report_xml(osv.osv):
|
||||
|
||||
@@ -259,7 +242,6 @@ class act_window(osv.osv):
|
||||
'search_view_id': fields.many2one('ir.ui.view', 'Search View Ref.'),
|
||||
'filter': fields.boolean('Filter'),
|
||||
'auto_search':fields.boolean('Auto Search'),
|
||||
'default_user_ids': fields.many2many('res.users', 'ir_act_window_user_rel', 'act_id', 'uid', 'Users'),
|
||||
'search_view' : fields.function(_search_view, type='text', method=True, string='Search View'),
|
||||
'menus': fields.char('Menus', size=4096),
|
||||
'help': fields.text('Action description',
|
||||
|
||||
@@ -47,15 +47,15 @@ class ir_cron(osv.osv, netsvc.Agent):
|
||||
'name': fields.char('Name', size=60, required=True),
|
||||
'user_id': fields.many2one('res.users', 'User', required=True),
|
||||
'active': fields.boolean('Active'),
|
||||
'interval_number': fields.integer('Interval Number'),
|
||||
'interval_number': fields.integer('Interval Number',help="Repeat every x."),
|
||||
'interval_type': fields.selection( [('minutes', 'Minutes'),
|
||||
('hours', 'Hours'), ('work_days','Work Days'), ('days', 'Days'),('weeks', 'Weeks'), ('months', 'Months')], 'Interval Unit'),
|
||||
'numbercall': fields.integer('Number of Calls', help='Number of time the function is called,\na negative number indicates that the function will always be called'),
|
||||
'doall' : fields.boolean('Repeat Missed'),
|
||||
'nextcall' : fields.datetime('Next Call Date', required=True),
|
||||
'model': fields.char('Object', size=64),
|
||||
'function': fields.char('Function', size=64),
|
||||
'args': fields.text('Arguments'),
|
||||
'numbercall': fields.integer('Number of Calls', help='Number of time the function is called,\na negative number indicates no limit'),
|
||||
'doall' : fields.boolean('Repeat Missed', help="Enable this if you want to execute missed occurences as soon as the server restarts."),
|
||||
'nextcall' : fields.datetime('Next Execution Date', required=True, help="Next planned execution date for this scheduler"),
|
||||
'model': fields.char('Object', size=64, help="Name of object whose function will be called when this scheduler will run. e.g. 'res.partener'"),
|
||||
'function': fields.char('Function', size=64, help="Name of the method to be called on the object when this scheduler is executed."),
|
||||
'args': fields.text('Arguments', help="Arguments to be passed to the method. e.g. (uid,)"),
|
||||
'priority': fields.integer('Priority', help='0=Very Urgent\n10=Not urgent')
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ class ir_filters(osv.osv):
|
||||
'user_id':fields.many2one('res.users', 'User', help='False means for every user'),
|
||||
'domain': fields.text('Domain Value', required=True),
|
||||
'context': fields.text('Context Value', required=True),
|
||||
'model_id': fields.selection(_list_all_models, 'Model', required=True),
|
||||
'model_id': fields.selection(_list_all_models, 'Object', required=True),
|
||||
}
|
||||
|
||||
ir_filters()
|
||||
|
||||
@@ -63,6 +63,7 @@ class ir_model(osv.osv):
|
||||
is_osv_mem = self._is_osv_memory(cr, uid, all_model_ids, 'osv_memory', arg=None, context=context)
|
||||
return [('id', 'in', [id for id in is_osv_mem if bool(is_osv_mem[id]) == value])]
|
||||
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Object Name', size=64, translate=True, required=True),
|
||||
'model': fields.char('Object', size=64, required=True, select=1),
|
||||
@@ -142,103 +143,6 @@ class ir_model(osv.osv):
|
||||
x_custom_model._rec_name = x_name
|
||||
ir_model()
|
||||
|
||||
|
||||
class ir_model_grid(osv.osv):
|
||||
_name = 'ir.model.grid'
|
||||
_table = 'ir_model'
|
||||
_inherit = 'ir.model'
|
||||
_description = "Objects Security Grid"
|
||||
|
||||
def create(self, cr, uid, vals, context=None):
|
||||
raise osv.except_osv('Error !', 'You cannot add an entry to this view !')
|
||||
|
||||
def unlink(self, *args, **argv):
|
||||
raise osv.except_osv('Error !', 'You cannot delete an entry of this view !')
|
||||
|
||||
def read(self, cr, uid, ids, fields=None, context=None, load='_classic_read'):
|
||||
result = super(osv.osv, self).read(cr, uid, ids, fields, context, load)
|
||||
allgr = self.pool.get('res.groups').search(cr, uid, [], context=context)
|
||||
acc_obj = self.pool.get('ir.model.access')
|
||||
|
||||
if not isinstance(result,list):
|
||||
result=[result]
|
||||
|
||||
for res in result:
|
||||
rules = acc_obj.search(cr, uid, [('model_id', '=', res['id'])])
|
||||
rules_br = acc_obj.browse(cr, uid, rules, context=context)
|
||||
for g in allgr:
|
||||
res['group_'+str(g)] = ''
|
||||
for rule in rules_br:
|
||||
perm_list = []
|
||||
if rule.perm_read:
|
||||
perm_list.append('r')
|
||||
if rule.perm_write:
|
||||
perm_list.append('w')
|
||||
if rule.perm_create:
|
||||
perm_list.append('c')
|
||||
if rule.perm_unlink:
|
||||
perm_list.append('u')
|
||||
perms = ",".join(perm_list)
|
||||
if rule.group_id:
|
||||
res['group_%d'%rule.group_id.id] = perms
|
||||
else:
|
||||
res['group_0'] = perms
|
||||
return result
|
||||
|
||||
#
|
||||
# This function do not write fields from ir.model because
|
||||
# access rights may be different for managing models and
|
||||
# access rights
|
||||
#
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
vals_new = vals.copy()
|
||||
acc_obj = self.pool.get('ir.model.access')
|
||||
for grid in self.browse(cr, uid, ids, context=context):
|
||||
model_id = grid.id
|
||||
perms_rel = ['read','write','create','unlink']
|
||||
for val in vals:
|
||||
if not val[:6]=='group_':
|
||||
continue
|
||||
group_id = int(val[6:]) or False
|
||||
rules = acc_obj.search(cr, uid, [('model_id', '=', model_id),('group_id', '=', group_id)])
|
||||
if not rules:
|
||||
rules = [acc_obj.create(cr, uid, {
|
||||
'name': grid.name,
|
||||
'model_id':model_id,
|
||||
'group_id':group_id
|
||||
}) ]
|
||||
vals2 = dict(map(lambda x: ('perm_'+x, x[0] in (vals[val] or '')), perms_rel))
|
||||
acc_obj.write(cr, uid, rules, vals2, context=context)
|
||||
return True
|
||||
|
||||
def fields_get(self, cr, uid, fields=None, context=None):
|
||||
result = super(ir_model_grid, self).fields_get(cr, uid, fields, context)
|
||||
groups = self.pool.get('res.groups').search(cr, uid, [])
|
||||
groups_br = self.pool.get('res.groups').browse(cr, uid, groups)
|
||||
result['group_0'] = {'string': 'All Users','type': 'char','size': 7}
|
||||
for group in groups_br:
|
||||
result['group_%d'%group.id] = {'string': '%s'%group.name,'type': 'char','size': 7}
|
||||
return result
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context={}, toolbar=False, submenu=False):
|
||||
result = super(ir_model_grid, self).fields_view_get(cr, uid, view_id, view_type, context=context, toolbar=toolbar, submenu=submenu)
|
||||
groups = self.pool.get('res.groups').search(cr, uid, [])
|
||||
groups_br = self.pool.get('res.groups').browse(cr, uid, groups)
|
||||
cols = ['model', 'name']
|
||||
xml = '''<?xml version="1.0"?>
|
||||
<%s editable="bottom">
|
||||
<field name="name" select="1" readonly="1" required="1"/>
|
||||
<field name="model" select="1" readonly="1" required="1"/>
|
||||
<field name="group_0"/>
|
||||
''' % (view_type,)
|
||||
for group in groups_br:
|
||||
xml += '''<field name="group_%d"/>''' % (group.id, )
|
||||
xml += '''</%s>''' % (view_type,)
|
||||
result['arch'] = xml
|
||||
result['fields'] = self.fields_get(cr, uid, cols, context)
|
||||
return result
|
||||
ir_model_grid()
|
||||
|
||||
class ir_model_fields(osv.osv):
|
||||
_name = 'ir.model.fields'
|
||||
_description = "Fields"
|
||||
@@ -327,7 +231,7 @@ class ir_model_access(osv.osv):
|
||||
'perm_read': fields.boolean('Read Access'),
|
||||
'perm_write': fields.boolean('Write Access'),
|
||||
'perm_create': fields.boolean('Create Access'),
|
||||
'perm_unlink': fields.boolean('Delete Permission'),
|
||||
'perm_unlink': fields.boolean('Delete Access'),
|
||||
}
|
||||
|
||||
def check_groups(self, cr, uid, group):
|
||||
|
||||
@@ -1,206 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
from osv import fields,osv
|
||||
from osv.orm import browse_null
|
||||
import ir
|
||||
import report.custom
|
||||
from tools.translate import _
|
||||
from tools.safe_eval import safe_eval as eval
|
||||
import netsvc
|
||||
|
||||
class report_custom(osv.osv):
|
||||
_name = 'ir.report.custom'
|
||||
_columns = {
|
||||
'name': fields.char('Report Name', size=64, required=True, translate=True),
|
||||
'model_id': fields.many2one('ir.model','Object', required=True, change_default=True),
|
||||
'type': fields.selection([('table','Tabular'),('pie','Pie Chart'),('bar','Bar Chart'),('line','Line Plot')], "Report Type", size=64, required='True'),
|
||||
'title': fields.char("Report Title", size=64, required='True', translate=True),
|
||||
'print_format': fields.selection((('A4','a4'),('A5','a5')), 'Print format', required=True),
|
||||
'print_orientation': fields.selection((('landscape','Landscape'),('portrait','Portrait')), 'Print orientation', required=True, size=16),
|
||||
'repeat_header': fields.boolean('Repeat Header'),
|
||||
'footer': fields.char('Report Footer', size=64, required=True),
|
||||
'sortby': fields.char('Sorted By', size=64),
|
||||
'fields_child0': fields.one2many('ir.report.custom.fields', 'report_id','Fields', required=True),
|
||||
'field_parent': fields.many2one('ir.model.fields','Child Field'),
|
||||
'state': fields.selection([('unsubscribed','Unsubscribed'),('subscribed','Subscribed')], 'State', size=64),
|
||||
'frequency': fields.selection([('Y','Yearly'),('M','Monthly'),('D','Daily')], 'Frequency', size=64),
|
||||
'limitt': fields.char('Limit', size=9),
|
||||
'menu_id': fields.many2one('ir.ui.menu', 'Menu')
|
||||
}
|
||||
_defaults = {
|
||||
'print_format': lambda *a: 'A4',
|
||||
'print_orientation': lambda *a: 'portrait',
|
||||
'state': lambda *a: 'unsubscribed',
|
||||
'type': lambda *a: 'table',
|
||||
'footer': lambda *a: 'Generated by OpenERP'
|
||||
}
|
||||
|
||||
def onchange_model_id(self, cr, uid, ids, model_id):
|
||||
if not(model_id):
|
||||
return {}
|
||||
return {'domain': {'field_parent': [('model_id','=',model_id)]}}
|
||||
|
||||
def unsubscribe(self, cr, uid, ids, context={}):
|
||||
#TODO: should delete the ir.actions.report.custom for these reports and do an ir_del
|
||||
self.write(cr, uid, ids, {'state':'unsubscribed'})
|
||||
return True
|
||||
|
||||
def subscribe(self, cr, uid, ids, context={}):
|
||||
for report in self.browse(cr, uid, ids):
|
||||
report.fields_child0.sort(lambda x,y : x.sequence - y.sequence)
|
||||
|
||||
# required on field0 does not seem to work( cause we use o2m_l ?)
|
||||
if not report.fields_child0:
|
||||
raise osv.except_osv(_('Invalid operation'), _('Enter at least one field !'))
|
||||
|
||||
if report.type in ['pie', 'bar', 'line'] and report.field_parent:
|
||||
raise osv.except_osv(_('Invalid operation'), _('Tree can only be used in tabular reports'))
|
||||
|
||||
# Otherwise it won't build a good tree. See level.pop in custom.py.
|
||||
if report.type == 'table' and report.field_parent and report.fields_child0 and not report.fields_child0[0].groupby:
|
||||
raise osv.except_osv('Invalid operation :', 'When creating tree (field child) report, data must be group by the first field')
|
||||
|
||||
if report.type == 'pie':
|
||||
if len(report.fields_child0) != 2:
|
||||
raise osv.except_osv(_('Invalid operation'), _('Pie charts need exactly two fields'))
|
||||
else:
|
||||
c_f = {}
|
||||
for i in range(2):
|
||||
c_f[i] = []
|
||||
tmp = report.fields_child0[i]
|
||||
for j in range(3):
|
||||
c_f[i].append((not isinstance(eval('tmp.field_child'+str(j),{},{'tmp':tmp}), browse_null) and eval('tmp.field_child'+str(j)+'.ttype',{},{'tmp':tmp})) or None)
|
||||
if not reduce(lambda x,y : x or y, map(lambda x: x in ['integer', 'float'], c_f[1])):
|
||||
raise osv.except_osv(_('Invalid operation'), _('Second field should be figures'))
|
||||
|
||||
if report.type == 'bar':
|
||||
if len(report.fields_child0) < 2:
|
||||
raise osv.except_osv(_('Invalid operation'), _('Bar charts need at least two fields'))
|
||||
else:
|
||||
c_f = {}
|
||||
for i in range(len(report.fields_child0)):
|
||||
c_f[i] = []
|
||||
tmp = report.fields_child0[i]
|
||||
for j in range(3):
|
||||
c_f[i].append((not isinstance(eval('tmp.field_child'+str(j),{},{'tmp':tmp}), browse_null) and eval('tmp.field_child'+str(j)+'.ttype',{},{'tmp':tmp})) or None)
|
||||
|
||||
if i == 0:
|
||||
pass
|
||||
else:
|
||||
if not reduce(lambda x,y : x or y, map(lambda x: x in ['integer', 'float'], c_f[i])):
|
||||
raise osv.except_osv(_('Invalid operation'), _('Field %d should be a figure') %(i,))
|
||||
|
||||
if report.state=='subscribed':
|
||||
continue
|
||||
|
||||
name = report.name
|
||||
model = report.model_id.model
|
||||
|
||||
action_def = {'report_id':report.id, 'type':'ir.actions.report.custom', 'model':model, 'name':name}
|
||||
id = self.pool.get('ir.actions.report.custom').create(cr, uid, action_def)
|
||||
m_id = report.menu_id.id
|
||||
action = "ir.actions.report.custom,%d" % (id,)
|
||||
if not report.menu_id:
|
||||
ir.ir_set(cr, uid, 'action', 'client_print_multi', name, [(model, False)], action, False, True)
|
||||
else:
|
||||
ir.ir_set(cr, uid, 'action', 'tree_but_open', 'Menuitem', [('ir.ui.menu', int(m_id))], action, False, True)
|
||||
|
||||
self.write(cr, uid, [report.id], {'state':'subscribed'}, context)
|
||||
return True
|
||||
report_custom()
|
||||
|
||||
|
||||
class report_custom_fields(osv.osv):
|
||||
_name = 'ir.report.custom.fields'
|
||||
_columns = {
|
||||
'name': fields.char('Name', size=64, required=True),
|
||||
'report_id': fields.many2one('ir.report.custom', 'Report Ref', select=True),
|
||||
'field_child0': fields.many2one('ir.model.fields', 'Field child0', required=True),
|
||||
'fc0_operande': fields.many2one('ir.model.fields', 'Constraint'),
|
||||
'fc0_condition': fields.char('Condition', size=64),
|
||||
'fc0_op': fields.selection((('>','>'),('<','<'),('==','='),('in','in'),('gety,==','(year)=')), 'Relation'),
|
||||
'field_child1': fields.many2one('ir.model.fields', 'Field child1'),
|
||||
'fc1_operande': fields.many2one('ir.model.fields', 'Constraint'),
|
||||
'fc1_condition': fields.char('condition', size=64),
|
||||
'fc1_op': fields.selection((('>','>'),('<','<'),('==','='),('in','in'),('gety,==','(year)=')), 'Relation'),
|
||||
'field_child2': fields.many2one('ir.model.fields', 'Field child2'),
|
||||
'fc2_operande': fields.many2one('ir.model.fields', 'Constraint'),
|
||||
'fc2_condition': fields.char('condition', size=64),
|
||||
'fc2_op': fields.selection((('>','>'),('<','<'),('==','='),('in','in'),('gety,==','(year)=')), 'Relation'),
|
||||
'field_child3': fields.many2one('ir.model.fields', 'Field child3'),
|
||||
'fc3_operande': fields.many2one('ir.model.fields', 'Constraint'),
|
||||
'fc3_condition': fields.char('condition', size=64),
|
||||
'fc3_op': fields.selection((('>','>'),('<','<'),('==','='),('in','in'),('gety,==','(year)=')), 'Relation'),
|
||||
'alignment': fields.selection((('left','left'),('right','right'),('center','center')), 'Alignment', required=True),
|
||||
'sequence': fields.integer('Sequence', required=True),
|
||||
'width': fields.integer('Fixed Width'),
|
||||
'operation': fields.selection((('none', 'None'),('calc_sum','Calculate Sum'),('calc_avg','Calculate Average'),('calc_count','Calculate Count'),('calc_max', 'Get Max'))),
|
||||
'groupby' : fields.boolean('Group By'),
|
||||
'bgcolor': fields.char('Background Color', size=64),
|
||||
'fontcolor': fields.char('Font color', size=64),
|
||||
'cumulate': fields.boolean('Accumulate')
|
||||
}
|
||||
_defaults = {
|
||||
'alignment': lambda *a: 'left',
|
||||
'bgcolor': lambda *a: 'white',
|
||||
'fontcolor': lambda *a: 'black',
|
||||
'operation': lambda *a: 'none',
|
||||
}
|
||||
_order = "sequence"
|
||||
|
||||
def onchange_any_field_child(self, cr, uid, ids, field_id, level):
|
||||
if not(field_id):
|
||||
return {}
|
||||
next_level_field_name = 'field_child%d' % (level+1)
|
||||
next_level_operande = 'fc%d_operande' % (level+1)
|
||||
field = self.pool.get('ir.model.fields').browse(cr, uid, [field_id])[0]
|
||||
res = self.pool.get(field.model).fields_get(cr, uid, field.name)
|
||||
if res[field.name].has_key('relation'):
|
||||
cr.execute('select id from ir_model where model=%s', (res[field.name]['relation'],))
|
||||
(id,) = cr.fetchone() or (False,)
|
||||
if id:
|
||||
return {
|
||||
'domain': {
|
||||
next_level_field_name: [('model_id', '=', id)],
|
||||
next_level_operande: [('model_id', '=', id)]
|
||||
},
|
||||
'required': {
|
||||
next_level_field_name: True
|
||||
}
|
||||
}
|
||||
else:
|
||||
netsvc.Logger().notifyChannel('web-services', netsvc.LOG_WARNING, _("Using a relation field which uses an unknown object"))
|
||||
return {'required': {next_level_field_name: True}}
|
||||
else:
|
||||
return {'domain': {next_level_field_name: []}}
|
||||
|
||||
def get_field_child_onchange_method(level):
|
||||
return lambda self, cr, uid, ids, field_id: self.onchange_any_field_child(cr, uid, ids, field_id, level)
|
||||
|
||||
onchange_field_child0 = get_field_child_onchange_method(0)
|
||||
onchange_field_child1 = get_field_child_onchange_method(1)
|
||||
onchange_field_child2 = get_field_child_onchange_method(2)
|
||||
report_custom_fields()
|
||||
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -125,7 +125,6 @@ class ir_ui_menu(osv.osv):
|
||||
data = menu.action
|
||||
if data:
|
||||
model_field = { 'ir.actions.act_window': 'res_model',
|
||||
'ir.actions.report.custom': 'model',
|
||||
'ir.actions.report.xml': 'model',
|
||||
'ir.actions.wizard': 'model',
|
||||
'ir.actions.server': 'model_id',
|
||||
@@ -272,7 +271,6 @@ class ir_ui_menu(osv.osv):
|
||||
'action': fields.function(_action, fnct_inv=_action_inv,
|
||||
method=True, type='reference', string='Action',
|
||||
selection=[
|
||||
('ir.actions.report.custom', 'ir.actions.report.custom'),
|
||||
('ir.actions.report.xml', 'ir.actions.report.xml'),
|
||||
('ir.actions.act_window', 'ir.actions.act_window'),
|
||||
('ir.actions.wizard', 'ir.actions.wizard'),
|
||||
|
||||
@@ -55,7 +55,7 @@ class view(osv.osv):
|
||||
_columns = {
|
||||
'name': fields.char('View Name',size=64, required=True),
|
||||
'model': fields.char('Object', size=64, required=True),
|
||||
'priority': fields.integer('Priority', required=True),
|
||||
'priority': fields.integer('Sequence', required=True),
|
||||
'type': fields.selection((
|
||||
('tree','Tree'),
|
||||
('form','Form'),
|
||||
@@ -212,7 +212,7 @@ class view_sc(osv.osv):
|
||||
_sql_constraints = [
|
||||
('shortcut_unique', 'unique(res_id, resource, user_id)', 'Shortcut for this menu already exists!'),
|
||||
]
|
||||
|
||||
|
||||
view_sc()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
@@ -176,7 +176,7 @@ class ir_values(osv.osv):
|
||||
where.append('res_id=%s')
|
||||
params.append(res_id)
|
||||
|
||||
where.append('(user_id=%s or (user_id IS NULL))')
|
||||
where.append('(user_id=%s or (user_id IS NULL)) order by id')
|
||||
params.append(uid)
|
||||
clause = ' and '.join(where)
|
||||
cr.execute('select id,name,value,object,meta, key from ir_values where ' + clause, params)
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#
|
||||
##############################################################################
|
||||
import wizard_menu
|
||||
import wizard_screen
|
||||
import create_action
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
|
||||
@@ -0,0 +1,48 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
# Copyright (C) 2010 OpenERP s.a. (<http://www.openerp.com>).
|
||||
#
|
||||
# This program is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Affero General Public License as
|
||||
# published by the Free Software Foundation, either version 3 of the
|
||||
# License, or (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
import base64
|
||||
import os
|
||||
import random
|
||||
|
||||
import tools
|
||||
from osv import fields,osv
|
||||
|
||||
# Simple base class for wizards that wish to use random images on the left
|
||||
# side of the form.
|
||||
class wizard_screen(osv.osv_memory):
|
||||
_name = 'ir.wizard.screen'
|
||||
|
||||
def _get_image(self, cr, uid, context=None):
|
||||
path = os.path.join('base','res','config_pixmaps','%d.png'%random.randrange(1,4))
|
||||
file_data = tools.file_open(path,'rb').read()
|
||||
return base64.encodestring(file_data)
|
||||
|
||||
def _get_image_fn(self, cr, uid, ids, name, args, context=None):
|
||||
image = self._get_image(cr, uid, context)
|
||||
return dict.fromkeys(ids, image) # ok to use .fromkeys() as the image is same for all
|
||||
|
||||
_columns = {
|
||||
'config_logo': fields.function(_get_image_fn, string='Image', type='binary', method=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'config_logo': _get_image
|
||||
}
|
||||
wizard_screen()
|
||||
@@ -171,7 +171,6 @@ class wkf_instance(osv.osv):
|
||||
_log_access = False
|
||||
_columns = {
|
||||
'wkf_id': fields.many2one('workflow', 'Workflow', ondelete='cascade', select=True),
|
||||
'uid': fields.integer('User ID'),
|
||||
'res_id': fields.integer('Resource ID', select=True),
|
||||
'res_type': fields.char('Resource Object', size=64, select=True),
|
||||
'state': fields.char('State', size=32, select=True),
|
||||
@@ -194,6 +193,7 @@ class wkf_workitem(osv.osv):
|
||||
_rec_name = 'state'
|
||||
_columns = {
|
||||
'act_id': fields.many2one('workflow.activity', 'Activity', required=True, ondelete="cascade", select=True),
|
||||
'wkf_id': fields.related('act_id','wkf_id', type='many2one', relation='workflow', string='Workflow'),
|
||||
'subflow_id': fields.many2one('workflow.instance', 'Subflow', ondelete="cascade", select=True),
|
||||
'inst_id': fields.many2one('workflow.instance', 'Instance', required=True, ondelete="cascade", select=True),
|
||||
'state': fields.char('State', size=64, select=True),
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<menuitem id="menu_workflow_root" name="Workflow Definitions" parent="base.menu_custom" groups="base.group_extended"/>
|
||||
<menuitem id="menu_workflow_root" name="Workflows" parent="base.menu_custom" groups="base.group_extended"/>
|
||||
|
||||
<!--
|
||||
================================
|
||||
@@ -15,9 +15,11 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Workflow">
|
||||
<field name="name"/>
|
||||
<field name="osv"/>
|
||||
<field name="on_create"/>
|
||||
<group col="6" colspan="4" >
|
||||
<field name="name"/>
|
||||
<field name="osv"/>
|
||||
<field name="on_create"/>
|
||||
</group>
|
||||
<separator colspan="4" string="Activities"/>
|
||||
<field colspan="4" name="activities" nolabel="1"/>
|
||||
</form>
|
||||
@@ -92,10 +94,12 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Activity">
|
||||
<field name="name"/>
|
||||
<field name="wkf_id"/>
|
||||
<group colspan="4" col="7">
|
||||
<field name="kind" colspan="4"/>
|
||||
<group col="6" colspan="4">
|
||||
<field name="name"/>
|
||||
<field name="wkf_id"/>
|
||||
<field name="kind"/>
|
||||
</group>
|
||||
<group colspan="2">
|
||||
<field name="flow_start"/>
|
||||
<field name="flow_stop"/>
|
||||
</group>
|
||||
@@ -166,11 +170,20 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Workflow Activity">
|
||||
<filter icon="terp-camera_test" string="Flow Start"
|
||||
domain="[('flow_start', '=',True)]" />
|
||||
<filter icon="terp-gtk-stop" string="Flow Stop"
|
||||
domain="[('flow_stop', '=',True)]" />
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="wkf_id"/>
|
||||
<field name="kind"/>
|
||||
<field name="action_id"/>
|
||||
<field name="action"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By...">
|
||||
<filter string="Workflow" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'wkf_id'}"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -197,13 +210,15 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Transition">
|
||||
<field name="act_from"/>
|
||||
<field name="act_to"/>
|
||||
<field colspan="4" name="condition"/>
|
||||
<field name="signal"/>
|
||||
<field name="role_id"/>
|
||||
<field name="trigger_model"/>
|
||||
<field name="trigger_expr_id"/>
|
||||
<group col="6" colspan ="4">
|
||||
<field name="act_from"/>
|
||||
<field name="act_to"/>
|
||||
<field name="signal"/>
|
||||
<field name="condition"/>
|
||||
<field name="trigger_model"/>
|
||||
<field name="trigger_expr_id"/>
|
||||
<field name="role_id"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -229,6 +244,7 @@
|
||||
<search string="Transition">
|
||||
<field name="act_from"/>
|
||||
<field name="act_to"/>
|
||||
<field name="signal"/>
|
||||
<field name="condition"/>
|
||||
</search>
|
||||
</field>
|
||||
@@ -256,7 +272,6 @@
|
||||
<field name="arch" type="xml">
|
||||
<form string="Workflow Instances">
|
||||
<field name="wkf_id" readonly="1"/>
|
||||
<field name="uid" readonly="1"/>
|
||||
<field name="res_id" readonly="1"/>
|
||||
<field name="res_type" readonly="1"/>
|
||||
<field name="state" readonly="1"/>
|
||||
@@ -270,7 +285,6 @@
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Workflow Instances">
|
||||
<field name="wkf_id"/>
|
||||
<field name="uid"/>
|
||||
<field name="res_id"/>
|
||||
<field name="res_type"/>
|
||||
<field name="state"/>
|
||||
@@ -283,8 +297,9 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Workflow Instances">
|
||||
<field name="wkf_id"/>
|
||||
<field name="uid"/>
|
||||
<filter icon="terp-camera_test" string="Active" domain="[('state','=','active')]" name="active"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="wkf_id" widget="selection"/>
|
||||
<field name="res_id"/>
|
||||
<field name="res_type"/>
|
||||
<field name="state"/>
|
||||
@@ -297,6 +312,7 @@
|
||||
<field name="res_model">workflow.instance</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_workflow_instance_tree"/>
|
||||
<field name="context">{'search_default_active':1}</field>
|
||||
<field name="search_view_id" ref="view_workflow_instance_search"/>
|
||||
</record>
|
||||
<menuitem action="action_workflow_instance_form" id="menu_workflow_instance" parent="base.menu_low_workflow"/>
|
||||
@@ -313,6 +329,7 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Workflow Workitems">
|
||||
<field name="wkf_id" readonly="1"/>
|
||||
<field name="act_id" readonly="1"/>
|
||||
<field name="subflow_id" readonly="1"/>
|
||||
<field name="inst_id" readonly="1"/>
|
||||
@@ -326,6 +343,7 @@
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Workflow Workitems">
|
||||
<field name="wkf_id"/>
|
||||
<field name="act_id"/>
|
||||
<field name="subflow_id"/>
|
||||
<field name="inst_id"/>
|
||||
@@ -339,6 +357,9 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Workflow Workitems">
|
||||
<filter icon="terp-camera_test" string="Active" name="active" domain="[('state','=','active')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="wkf_id" widget="selection"/>
|
||||
<field name="act_id"/>
|
||||
<field name="subflow_id"/>
|
||||
<field name="inst_id"/>
|
||||
@@ -352,6 +373,7 @@
|
||||
<field name="res_model">workflow.workitem</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="view_workflow_workitem_tree"/>
|
||||
<field name="context">{'search_default_active':1}</field>
|
||||
<field name="search_view_id" ref="view_workflow_workitem_search"/>
|
||||
</record>
|
||||
<menuitem action="action_workflow_workitem_form" id="menu_workflow_workitem" parent="base.menu_low_workflow"/>
|
||||
|
||||
@@ -22,11 +22,11 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Maintenance Contract">
|
||||
<separator string="Information" colspan="4"/>
|
||||
<field name="name"/>
|
||||
<newline/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_stop"/>
|
||||
<group col="6" colspan="4">
|
||||
<field name="name"/>
|
||||
<field name="date_start"/>
|
||||
<field name="date_stop"/>
|
||||
</group>
|
||||
<separator string="Covered Modules" colspan="4"/>
|
||||
<field name="module_ids" nolabel="1" colspan="4">
|
||||
<tree string="Covered Modules">
|
||||
@@ -89,8 +89,7 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Add Maintenance Contract" col="2">
|
||||
<image name="gtk-dialog-info" />
|
||||
<group col="1">
|
||||
<group col="1">
|
||||
<separator string="Add Maintenance Contract" />
|
||||
<group states="draft">
|
||||
<field name="name" width="250" />
|
||||
|
||||
@@ -68,6 +68,7 @@ class base_language_export(osv.osv_memory):
|
||||
return self.write(cr, uid, ids, {'state':'get', 'data':out, 'advice':this.advice, 'name':this.name}, context=context)
|
||||
|
||||
_name = "base.language.export"
|
||||
_inherit = "ir.wizard.screen"
|
||||
_columns = {
|
||||
'name': fields.char('Filename', 16, readonly=True),
|
||||
'lang': fields.selection(_get_languages, 'Language', help='To export a new language, do not select a language.'), # not required: unset = new language
|
||||
@@ -78,11 +79,11 @@ class base_language_export(osv.osv_memory):
|
||||
'state': fields.selection( ( ('choose','choose'), # choose language
|
||||
('get','get'), # get the file
|
||||
) ),
|
||||
}
|
||||
_defaults = { 'state': lambda *a: 'choose',
|
||||
'name': lambda *a: 'lang.tar.gz'
|
||||
}
|
||||
}
|
||||
_defaults = {
|
||||
'state': lambda *a: 'choose',
|
||||
'name': lambda *a: 'lang.tar.gz'
|
||||
}
|
||||
base_language_export()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -3,16 +3,27 @@
|
||||
<data>
|
||||
|
||||
<record id="wizard_lang_export" model="ir.ui.view">
|
||||
<field name="name">Export a Translation File</field>
|
||||
<field name="name">Export Translations</field>
|
||||
<field name="model">base.language.export</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Export language">
|
||||
<notebook>
|
||||
<page string="Export Data">
|
||||
<form string="Export Translations">
|
||||
<group col="8">
|
||||
<group colspan="3">
|
||||
<field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
|
||||
<newline/>
|
||||
<label colspan="4" width="220" string="OpenERP translations (core, modules, clients) are managed through Launchpad.net, our open source project management facility. We use their online interface to synchronize all translations efforts."/>
|
||||
<label colspan="4" width="220" string="To improve or expand the official translations, you should use directly Lauchpad's web interface (Rosetta). If you need to perform mass translation, Launchpad also allows uploading full .po files at once"/>
|
||||
<label colspan="4" width="220"/>
|
||||
<label colspan="4" width="220" string="To browse official translations, you can start with these links:"/>
|
||||
<label colspan="4" width="220" string="https://help.launchpad.net/Translations"/>
|
||||
<label colspan="4" width="220" string="https://translations.launchpad.net/openobject"/>
|
||||
</group>
|
||||
<separator orientation="vertical" rowspan="15"/>
|
||||
<group colspan="4">
|
||||
<group colspan="4" states="choose">
|
||||
<separator colspan="4" string="Export translation file"/>
|
||||
<field name="lang" required="1"/>
|
||||
<separator colspan="4" string="Export Translation"/>
|
||||
<field name="lang"/>
|
||||
<field name="format" required="1"/>
|
||||
<field height="200" name="modules" nolabel="1" colspan="4"/>
|
||||
<field invisible="1" name="state"/>
|
||||
@@ -23,28 +34,25 @@
|
||||
<field name="data" nolabel="1" readonly="1" fieldname="name" colspan="4"/>
|
||||
<field height="80" name="advice" nolabel="1" colspan="4"/>
|
||||
</group>
|
||||
<separator string="" colspan="4"/>
|
||||
<group col="2" colspan="2">
|
||||
</group>
|
||||
<group col="2" colspan="2">
|
||||
<button icon="gtk-cancel" name="act_cancel" special="cancel" states="choose" string="_Cancel" type="object"/>
|
||||
<button icon="gtk-ok" name="act_getfile" states="choose" string="_Export" type="object"></button>
|
||||
<button icon="gtk-cancel" name="act_destroy" special="cancel" states="get" string="_Cancel" type="object"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Help">
|
||||
<label align="0.0" colspan="4" string="The official translations pack of all OpenERP/OpenObjects module are managed through launchpad. We use their online interface to synchronize all translations efforts."/>
|
||||
<label align="0.0" colspan="4" string="To improve some terms of the official translations of OpenERP, you should modify the terms directly on the launchpad interface. If you made lots of translations for your own module, you can also publish all your translation at once."/>
|
||||
<label align="0.0" colspan="4" string="To browse official translations, you can visit this link: "/>
|
||||
<label align="0.0" colspan="4" string="https://translations.launchpad.net/openobject"/>
|
||||
</page>
|
||||
</notebook>
|
||||
</group>
|
||||
<group colspan="8" col="8" states="choose">
|
||||
<separator string="" colspan="8"/>
|
||||
<label colspan="6" width="220"/>
|
||||
<button icon="gtk-cancel" name="act_cancel" special="cancel" string="_Close" type="object"/>
|
||||
<button icon="gtk-ok" name="act_getfile" string="_Export" type="object"/>
|
||||
</group>
|
||||
<group colspan="8" col="8" states="get">
|
||||
<separator string="" colspan="8"/>
|
||||
<label colspan="7" width="220"/>
|
||||
<button icon="gtk-close" name="act_destroy" special="cancel" string="_Close" type="object"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_wizard_lang_export" model="ir.actions.act_window">
|
||||
<field name="name">Export a Translation File</field>
|
||||
<field name="name">Export Translation</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">base.language.export</field>
|
||||
<field name="view_type">form</field>
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
|
||||
import tools
|
||||
import base64
|
||||
import pooler
|
||||
from tempfile import TemporaryFile
|
||||
from osv import osv, fields
|
||||
|
||||
@@ -30,6 +29,7 @@ class base_language_import(osv.osv_memory):
|
||||
|
||||
_name = "base.language.import"
|
||||
_description = "Language Import"
|
||||
_inherit = "ir.wizard.screen"
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Language Name',size=64 , required=True),
|
||||
|
||||
@@ -3,42 +3,42 @@
|
||||
<data>
|
||||
|
||||
<record id="view_base_import_language" model="ir.ui.view">
|
||||
<field name="name">Import Language</field>
|
||||
<field name="name">Import Translation</field>
|
||||
<field name="model">base.language.import</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Import language">
|
||||
<notebook colspan="4">
|
||||
<page string="Import Data">
|
||||
<group colspan="4" col="4">
|
||||
<separator string="Import New Language" colspan="4"/>
|
||||
<field name="name" width="200"/>
|
||||
<field name="code"/>
|
||||
<field name="data" colspan="4"/>
|
||||
<form string="Import Translation">
|
||||
<group col="8">
|
||||
<group colspan="3">
|
||||
<field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
|
||||
<newline/>
|
||||
<label colspan="4" width="220" string="Supported file formats: *.csv (Comma-separated values) or *.po (GetText Portable Objects)"/>
|
||||
<label colspan="4" width="220" string="Please double-check that the file encoding is set to UTF-8 (sometimes called Unicode) when the translator exports it."/>
|
||||
<label colspan="4" width="220"/>
|
||||
<label colspan="4" width="220" string="When using CSV format, please also check that the first line of your file is one of the following:"/>
|
||||
<label colspan="4" width="220" string="- type,name,res_id,src,value"/>
|
||||
<label colspan="4" width="220" string="- module,type,name,res_id,src,value"/>
|
||||
</group>
|
||||
<separator orientation="vertical" rowspan="15"/>
|
||||
<group colspan="4" col="4">
|
||||
<separator string="Import Translation" colspan="4"/>
|
||||
<field name="name" width="200"/>
|
||||
<field name="code"/>
|
||||
<field name="data" colspan="4"/>
|
||||
</group>
|
||||
<group colspan="8" col="8">
|
||||
<separator string="" colspan="8"/>
|
||||
<label colspan="6" width="220"/>
|
||||
<button special="cancel" string="_Close" icon="gtk-cancel"/>
|
||||
<button name="import_lang" string="_Import" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
</group>
|
||||
<separator string="" colspan="4"/>
|
||||
<group colspan="2" col="2">
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<button special="cancel" string="_Cancel" icon="gtk-cancel"/>
|
||||
<button name="import_lang" string="_Import" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Help">
|
||||
<label string="You have to import a .CSV file which is encoded in UTF-8."/>
|
||||
<label string="Please check that the first line of your file is one of the following:" colspan="4" align="0.0"/>
|
||||
<label string="type,name,res_id,src,value" colspan="4"/>
|
||||
<label string="module,type,name,res_id,src,value" colspan="4"/>
|
||||
<label string="You can also import .po files." colspan="4" align="0.0"/>
|
||||
</page>
|
||||
</notebook>
|
||||
|
||||
</form>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_view_base_import_language" model="ir.actions.act_window">
|
||||
<field name="name">Import Language</field>
|
||||
<field name="name">Import Translation</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">base.language.import</field>
|
||||
<field name="view_type">form</field>
|
||||
@@ -47,7 +47,6 @@
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
name="Import a Translation File"
|
||||
action="action_view_base_import_language"
|
||||
id="menu_view_base_import_language"
|
||||
parent="menu_translation_export"/>
|
||||
|
||||
@@ -20,17 +20,22 @@
|
||||
##############################################################################
|
||||
|
||||
import tools
|
||||
import pooler
|
||||
from osv import osv, fields
|
||||
|
||||
class base_language_install(osv.osv_memory):
|
||||
""" Install Language"""
|
||||
|
||||
_name = "base.language.install"
|
||||
_inherit = "ir.wizard.screen"
|
||||
_description = "Install Language"
|
||||
|
||||
_columns = {
|
||||
'lang': fields.selection(tools.scan_languages(),'Language'),
|
||||
'lang': fields.selection(tools.scan_languages(),'Language', required=True),
|
||||
'state':fields.selection([('init','init'),('done','done')], 'state', readonly=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'state': 'init',
|
||||
}
|
||||
|
||||
def lang_install(self, cr, uid, ids, context):
|
||||
@@ -40,30 +45,9 @@ class base_language_install(osv.osv_memory):
|
||||
modobj = self.pool.get('ir.module.module')
|
||||
mids = modobj.search(cr, uid, [('state', '=', 'installed')])
|
||||
modobj.update_translations(cr, uid, mids, lang)
|
||||
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
id2 = data_obj._get_id(cr, uid, 'base', 'view_base_language_install_msg')
|
||||
if id2:
|
||||
id2 = data_obj.browse(cr, uid, id2, context=context).res_id
|
||||
|
||||
return {
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'base.module.import.msg',
|
||||
'views': [(id2, 'form')],
|
||||
'view_id': False,
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
}
|
||||
self.write(cr, uid, ids, {'state': 'done'}, context=context)
|
||||
return False
|
||||
|
||||
base_language_install()
|
||||
|
||||
class base_language_install_msg(osv.osv_memory):
|
||||
""" Install Language"""
|
||||
|
||||
_name = "base.language.install.msg"
|
||||
_description = "Install Language"
|
||||
|
||||
base_language_install_msg()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -8,13 +8,38 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Load Official Translation">
|
||||
<separator string="Load an Official Translation" colspan="4"/>
|
||||
<group colspan="4"><field name="lang"/></group>
|
||||
<label string="" colspan="4"/>
|
||||
<label string="Please be patient, as this operation may take a few minutes..." colspan="4"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="lang_install" string="Load" type="object" icon="gtk-ok"/>
|
||||
<group col="8">
|
||||
<group colspan="3">
|
||||
<field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
|
||||
<newline/>
|
||||
<label colspan="4" width="220" string="This wizard helps you add a new language to your OpenERP system. After loading a new language it becomes available as default interface language for users and partners."/>
|
||||
<label colspan="4" width="220"/>
|
||||
<label colspan="4" width="220" string="Please be patient, this operation may take a few minutes (depending on the number of modules currently installed)..."/>
|
||||
<field name="state" invisible="1"/>
|
||||
</group>
|
||||
<separator orientation="vertical" rowspan="15"/>
|
||||
<group colspan="4">
|
||||
<separator string="Load Official Translation" colspan="4"/>
|
||||
<group states="init" colspan="4">
|
||||
<field name="lang" colspan="4"/>
|
||||
</group>
|
||||
<group states="done" colspan="4">
|
||||
<label string="The selected language has been successfully installed.
|
||||
You must change the preferences of the user and open a new menu to view the changes." colspan="4"/>
|
||||
</group>
|
||||
</group>
|
||||
<group colspan="8" col="8" states="init">
|
||||
<separator string="" colspan="8"/>
|
||||
<label colspan="6" width="220"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="lang_install" string="Load" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
<group colspan="8" col="8" states="done">
|
||||
<separator string="" colspan="8"/>
|
||||
<label colspan="7" width="220"/>
|
||||
<button special="cancel" string="Close" icon="gtk-ok"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
@@ -32,30 +57,7 @@
|
||||
name="Load an Official Translation"
|
||||
action="action_view_base_language_install"
|
||||
id="menu_view_base_language_install"
|
||||
parent="menu_translation"/>
|
||||
|
||||
<record id="view_base_language_install_msg" model="ir.ui.view">
|
||||
<field name="name">Official Translation Loaded</field>
|
||||
<field name="model">base.module.import.msg</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Official Translation Loaded">
|
||||
<separator string="Official Translation Loaded" colspan="4"/>
|
||||
<label string="The selected language has been successfully installed.\nYou must change the preferences of the user and open a new menu to view the changes." colspan="4"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<button special="cancel" string="OK" icon="gtk-ok"/>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_view_base_language_install_msg" model="ir.actions.act_window">
|
||||
<field name="name">Official Translation Loaded</field>
|
||||
<field name="res_model">base.module.import.msg</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_base_language_install"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
parent="menu_translation" sequence="2"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class base_module_configuration(osv.osv_memory):
|
||||
_name = "base.module.configuration"
|
||||
|
||||
def start(self, cr, uid, ids, context=None):
|
||||
todo_ids = self.pool.get('ir.actions.todo').search(cr, uid, ['|', ('state', '=', 'open'), ('restart', '=', 'always')])
|
||||
todo_ids = self.pool.get('ir.actions.todo').search(cr, uid, ['|', ('state', '=', 'open'), '&', ('state', '=', 'skip'), ('restart', '=', 'onskip')])
|
||||
if not todo_ids:
|
||||
# When there is no wizard todo it will display message
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
|
||||
@@ -26,8 +26,8 @@
|
||||
|
||||
<menuitem name="Start Configuration"
|
||||
action="action_start_configurator"
|
||||
id="menu_view_base_module_configuration" parent="next_id_11"
|
||||
type="server" icon="STOCK_EXECUTE" sequence="2" />
|
||||
id="menu_view_base_module_configuration" parent="base.menu_config"
|
||||
type="server" icon="STOCK_EXECUTE" sequence="100" />
|
||||
|
||||
<record model="ir.values" id="action_todo_config">
|
||||
<field name="model_id" ref="model_ir_actions_todo" />
|
||||
@@ -38,6 +38,6 @@
|
||||
<field name="key">action</field>
|
||||
<field name="model">ir.actions.todo</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -19,8 +19,6 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
||||
import pooler
|
||||
import os
|
||||
import tools
|
||||
|
||||
@@ -34,19 +32,24 @@ class base_module_import(osv.osv_memory):
|
||||
""" Import Module """
|
||||
|
||||
_name = "base.module.import"
|
||||
_inherit = "ir.wizard.screen"
|
||||
_description = "Import Module"
|
||||
|
||||
_columns = {
|
||||
'module_file': fields.binary('Module .ZIP file', required=True),
|
||||
'state':fields.selection([('init','init'),('done','done')], 'state', readonly=True),
|
||||
'module_name': fields.char('Module Name', size=128),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'state': 'init',
|
||||
}
|
||||
|
||||
def importzip(self, cr, uid, ids, context):
|
||||
module_obj= self.pool.get('ir.module.module')
|
||||
active_ids = context and context.get('active_ids', False)
|
||||
data = self.browse(cr, uid, ids , context=context)[0]
|
||||
(data,) = self.browse(cr, uid, ids , context=context)
|
||||
module_data = data.module_file
|
||||
|
||||
val =base64.decodestring(module_data)
|
||||
val = base64.decodestring(module_data)
|
||||
fp = StringIO()
|
||||
fp.write(val)
|
||||
fdata = zipfile.ZipFile(fp, 'r')
|
||||
@@ -55,62 +58,30 @@ class base_module_import(osv.osv_memory):
|
||||
|
||||
ad = tools.config['addons_path']
|
||||
|
||||
fname = os.path.join(ad,module_name+'.zip')
|
||||
fname = os.path.join(ad, module_name+'.zip')
|
||||
try:
|
||||
fp = file(fname, 'wb')
|
||||
fp.write(val)
|
||||
fp.close()
|
||||
except IOError, e:
|
||||
except IOError:
|
||||
raise osv.except_osv(_('Error !'), _('Can not create the module file: %s !') % (fname,) )
|
||||
|
||||
module_obj.update_list(cr, uid,{'module_name': module_name,})
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
id2 = data_obj._get_id(cr, uid, 'base', 'view_base_module_import_msg')
|
||||
if id2:
|
||||
id2 = data_obj.browse(cr, uid, id2, context=context).res_id
|
||||
|
||||
module_name = module_obj.browse(cr, uid, ids, context=context)
|
||||
return {
|
||||
'domain': str([('name', '=', module_name)]),
|
||||
'name': 'Message',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'base.module.import.msg',
|
||||
'views': [(id2, 'form')],
|
||||
'view_id': False,
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
}
|
||||
|
||||
base_module_import()
|
||||
|
||||
class base_module_import_msg(osv.osv_memory):
|
||||
""" message """
|
||||
_name = "base.module.import.msg"
|
||||
_description = "Message"
|
||||
self.pool.get('ir.module.module').update_list(cr, uid, {'module_name': module_name,})
|
||||
self.write(cr, uid, ids, {'state':'done', 'module_name': module_name}, context)
|
||||
return False
|
||||
|
||||
def action_module_open(self, cr, uid, ids, context):
|
||||
module_obj = self.pool.get('base.module.import')
|
||||
data = module_obj.browse(cr, uid, ids , context=context)[0]
|
||||
module_data = data.module_file
|
||||
|
||||
val =base64.decodestring(module_data)
|
||||
fp = StringIO()
|
||||
fp.write(val)
|
||||
fdata = zipfile.ZipFile(fp, 'r')
|
||||
fname = fdata.namelist()[0]
|
||||
module_name = os.path.split(fname)[0]
|
||||
|
||||
(data,) = self.browse(cr, uid, ids , context=context)
|
||||
return {
|
||||
'domain': str([('name', '=', module_name)]),
|
||||
'name': 'Module List',
|
||||
'domain': str([('name', '=', data.module_name)]),
|
||||
'name': 'Modules',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'ir.module.module',
|
||||
'type': 'ir.actions.act_window',
|
||||
}
|
||||
|
||||
base_module_import_msg()
|
||||
base_module_import()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -7,17 +7,41 @@
|
||||
<field name="model">base.module.import</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Module import">
|
||||
<separator string="Module Import" colspan="4"/>
|
||||
<label string="Please give your module .ZIP file to import." colspan="4"/>
|
||||
<field name="module_file"/>
|
||||
<separator string="" colspan="4" />
|
||||
<newline/>
|
||||
<group colspan="6" >
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="importzip" string="Import module" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
</form>
|
||||
<form string="Import module">
|
||||
<group col="8">
|
||||
<group colspan="3">
|
||||
<field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
|
||||
<newline/>
|
||||
<label colspan="4" width="220" string="This wizard helps you add a new language to you OpenERP system. After loading a new language it becomes available as default interface language for users and partners."/>
|
||||
<label colspan="4" width="220"/>
|
||||
<label colspan="4" width="220" string="Please be patient, this operation may take a few minutes (depending on the number of modules currently installed)..."/>
|
||||
<field name="state" invisible="1"/>
|
||||
</group>
|
||||
<separator orientation="vertical" rowspan="15"/>
|
||||
<group colspan="4">
|
||||
<separator string="Module Import" colspan="4"/>
|
||||
<group states="init" colspan="4" col="4">
|
||||
<label string="Select module package to import (.zip file):" colspan="4"/>
|
||||
<field name="module_file" colspan="4"/>
|
||||
</group>
|
||||
<group states="done" colspan="4" col="4">
|
||||
<label string="Module file successfully imported!" colspan="4"/>
|
||||
</group>
|
||||
</group>
|
||||
<group colspan="8" col="8" states="init">
|
||||
<separator string="" colspan="8"/>
|
||||
<label colspan="6" width="220"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="importzip" string="Import module" type="object" icon="gtk-apply"/>
|
||||
</group>
|
||||
<group colspan="8" col="8" states="done">
|
||||
<separator string="" colspan="8"/>
|
||||
<label colspan="6" width="220"/>
|
||||
<button special="cancel" string="Close" icon="gtk-ok"/>
|
||||
<button name="action_module_open" string="Open Modules" type="object" icon="gtk-go-forward"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -31,36 +55,12 @@
|
||||
</record>
|
||||
|
||||
<menuitem
|
||||
name="Import Module"
|
||||
action="action_view_base_module_import"
|
||||
id="menu_view_base_module_import"
|
||||
parent="menu_management"
|
||||
sequence="1"/>
|
||||
name="Import Module"
|
||||
action="action_view_base_module_import"
|
||||
id="menu_view_base_module_import"
|
||||
parent="menu_management"
|
||||
sequence="1"/>
|
||||
|
||||
<record id="view_base_module_import_msg" model="ir.ui.view">
|
||||
<field name="name">Module Import Message</field>
|
||||
<field name="model">base.module.import.msg</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Message">
|
||||
<label string="Module successfully imported !"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<newline/>
|
||||
<group>
|
||||
<button name="action_module_open" string="Cancel" type="object" icon="gtk-cancel"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_view_base_module_import_msg" model="ir.actions.act_window">
|
||||
<field name="name">Module Import Message</field>
|
||||
<field name="res_model">base.module.import.msg</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_base_module_import"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
||||
@@ -19,16 +19,13 @@
|
||||
#
|
||||
##############################################################################
|
||||
import os
|
||||
import re
|
||||
import glob
|
||||
import time
|
||||
import imp
|
||||
|
||||
import tools
|
||||
import pooler
|
||||
|
||||
import zipfile
|
||||
from osv import osv, fields
|
||||
from osv import osv
|
||||
|
||||
class base_module_scan(osv.osv_memory):
|
||||
""" scan module """
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
import netsvc
|
||||
import pooler
|
||||
from osv import osv, fields
|
||||
|
||||
class base_module_update(osv.osv_memory):
|
||||
@@ -27,85 +25,37 @@ class base_module_update(osv.osv_memory):
|
||||
|
||||
_name = "base.module.update"
|
||||
_description = "Update Module"
|
||||
|
||||
def update_module(self, cr, uid, ids, context):
|
||||
"""
|
||||
Update Module
|
||||
|
||||
@param cr: the current row, from the database cursor.
|
||||
@param uid: the current user’s ID for security checks.
|
||||
@param ids: the ID or list of IDs
|
||||
@param context: A standard dictionary
|
||||
"""
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
id2 = data_obj._get_id(cr, uid, 'base', 'view_base_module_update_open')
|
||||
if id2:
|
||||
id2 = data_obj.browse(cr, uid, id2, context=context).res_id
|
||||
|
||||
return {
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'base.module.update.open',
|
||||
'views': [(id2, 'form')],
|
||||
'view_id': False,
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new',
|
||||
|
||||
}
|
||||
|
||||
base_module_update()
|
||||
|
||||
class base_module_update_open(osv.osv_memory):
|
||||
""" Update Module Open """
|
||||
|
||||
_name = "base.module.update.open"
|
||||
_description = "Update Module Open"
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
"""
|
||||
This function gets default values
|
||||
@param self: The object pointer
|
||||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param fields: List of fields for default value
|
||||
@param context: A standard dictionary for contextual values
|
||||
@return : default values of fields.
|
||||
"""
|
||||
|
||||
module_obj = self.pool.get('ir.module.module')
|
||||
update, add = module_obj.update_list(cr, uid,)
|
||||
return {'update': update, 'add': add}
|
||||
_inherit = "ir.wizard.screen"
|
||||
|
||||
_columns = {
|
||||
'update': fields.integer('Number of modules updated', readonly=True),
|
||||
'add': fields.integer('Number of modules added', readonly=True),
|
||||
'update': fields.integer('Number of modules updated', readonly=True),
|
||||
'add': fields.integer('Number of modules added', readonly=True),
|
||||
'state':fields.selection([('init','init'),('done','done')], 'state', readonly=True),
|
||||
}
|
||||
|
||||
def action_module_open(self, cr, uid, ids, context):
|
||||
"""
|
||||
Update Module List Open
|
||||
_defaults = {
|
||||
'state': 'init',
|
||||
}
|
||||
|
||||
@param cr: the current row, from the database cursor.
|
||||
@param uid: the current user’s ID for security checks.
|
||||
@param ids: the ID or list of IDs
|
||||
@param context: A standard dictionary
|
||||
"""
|
||||
def update_module(self, cr, uid, ids, context=None):
|
||||
module_obj = self.pool.get('ir.module.module')
|
||||
update, add = module_obj.update_list(cr, uid,)
|
||||
self.write(cr, uid, ids, {'update': update, 'add': add, 'state': 'done'}, context=context)
|
||||
return False
|
||||
|
||||
def action_module_open(self, cr, uid, ids, context):
|
||||
res = {
|
||||
'domain': str([]),
|
||||
'name': 'Module List',
|
||||
'name': 'Modules',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'ir.module.module',
|
||||
'view_id': False,
|
||||
'type': 'ir.actions.act_window',
|
||||
}
|
||||
view_obj = self.pool.get('ir.ui.view')
|
||||
search_view_id = view_obj.search(cr, uid, [('name','=','ir.module.module.list.select')], context=context)
|
||||
if search_view_id:
|
||||
res.update({'search_view_id' : search_view_id[0]})
|
||||
return res
|
||||
|
||||
base_module_update_open()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
base_module_update()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
@@ -7,15 +7,41 @@
|
||||
<field name="model">base.module.update</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Scan for new modules">
|
||||
<label string="This function will check for new modules in the 'addons' path" colspan="4" align="0.0"/>
|
||||
<separator string="" colspan="4" />
|
||||
<newline/>
|
||||
<group colspan="6" >
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="update_module" string="Check new modules" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
</form>
|
||||
<form string="Update Module List">
|
||||
<group col="8">
|
||||
<group colspan="3">
|
||||
<field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
|
||||
<newline/>
|
||||
<label colspan="4" width="220" string="This wizard will scan all module repositories on the server side to detect newly added modules as well as any change to existing modules."/>
|
||||
<label colspan="4" width="220"/>
|
||||
<label colspan="4" width="220" string="Please be patient, as this operation may take a few seconds..."/>
|
||||
<field name="state" invisible="1"/>
|
||||
</group>
|
||||
<separator orientation="vertical" rowspan="15"/>
|
||||
<group colspan="4">
|
||||
<separator string="Module update result" colspan="4"/>
|
||||
<group states="init" colspan="4">
|
||||
<label string="Click on Update below to start the process..." colspan="4"/>
|
||||
</group>
|
||||
<group states="done" colspan="4">
|
||||
<field name="update" colspan="4"/>
|
||||
<field name="add" colspan="4"/>
|
||||
</group>
|
||||
</group>
|
||||
<group colspan="8" col="8" states="init">
|
||||
<separator string="" colspan="8"/>
|
||||
<label colspan="6" width="220"/>
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="update_module" string="Update" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
<group colspan="8" col="8" states="done">
|
||||
<separator string="" colspan="8"/>
|
||||
<label colspan="6" width="220"/>
|
||||
<button special="cancel" string="Close" icon="gtk-ok"/>
|
||||
<button name="action_module_open" string="Open Modules" type="object" icon="gtk-go-forward"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
@@ -36,33 +62,5 @@
|
||||
sequence="2"
|
||||
icon="STOCK_CONVERT"/>
|
||||
|
||||
<record id="view_base_module_update_open" model="ir.ui.view">
|
||||
<field name="name">Update ModuleList</field>
|
||||
<field name="model">base.module.update.open</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="New modules">
|
||||
<field name="update" colspan="4"/>
|
||||
<field name="add" colspan="4"/>
|
||||
<separator string="" colspan="4" />
|
||||
<newline/>
|
||||
<group colspan="6" >
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="action_module_open" string="OK" type="object" icon="gtk-ok"/>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
<record id="action_view_base_module_update_open" model="ir.actions.act_window">
|
||||
<field name="name">Update ModuleList</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">base.module.update.open</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="view_id" ref="view_base_module_update"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
@@ -20,8 +20,6 @@
|
||||
##############################################################################
|
||||
|
||||
import pooler
|
||||
import os
|
||||
import tools
|
||||
from osv import osv, fields
|
||||
|
||||
class base_module_upgrade(osv.osv_memory):
|
||||
@@ -39,7 +37,7 @@ class base_module_upgrade(osv.osv_memory):
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param context: A standard dictionary
|
||||
@param context: A standard dictionary
|
||||
@return: New arch of view.
|
||||
"""
|
||||
res = super(base_module_upgrade, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar,submenu=False)
|
||||
@@ -50,7 +48,7 @@ class base_module_upgrade(osv.osv_memory):
|
||||
|
||||
ids = self.get_module_list(cr, uid, context=context)
|
||||
if not ids:
|
||||
res['arch'] = '''<form string="System update done">
|
||||
res['arch'] = '''<form string="Apply Scheduled Upgrades">
|
||||
<separator string="System update completed" colspan="4"/>
|
||||
<label align="0.0" string="The selected modules have been updated / installed !" colspan="4"/>
|
||||
<label align="0.0" string="We suggest to reload the menu tab to see the new menus (Ctrl+T then Ctrl+R)." colspan="4"/>
|
||||
@@ -98,7 +96,7 @@ class base_module_upgrade(osv.osv_memory):
|
||||
raise osv.except_osv('Unmet dependency !', 'Following modules are uninstalled or unknown. \n\n'+'\n'.join(unmet_packages))
|
||||
mod_obj.download(cr, uid, ids, context=context)
|
||||
cr.commit()
|
||||
db, pool = pooler.restart_pool(cr.dbname, update_module=True)
|
||||
_, pool = pooler.restart_pool(cr.dbname, update_module=True)
|
||||
|
||||
id2 = data_obj._get_id(cr, uid, 'base', 'view_base_module_upgrade_install')
|
||||
if id2:
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
<field name="model">base.module.upgrade</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="System update done">
|
||||
<form string="Apply Scheduled Upgrades">
|
||||
<separator string="System update completed" colspan="4"/>
|
||||
<label align="0.0" string="The selected modules have been updated / installed !" colspan="4"/>
|
||||
<label align="0.0" string="We suggest to reload the menu tab to see the new menus (Ctrl+T then Ctrl+R)." colspan="4"/>
|
||||
|
||||
@@ -35,7 +35,7 @@ class base_update_translations(osv.osv_memory):
|
||||
lang_obj=pooler.get_pool(cr.dbname).get('res.lang')
|
||||
ids=lang_obj.search(cr, uid, [('code', '=', lang_code)])
|
||||
if not ids:
|
||||
raise osv.orm_except('Bad lang')
|
||||
raise osv.except_osv(_('No language with code "%s" exists') % lang_code)
|
||||
lang = lang_obj.browse(cr, uid, ids[0])
|
||||
return lang.name
|
||||
def act_cancel(self, cr, uid, ids, context=None):
|
||||
@@ -50,9 +50,18 @@ class base_update_translations(osv.osv_memory):
|
||||
buf.close()
|
||||
return {'type': 'ir.actions.act_window_close'}
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
res = super(base_update_translations, self).default_get(cr, uid, fields, context=context)
|
||||
record_id = context and context.get('active_id', False) or False
|
||||
if record_id:
|
||||
lang = self.pool.get('res.lang').browse(cr, uid, record_id).code
|
||||
res.update(lang=lang)
|
||||
return res
|
||||
|
||||
_name = 'base.update.translations'
|
||||
_inherit = "ir.wizard.screen"
|
||||
_columns = {
|
||||
'lang': fields.selection(_get_languages, 'Language', required=True),
|
||||
}
|
||||
|
||||
base_update_translations()
|
||||
base_update_translations()
|
||||
@@ -2,23 +2,34 @@
|
||||
<openerp>
|
||||
<data>
|
||||
<record id="wizard_update_translations" model="ir.ui.view">
|
||||
<field name="name">Update Translations</field>
|
||||
<field name="name">Synchronize Translations</field>
|
||||
<field name="model">base.update.translations</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form col="3" string="Update Translations">
|
||||
<field name="lang"/>
|
||||
<label align="0.0" colspan="4" string="This wizard will detect new terms in the application so that you can update them manually."/>
|
||||
<separator colspan="4"/>
|
||||
<group col="2" colspan="4" fill="0">
|
||||
<button icon="gtk-cancel" name="act_cancel" special="cancel" string="Cancel" type="object"/>
|
||||
<button icon="gtk-ok" name="act_update" string="Update" type="object"/>
|
||||
<form string="Synchronize Translations">
|
||||
<group col="8">
|
||||
<group colspan="3">
|
||||
<field name="config_logo" widget="image" width="220" height="130" nolabel="1" colspan="1"/>
|
||||
<newline/>
|
||||
<label colspan="4" width="220" string="This wizard will detect new terms to translate in the application, so that you can then add translations manually or perform a complete export (as a template for a new language example)."/>
|
||||
</group>
|
||||
<separator orientation="vertical" rowspan="15"/>
|
||||
<group colspan="4">
|
||||
<separator string="Synchronize Translation" colspan="4"/>
|
||||
<field name="lang" colspan="4"/>
|
||||
</group>
|
||||
<group colspan="8" col="8">
|
||||
<separator string="" colspan="8"/>
|
||||
<label colspan="6" width="220"/>
|
||||
<button icon="gtk-cancel" name="act_cancel" special="cancel" string="Cancel" type="object"/>
|
||||
<button icon="gtk-ok" name="act_update" string="Update" type="object"/>
|
||||
</group>
|
||||
</group>
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
<record id="action_wizard_update_translations" model="ir.actions.act_window">
|
||||
<field name="name">Resynchronise Terms</field>
|
||||
<field name="name">Synchronize Translations</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">base.update.translations</field>
|
||||
<field name="view_type">form</field>
|
||||
|
||||
@@ -73,7 +73,7 @@
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" ref="ir_property_view_tree"/>
|
||||
</record>
|
||||
<menuitem id="next_id_15" name="Parameters" parent="base.menu_config"/>
|
||||
<menuitem id="next_id_15" name="Parameters" parent="base.menu_config" groups="base.group_extended" />
|
||||
<menuitem action="ir_property_form" id="menu_ir_property_form_all" parent="base.next_id_15"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
<data noupdate="True">
|
||||
|
||||
<!--
|
||||
Resource: res.partner.title
|
||||
-->
|
||||
Resource: res.partner.title
|
||||
-->
|
||||
<record id="res_partner_title_pvt_ltd" model="res.partner.title">
|
||||
<field name="domain">partner</field>
|
||||
<field name="name">Corp.</field>
|
||||
@@ -49,9 +49,9 @@
|
||||
<field name="bank_type_id" ref="bank_normal"/>
|
||||
</record>
|
||||
|
||||
<!--
|
||||
Resource: res.request.link
|
||||
-->
|
||||
<!--
|
||||
Resource: res.request.link
|
||||
-->
|
||||
|
||||
<record id="req_link_partner" model="res.request.link">
|
||||
<field name="name">Partner</field>
|
||||
|
||||
@@ -123,7 +123,7 @@
|
||||
<field name="act_window_id" ref="action_partner_address_form"/>
|
||||
</record>
|
||||
<menuitem action="action_partner_address_form" id="menu_partner_address_form"
|
||||
groups="base.group_extended,base.group_system,group_sale_manager,group_sale_salesman"
|
||||
groups="base.group_extended"
|
||||
parent="base.menu_address_book" sequence="30"/>
|
||||
|
||||
<!--
|
||||
@@ -207,7 +207,7 @@
|
||||
<field name="domain">[('domain','=','partner')]</field>
|
||||
</record>
|
||||
|
||||
<menuitem action="action_partner_title_partner" id="menu_partner_title_partner" name="Partner Title" parent="menu_config_address_book" sequence="2"/>
|
||||
<menuitem action="action_partner_title_partner" id="menu_partner_title_partner" parent="menu_config_address_book" sequence="2"/>
|
||||
|
||||
<record id="action_partner_title_contact" model="ir.actions.act_window">
|
||||
<field name="name">Contact Titles</field>
|
||||
|
||||
@@ -19,19 +19,14 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import os
|
||||
import base64
|
||||
import random
|
||||
from operator import attrgetter
|
||||
|
||||
from osv import osv, fields
|
||||
import tools
|
||||
from tools.translate import _
|
||||
import netsvc
|
||||
import pooler
|
||||
|
||||
|
||||
|
||||
class res_config_configurable(osv.osv_memory):
|
||||
''' Base classes for new-style configuration items
|
||||
|
||||
@@ -40,6 +35,7 @@ class res_config_configurable(osv.osv_memory):
|
||||
their view inherit from the related res_config_view_base view.
|
||||
'''
|
||||
_name = 'res.config'
|
||||
_inherit = 'ir.wizard.screen'
|
||||
logger = netsvc.Logger()
|
||||
|
||||
def get_current_progress(self, cr, uid, context=None):
|
||||
@@ -57,20 +53,13 @@ class res_config_configurable(osv.osv_memory):
|
||||
return round(closed*100./total)
|
||||
return 100.
|
||||
|
||||
def _get_image(self, cr, uid, context=None):
|
||||
file_no = str(random.randint(1,3))
|
||||
path = os.path.join('base','res','config_pixmaps/%s.png'%file_no)
|
||||
file_data = tools.file_open(path,'rb').read()
|
||||
return base64.encodestring(file_data)
|
||||
|
||||
_columns = dict(
|
||||
progress = fields.float('Configuration Progress', readonly=True),
|
||||
config_logo = fields.binary('Image', readonly=True),
|
||||
)
|
||||
)
|
||||
|
||||
_defaults = dict(
|
||||
progress = _progress,
|
||||
config_logo = _get_image
|
||||
)
|
||||
)
|
||||
|
||||
def _next_action(self, cr, uid, context=None):
|
||||
todos = self.pool.get('ir.actions.todo')
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
</group>
|
||||
</group>
|
||||
<group colspan="8" col="8">
|
||||
<separator string="" colspan="8"/>
|
||||
<separator string="" colspan="6"/>
|
||||
<group colspan="4" width="220">
|
||||
<field name="progress" widget="progressbar" nolabel="1" colspan="2"/>
|
||||
</group>
|
||||
|
||||
@@ -24,22 +24,23 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Languages">
|
||||
<group col="4" colspan="4">
|
||||
<field name="name" colspan="4"/>
|
||||
<field name="code" />
|
||||
<field name="iso_code"/>
|
||||
<field name="active" />
|
||||
<field name="translatable"/>
|
||||
<field name="grouping" />
|
||||
<field name="direction" />
|
||||
<newline/>
|
||||
<field name="date_format"/>
|
||||
<field name="time_format"/>
|
||||
<field name="decimal_point"/>
|
||||
<field name="thousands_sep"/>
|
||||
<newline/>
|
||||
</group>
|
||||
<separator colspan="4" string="Legends for Date and Time Formats"/>
|
||||
<group col="6" colspan="4">
|
||||
<field name="name"/>
|
||||
<field name="code" />
|
||||
<field name="iso_code"/>
|
||||
<newline/>
|
||||
<field name="grouping" />
|
||||
<field name="date_format"/>
|
||||
<field name="time_format"/>
|
||||
<newline/>
|
||||
<field name="direction" />
|
||||
<field name="decimal_point"/>
|
||||
<field name="thousands_sep"/>
|
||||
<newline/>
|
||||
<field name="active" />
|
||||
<field name="translatable"/>
|
||||
</group>
|
||||
<separator colspan="4" string="Legends for Date and Time Formats"/>
|
||||
<group col="4" colspan="4">
|
||||
<label align="0.0" string="%%a - Abbreviated weekday name."/>
|
||||
<label align="0.0" string="%%A - Full weekday name."/>
|
||||
@@ -106,10 +107,14 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Languages">
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="iso_code"/>
|
||||
<field name="direction"/>
|
||||
<group>
|
||||
<filter string="Translatable" icon="terp-tools" domain="[('translatable','=',True)]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="name"/>
|
||||
<field name="code"/>
|
||||
<field name="iso_code"/>
|
||||
<field name="direction"/>
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -121,6 +126,6 @@
|
||||
<field name="context">{'active_test': False}</field>
|
||||
<field name="search_view_id" ref="res_lang_search"/>
|
||||
</record>
|
||||
<menuitem action="res_lang_act_window" id="menu_res_lang_act_window" parent="menu_translation"/>
|
||||
<menuitem action="res_lang_act_window" id="menu_res_lang_act_window" parent="menu_translation" groups="base.group_extended" sequence="1"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -20,8 +20,8 @@
|
||||
##############################################################################
|
||||
|
||||
from osv import fields, osv
|
||||
import tools
|
||||
|
||||
import tools
|
||||
import time
|
||||
class res_log(osv.osv_memory):
|
||||
_name = 'res.log'
|
||||
_columns = {
|
||||
@@ -29,12 +29,14 @@ class res_log(osv.osv_memory):
|
||||
'user_id': fields.many2one('res.users','User', required=True),
|
||||
'res_model': fields.char('Object', size=128),
|
||||
'res_id': fields.integer('Object ID'),
|
||||
'secondary': fields.boolean('Secondary Log', help='Do not display this log if it belongs to the same object the user is working on')
|
||||
'secondary': fields.boolean('Secondary Log', help='Do not display this log if it belongs to the same object the user is working on'),
|
||||
'create_date': fields.datetime('Created Date', readonly=True),
|
||||
}
|
||||
_defaults = {
|
||||
'user_id': lambda self,cr,uid,ctx: uid
|
||||
'user_id': lambda self,cr,uid,ctx: uid,
|
||||
'create_date': time.strftime('%Y-%m-%d %H:%M:%S')
|
||||
}
|
||||
_order='date desc'
|
||||
_order='create_date desc'
|
||||
|
||||
# TODO: do not return secondary log if same object than in the model (but unlink it)
|
||||
def get(self, cr, uid, context={}):
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
<field name="name"/>
|
||||
<field name="user_id"/>
|
||||
<field name="res_model"/>
|
||||
<field name="create_date"/>
|
||||
</search>
|
||||
</field>
|
||||
</record>
|
||||
@@ -21,6 +22,7 @@
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Logs">
|
||||
<field name="create_date"/>
|
||||
<field name="name"/>
|
||||
<field name="user_id"/>
|
||||
</tree>
|
||||
@@ -32,8 +34,9 @@
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Logs">
|
||||
<field name="name"/>
|
||||
<field name="create_date"/>
|
||||
<group colspan="4" col="6">
|
||||
<field name="name" colspan="4"/>
|
||||
<field name="user_id" />
|
||||
<field name="res_model"/>
|
||||
<field name="res_id"/>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
@@ -15,7 +15,7 @@
|
||||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
@@ -50,7 +50,7 @@ class res_request(osv.osv):
|
||||
return True
|
||||
|
||||
def request_close(self, cr, uid, ids, *args):
|
||||
self.write(cr, uid, ids, {'state':'closed', 'active':False})
|
||||
self.write(cr, uid, ids, {'state':'closed'})
|
||||
return True
|
||||
|
||||
def request_get(self, cr, uid):
|
||||
@@ -113,7 +113,7 @@ class res_request_history(osv.osv):
|
||||
'name': lambda *a: 'NoName',
|
||||
'act_from': lambda obj,cr,uid,context={}: uid,
|
||||
'act_to': lambda obj,cr,uid,context={}: uid,
|
||||
'date_sent': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'date_sent': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
}
|
||||
res_request_history()
|
||||
|
||||
|
||||
@@ -1,12 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<menuitem name="Requests" id="menu_resquest_ref" parent="base.next_id_4" sequence="1"/>
|
||||
|
||||
<record id="res_request_tree-view" model="ir.ui.view">
|
||||
<field name="name">res.request.tree</field>
|
||||
<field name="model">res.request</field>
|
||||
<field name="type">tree</field>
|
||||
<field name="arch" type="xml">
|
||||
<tree string="Requests" colors="blue:state in ('draft');gray:state in ('closed')">
|
||||
<tree string="Requests" colors="blue:state in ('waiting');gray:state in ('closed')">
|
||||
<field name="create_date"/>
|
||||
<field name="act_from"/>
|
||||
<field name="act_to"/>
|
||||
@@ -40,9 +42,9 @@
|
||||
<field colspan="4" name="body" nolabel="1"/>
|
||||
<group col="5" colspan="4">
|
||||
<field name="state"/>
|
||||
<button name="request_close" states="waiting,draft,active" string="End of Request" type="object"/>
|
||||
<button name="request_send" states="draft,active" string="Send" type="object"/>
|
||||
<button name="request_reply" states="waiting" string="Reply" type="object"/>
|
||||
<button name="request_close" states="waiting,draft,active" string="Close" type="object" icon="gtk-close"/>
|
||||
<button name="request_send" states="draft,active" string="Send" type="object" icon="terp-camera_test"/>
|
||||
<button name="request_reply" states="waiting" string="Reply" type="object" icon="gtk-undo"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="References" groups="base.group_extended">
|
||||
@@ -75,12 +77,15 @@
|
||||
<field name="type">search</field>
|
||||
<field name="arch" type="xml">
|
||||
<search string="Requests">
|
||||
<group colspan="4" col="10">
|
||||
<field name="act_from"/>
|
||||
<field name="act_to" select="1"/>
|
||||
<field name="name"/>
|
||||
<field name="state"/>
|
||||
</group>
|
||||
<filter string="Current" icon="terp-camera_test" domain="['|',('state','=','draft'),('state','=','active')]"
|
||||
help="Draft and Active"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Waiting" icon="terp-gtk-media-pause" domain="[('state','=','waiting')]"/>
|
||||
<separator orientation="vertical"/>
|
||||
<field name="act_from"/>
|
||||
<field name="act_to" select="1"/>
|
||||
<field name="name"/>
|
||||
<field name="state"/>
|
||||
<newline/>
|
||||
<group expand="0" string="Group By" colspan="4">
|
||||
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
|
||||
@@ -108,7 +113,7 @@
|
||||
<field name="search_view_id" ref="res_request_search_view"/>
|
||||
<field name="context">{"search_default_act_to":uid}</field>
|
||||
</record>
|
||||
<menuitem action="res_request-act" id="menu_res_request_act" parent="base.next_id_4" sequence="1"/>
|
||||
<menuitem action="res_request-act" id="menu_res_request_act" parent="menu_resquest_ref" />
|
||||
|
||||
<record id="res_request_link-view" model="ir.ui.view">
|
||||
<field name="name">res.request.link.form</field>
|
||||
@@ -146,14 +151,16 @@
|
||||
</record>
|
||||
|
||||
<record id="res_request_link-act" model="ir.actions.act_window">
|
||||
<field name="name">References Link</field>
|
||||
<field name="name">Request Reference Types</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">res.request.link</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_id" eval="False"/>
|
||||
<field name="search_view_id" ref="res_request_link_search_view"/>
|
||||
</record>
|
||||
<menuitem action="res_request_link-act" id="menu_res_request_link_act" parent="base.next_id_4" sequence="4"/>
|
||||
<menuitem action="res_request_link-act" id="menu_res_request_link_act" parent="menu_resquest_ref" />
|
||||
|
||||
|
||||
|
||||
|
||||
<record id="res_request_history_tree-view" model="ir.ui.view">
|
||||
|
||||
@@ -28,6 +28,7 @@ import pooler
|
||||
from tools.translate import _
|
||||
from service import security
|
||||
import netsvc
|
||||
import time
|
||||
|
||||
class groups(osv.osv):
|
||||
_name = "res.groups"
|
||||
@@ -46,7 +47,7 @@ class groups(osv.osv):
|
||||
|
||||
def copy(self, cr, uid, id, default=None, context={}):
|
||||
group_name = self.read(cr, uid, [id], ['name'])[0]['name']
|
||||
default.update({'name': group_name +' (copy)'})
|
||||
default.update({'name': _('%s (copy)')%group_name})
|
||||
return super(groups, self).copy(cr, uid, id, default, context)
|
||||
|
||||
def write(self, cr, uid, ids, vals, context=None):
|
||||
@@ -74,14 +75,6 @@ class groups(osv.osv):
|
||||
aid.write({'groups_id': [(4, gid)]})
|
||||
return gid
|
||||
|
||||
def copy(self, cr, uid, id, default={}, context={}, done_list=[], local=False):
|
||||
group = self.browse(cr, uid, id, context=context)
|
||||
default = default.copy()
|
||||
if not 'name' in default:
|
||||
default['name'] = group['name']
|
||||
default['name'] = default['name'] + _(' (copy)')
|
||||
return super(groups, self).copy(cr, uid, id, default, context=context)
|
||||
|
||||
def get_extended_interface_group(self, cr, uid, context=None):
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
extended_group_data_id = data_obj._get_id(cr, uid, 'base', 'group_extended')
|
||||
@@ -152,10 +145,8 @@ class users(osv.osv):
|
||||
return self.WELCOME_MAIL_BODY
|
||||
|
||||
def get_current_company(self, cr, uid):
|
||||
res=[]
|
||||
cr.execute('select company_id, res_company.name from res_users left join res_company on res_company.id = company_id where res_users.id=%s' %uid)
|
||||
res = cr.fetchall()
|
||||
return res
|
||||
return cr.fetchall()
|
||||
|
||||
def send_welcome_email(self, cr, uid, id, context=None):
|
||||
logger= netsvc.Logger()
|
||||
@@ -240,7 +231,7 @@ class users(osv.osv):
|
||||
" aren't configured, it won't be possible to email new "
|
||||
"users."),
|
||||
'signature': fields.text('Signature', size=64),
|
||||
'address_id': fields.many2one('res.partner.address', 'Company Address'),
|
||||
'address_id': fields.many2one('res.partner.address', 'Address'),
|
||||
'active': fields.boolean('Active'),
|
||||
'action_id': fields.many2one('ir.actions.actions', 'Home Action', help="If specified, this action will be opened at logon for this user, in addition to the standard menu."),
|
||||
'menu_id': fields.many2one('ir.actions.actions', 'Menu Action', help="If specified, the action will replace the standard menu for this user."),
|
||||
@@ -265,7 +256,7 @@ class users(osv.osv):
|
||||
string='Interface', help="Choose between the simplified interface and the extended one"),
|
||||
'user_email': fields.function(_email_get, method=True, fnct_inv=_email_set, string='Email', type="char", size=240),
|
||||
'menu_tips': fields.boolean('Menu Tips', help="Check out this box if you want to always display tips on each menu action"),
|
||||
|
||||
'date': fields.datetime('Last Connection', readonly=True),
|
||||
}
|
||||
|
||||
def on_change_company_id(self, cr, uid, ids, company_id):
|
||||
@@ -336,8 +327,9 @@ class users(osv.osv):
|
||||
return ids and ids[0] or False
|
||||
|
||||
def _get_group(self,cr, uid, context=None):
|
||||
ids = self.pool.get('res.groups').search(cr, uid, [('name','=','Employee')], context=context)
|
||||
return ids or False
|
||||
dataobj = self.pool.get('ir.model.data')
|
||||
dummy,group_id = dataobj.get_object_reference(cr, 1, 'base', 'group_user')
|
||||
return [group_id]
|
||||
|
||||
_defaults = {
|
||||
'password' : lambda *a : '',
|
||||
@@ -431,12 +423,13 @@ class users(osv.osv):
|
||||
cr = pooler.get_db(db).cursor()
|
||||
cr.execute('select id from res_users where login=%s and password=%s and active', (tools.ustr(login), tools.ustr(password)))
|
||||
res = cr.fetchone()
|
||||
cr.close()
|
||||
result = False
|
||||
if res:
|
||||
return res[0]
|
||||
else:
|
||||
return False
|
||||
|
||||
cr.execute("update res_users set date=%s where id=%s", (time.strftime('%Y-%m-%d %H:%M:%S'),res[0]))
|
||||
cr.commit()
|
||||
result = res[0]
|
||||
cr.close()
|
||||
return result
|
||||
def check_super(self, passwd):
|
||||
if passwd == tools.config['admin_passwd']:
|
||||
return True
|
||||
|
||||
@@ -14,7 +14,7 @@
|
||||
</record>
|
||||
|
||||
<record model="res.groups" id="group_user">
|
||||
<field name="name">Employee</field>
|
||||
<field name="name">Internal User</field>
|
||||
</record>
|
||||
|
||||
<record model="res.groups" context="{'noadmin':True}" id="group_multi_company">
|
||||
|
||||
@@ -8,12 +8,10 @@
|
||||
"access_ir_exports_line_group_system","ir_exports_line group_system","model_ir_exports_line","base.group_user",1,1,1,1
|
||||
"access_ir_model_group_erp_manager","ir_model group_erp_manager","model_ir_model","group_erp_manager",1,1,1,1
|
||||
"access_ir_model_access_group_erp_manager","ir_model_access_group_erp_manager","model_ir_model_access","group_erp_manager",1,1,1,1
|
||||
"access_ir_model_grid_group_erp_manager","ir_model_access_grid_group_erp_manager","model_ir_model_grid","group_erp_manager",1,1,1,1
|
||||
"access_ir_model_data_group_erp_manager","ir_model_data group_erp_manager","model_ir_model_data","group_erp_manager",1,1,1,1
|
||||
"access_ir_model_fields_group_erp_manager","ir_model_fields group_erp_manager","model_ir_model_fields","group_erp_manager",1,1,1,1
|
||||
"access_ir_model_all","ir_model_all","model_ir_model",,1,0,0,0
|
||||
"access_ir_model_access_all","ir_model_access_all","model_ir_model_access",,1,0,0,0
|
||||
"access_ir_model_grid_all","ir_model_access_grid_all","model_ir_model_grid",,0,0,0,0
|
||||
"access_ir_model_data_all","ir_model_data all","model_ir_model_data",,1,0,0,0
|
||||
"access_ir_model_fields_all","ir_model_fields all","model_ir_model_fields",,1,0,0,0
|
||||
"access_ir_module_category_group_user","ir_module_category group_user","model_ir_module_category","group_system",1,0,0,0
|
||||
@@ -22,8 +20,6 @@
|
||||
"access_ir_module_module_dependency_group_system","ir_module_module_dependency group_system","model_ir_module_module_dependency","group_system",1,1,1,1
|
||||
"access_ir_property_group_user","ir_property group_user","model_ir_property",,1,0,0,0
|
||||
"access_ir_property_group_user_manager","ir_property group_manager","model_ir_property","base.group_partner_manager",1,1,1,0
|
||||
"access_ir_report_custom_group_system","ir_report_custom group_system","model_ir_report_custom",,1,0,0,0
|
||||
"access_ir_report_custom_fields_group_system","ir_report_custom_fields group_system","model_ir_report_custom_fields",,1,0,0,0
|
||||
"access_ir_rule_group_user","ir_rule group_user","model_ir_rule",,1,0,0,0
|
||||
"access_ir_rule_group_erp_manager","ir_rule group_erp_manager","model_ir_rule","group_erp_manager",1,1,1,1
|
||||
"access_ir_sequence_group_user","ir_sequence group_user","model_ir_sequence",,1,0,0,0
|
||||
@@ -102,8 +98,6 @@
|
||||
"access_workflow_triggers_all","workflow_triggers_all","model_workflow_triggers",,1,0,0,0
|
||||
"access_workflow_triggers_group_system","workflow_triggers_group_system","model_workflow_triggers","group_system",1,1,1,1
|
||||
"access_workflow_workitem_all","workflow_workitem_all","model_workflow_workitem",,1,1,1,1
|
||||
"access_actions_report_custom_all","ir_actions_report_custom_all","model_ir_actions_report_custom",,1,0,0,0
|
||||
"access_actions_report_custom_group_system","ir_actions_report_custom_group_system","model_ir_actions_report_custom","group_system",1,1,1,1
|
||||
"access_ir_actions_act_window_view_all","ir_actions_act_window_view_all","model_ir_actions_act_window_view",,1,0,0,0
|
||||
"access_ir_actions_act_window_view_group_system","ir_actions_act_window_view_group_system","model_ir_actions_act_window_view","group_system",1,1,1,1
|
||||
"access_ir_actions_url_all","ir_actions_url_all","model_ir_actions_url",,1,0,0,0
|
||||
|
||||
|
+6
-6
@@ -211,7 +211,7 @@ def init_logger():
|
||||
handler = logging.handlers.WatchedFileHandler(logf)
|
||||
else:
|
||||
handler = logging.handlers.FileHandler(logf)
|
||||
except Exception, ex:
|
||||
except Exception:
|
||||
sys.stderr.write("ERROR: couldn't create the logfile directory. Logging to the standard output.\n")
|
||||
handler = logging.StreamHandler(sys.stdout)
|
||||
else:
|
||||
@@ -269,11 +269,11 @@ class Logger(object):
|
||||
level_method('[%02d]: %s' % (idx+1, s,))
|
||||
elif result:
|
||||
level_method(result[0])
|
||||
except IOError,e:
|
||||
except IOError:
|
||||
# TODO: perhaps reset the logger streams?
|
||||
#if logrotate closes our files, we end up here..
|
||||
pass
|
||||
except:
|
||||
except Exception:
|
||||
# better ignore the exception and carry on..
|
||||
pass
|
||||
|
||||
@@ -473,13 +473,13 @@ class OpenERPDispatcher:
|
||||
|
||||
def dispatch(self, service_name, method, params):
|
||||
try:
|
||||
logger = logging.getLogger('result')
|
||||
self.log('service', service_name)
|
||||
self.log('method', method)
|
||||
self.log('params', params)
|
||||
self.log('params', params, depth=(logger.isEnabledFor(logging.DEBUG_RPC_ANSWER) and 3 or 1))
|
||||
auth = getattr(self, 'auth_provider', None)
|
||||
result = ExportService.getService(service_name).dispatch(method, auth, params)
|
||||
logger = logging.getLogger('result')
|
||||
self.log('result', result, channel=logging.DEBUG_RPC_ANSWER, depth=(logger.isEnabledFor(logging.DEBUG_SQL) and 1 or None))
|
||||
self.log('result', result, channel=logging.DEBUG_RPC_ANSWER, depth=(logger.isEnabledFor(logging.DEBUG_SQL) and 5 or 3))
|
||||
return result
|
||||
except Exception, e:
|
||||
self.log('exception', tools.exception_to_unicode(e))
|
||||
|
||||
+13
-11
@@ -1359,8 +1359,8 @@ class orm_template(object):
|
||||
if trans:
|
||||
node.set('sum', trans)
|
||||
|
||||
if childs:
|
||||
for f in node:
|
||||
for f in node:
|
||||
if childs or (node.tag == 'field' and f.tag in ('filter','separator')):
|
||||
fields.update(self.__view_look_dom(cr, user, f, view_id, context))
|
||||
|
||||
return fields
|
||||
@@ -3922,13 +3922,17 @@ class orm(orm_template):
|
||||
return True
|
||||
|
||||
def _apply_ir_rules(self, cr, uid, query, mode='read', context=None):
|
||||
"""Add what's missing in ``query`` to implement all appropriate ir.rules
|
||||
"""Add what's missing in ``query`` to implement all appropriate ir.rules
|
||||
(using the ``model_name``'s rules or the current model's rules if ``model_name`` is None)
|
||||
|
||||
:param query: the current query object
|
||||
"""
|
||||
def apply_rule(added_clause, added_params, added_tables):
|
||||
def apply_rule(added_clause, added_params, added_tables, parent_model=None, child_object=None):
|
||||
if added_clause:
|
||||
if parent_model and child_object:
|
||||
# as inherited rules are being applied, we need to add the missing JOIN
|
||||
# to reach the parent table (if it was not JOINed yet in the query)
|
||||
child_object._inherits_join_add(parent_model, query)
|
||||
query.where_clause += added_clause
|
||||
query.where_clause_params += added_params
|
||||
for table in added_tables:
|
||||
@@ -3941,13 +3945,11 @@ class orm(orm_template):
|
||||
rule_obj = self.pool.get('ir.rule')
|
||||
apply_rule(*rule_obj.domain_get(cr, uid, self._name, mode, context=context))
|
||||
|
||||
# apply ir.rules from the parents (through _inherits), adding the appropriate JOINs if needed
|
||||
# apply ir.rules from the parents (through _inherits)
|
||||
for inherited_model in self._inherits:
|
||||
if apply_rule(*rule_obj.domain_get(cr, uid, inherited_model, mode, context=context)):
|
||||
# if some rules were applied, need to add the missing JOIN for them to make sense, passing the previous
|
||||
# list of table in case the inherited table was not in the list before (as that means the corresponding
|
||||
# JOIN(s) was(were) not present)
|
||||
self._inherits_join_add(inherited_model, query)
|
||||
apply_rule(*rule_obj.domain_get(cr, uid, inherited_model, mode, context=context),
|
||||
parent_model=inherited_model,
|
||||
child_object=self)
|
||||
|
||||
def _generate_m2o_order_by(self, order_field, query):
|
||||
"""
|
||||
@@ -3978,7 +3980,7 @@ class orm(orm_template):
|
||||
# extract the first field name, to be able to qualify it and add desc/asc
|
||||
m2o_order = m2o_order.split(",",1)[0].strip().split(" ",1)[0]
|
||||
|
||||
# Join the dest m2o table if it's not joined yet. We use [LEFT] OUTER join here
|
||||
# Join the dest m2o table if it's not joined yet. We use [LEFT] OUTER join here
|
||||
# as we don't want to exclude results that have NULL values for the m2o
|
||||
src_table, src_field = qualified_field.replace('"','').split('.', 1)
|
||||
query.join((src_table, dest_model._table, src_field, 'id'), outer=True)
|
||||
|
||||
@@ -105,13 +105,13 @@ class report_printscreen_list(report_int):
|
||||
dom = datas.get('_domain',[])
|
||||
get_groupby_data(self.groupby, dom)
|
||||
else:
|
||||
rows = model.read(cr, uid, datas['ids'], result['fields'].keys(), context)
|
||||
ids2 = map(itemgetter('id'), rows) # getting the ids from read result
|
||||
if datas['ids'] != ids2: # sorted ids were not taken into consideration for print screen
|
||||
rows_new = []
|
||||
for id in datas['ids']:
|
||||
rows_new += [elem for elem in rows if elem['id'] == id]
|
||||
rows = rows_new
|
||||
rows = model.read(cr, uid, datas['ids'], result['fields'].keys(), context)
|
||||
ids2 = map(itemgetter('id'), rows) # getting the ids from read result
|
||||
if datas['ids'] != ids2: # sorted ids were not taken into consideration for print screen
|
||||
rows_new = []
|
||||
for id in datas['ids']:
|
||||
rows_new += [elem for elem in rows if elem['id'] == id]
|
||||
rows = rows_new
|
||||
res = self._create_table(uid, datas['ids'], result['fields'], fields_order, rows, context, model_desc)
|
||||
return (self.obj.get(), 'pdf')
|
||||
|
||||
@@ -232,7 +232,7 @@ class report_printscreen_list(report_int):
|
||||
if line[f] != None:
|
||||
col.text = tools.ustr(line[f] or '')
|
||||
if float_flag:
|
||||
col.set('tree','float')
|
||||
col.set('tree','float')
|
||||
if line.get('__no_leaf') and temp[count] == 1 and f != 'id' and not line['__context']['group_by']:
|
||||
tsum[count] = float(tsum[count]) + float(line[f])
|
||||
if not line.get('__group') and f != 'id' and temp[count] == 1:
|
||||
@@ -240,19 +240,18 @@ class report_printscreen_list(report_int):
|
||||
else:
|
||||
col.text = '/'
|
||||
|
||||
|
||||
|
||||
node_line = etree.SubElement(lines, 'row')
|
||||
for f in range(0, len(fields_order)):
|
||||
col = etree.SubElement(node_line, 'col', para='group', tree='no')
|
||||
col.set('tree','float')
|
||||
col.set('tree', 'float')
|
||||
if tsum[f] != None:
|
||||
if tsum[f] >= 0.01 :
|
||||
prec = '%.2f'
|
||||
total = prec%(tsum[f])
|
||||
txt = str(total or '')
|
||||
else:
|
||||
txt = str(tsum[f] or '')
|
||||
if tsum[f] != 0.0:
|
||||
digits = fields[fields_order[f]].get('digits', (16, 2))
|
||||
prec = '%%.%sf' % (digits[1], )
|
||||
total = prec % (tsum[f], )
|
||||
txt = str(total or '')
|
||||
else:
|
||||
txt = str(tsum[f] or '')
|
||||
else:
|
||||
txt = '/'
|
||||
if f == 0:
|
||||
|
||||
@@ -253,7 +253,7 @@ class rml_parse(object):
|
||||
if ids:
|
||||
d = decimal_precision_obj.browse(self.cr, self.uid, ids)[0].digits
|
||||
elif obj and f:
|
||||
res_digits = getattr(obj._columns[f], 'digits', lambda x: ((16,DEFAULT_DIGITS)))
|
||||
res_digits = getattr(obj._columns[f], 'digits', lambda x: ((16, DEFAULT_DIGITS)))
|
||||
if isinstance(res_digits, tuple):
|
||||
d = res_digits[1]
|
||||
else:
|
||||
@@ -264,9 +264,19 @@ class rml_parse(object):
|
||||
d = obj._field.digits[1] or DEFAULT_DIGITS
|
||||
return d
|
||||
|
||||
def formatLang(self, value, digits=None, date=False, date_time=False, grouping=True, monetary=False):
|
||||
def formatLang(self, value, digits=None, date=False, date_time=False, grouping=True, monetary=False, dp=False):
|
||||
"""
|
||||
Assuming 'Account' decimal.precision=3:
|
||||
formatLang(value) -> digits=2 (default)
|
||||
formatLang(value, digits=4) -> digits=4
|
||||
formatLang(value, dp='Account') -> digits=3
|
||||
formatLang(value, digits=5, dp='Account') -> digits=5
|
||||
"""
|
||||
if digits is None:
|
||||
digits = self.get_digits(value)
|
||||
if dp:
|
||||
digits = self.get_digits(dp=dp)
|
||||
else:
|
||||
digits = self.get_digits(value)
|
||||
|
||||
if isinstance(value, (str, unicode)) and not value:
|
||||
return ''
|
||||
|
||||
Reference in New Issue
Block a user