[MERGE] upstream

bzr revid: fme@openerp.com-20140429154104-csm3jq6uxy9tk1ea
This commit is contained in:
Fabien Meghazi 2014-04-29 17:41:04 +02:00
commit b7003a382a
271 changed files with 2811 additions and 31530 deletions

View File

@ -49,7 +49,7 @@ for a particular financial year and for preparation of vouchers there is a modul
""",
'website': 'http://www.openerp.com',
'images' : ['images/accounts.jpeg','images/bank_statement.jpeg','images/cash_register.jpeg','images/chart_of_accounts.jpeg','images/customer_invoice.jpeg','images/journal_entries.jpeg'],
'depends' : ['base_setup', 'product', 'analytic', 'process', 'board', 'edi', 'report'],
'depends' : ['base_setup', 'product', 'analytic', 'board', 'edi', 'report'],
'data': [
'security/account_security.xml',
'security/ir.model.access.csv',
@ -114,17 +114,12 @@ for a particular financial year and for preparation of vouchers there is a modul
'partner_view.xml',
'product_view.xml',
'account_assert_test.xml',
'process/statement_process.xml',
'process/customer_invoice_process.xml',
'process/supplier_invoice_process.xml',
'ir_sequence_view.xml',
'company_view.xml',
'board_account_view.xml',
'edi/invoice_action_data.xml',
'account_bank_view.xml',
'res_config_view.xml',
'account_pre_install.yml',
'views/report_vat.xml',
'views/report_invoice.xml',
'views/report_trialbalance.xml',

View File

@ -430,6 +430,19 @@ class account_move_line(osv.osv):
elif line.reconcile_partial_id:
res[line.id] = str(line.reconcile_partial_id.name)
return res
def _get_move_from_reconcile(self, cr, uid, ids, context=None):
move = {}
for r in self.pool.get('account.move.reconcile').browse(cr, uid, ids, context=context):
for line in r.line_partial_ids:
move[line.move_id.id] = True
for line in r.line_id:
move[line.move_id.id] = True
move_line_ids = []
if move:
move_line_ids = self.pool.get('account.move.line').search(cr, uid, [('journal_id','in',move.keys())], context=context)
return move_line_ids
_columns = {
'name': fields.char('Name', size=64, required=True),
@ -445,7 +458,8 @@ class account_move_line(osv.osv):
'statement_id': fields.many2one('account.bank.statement', 'Statement', help="The bank statement used for bank reconciliation", select=1),
'reconcile_id': fields.many2one('account.move.reconcile', 'Reconcile', readonly=True, ondelete='set null', select=2),
'reconcile_partial_id': fields.many2one('account.move.reconcile', 'Partial Reconcile', readonly=True, ondelete='set null', select=2),
'reconcile': fields.function(_get_reconcile, type='char', string='Reconcile Ref'),
'reconcile': fields.function(_get_reconcile, type='char', string='Reconcile Ref', store={
'account.move.line': (lambda self, cr, uid, ids, c={}: ids, ['reconcile_id','reconcile_partial_id'], 50),'account.move.reconcile': (_get_move_from_reconcile, None, 50)}),
'amount_currency': fields.float('Amount Currency', help="The amount expressed in an optional other currency if it is a multi-currency entry.", digits_compute=dp.get_precision('Account')),
'amount_residual_currency': fields.function(_amount_residual, string='Residual Amount in Currency', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in its currency (maybe different of the company currency)."),
'amount_residual': fields.function(_amount_residual, string='Residual Amount', multi="residual", help="The residual amount on a receivable or payable of a journal entry expressed in the company currency."),
@ -628,7 +642,7 @@ class account_move_line(osv.osv):
(_check_date, 'The date of your Journal Entry is not in the defined period! You should change the date or remove this constraint from the journal.', ['date']),
(_check_currency, 'The selected account of your Journal Entry forces to provide a secondary currency. You should remove the secondary currency on the account or select a multi-currency view on the journal.', ['currency_id']),
(_check_currency_and_amount, "You cannot create journal items with a secondary currency without recording both 'currency' and 'amount currency' field.", ['currency_id','amount_currency']),
(_check_currency_amount, 'The amount expressed in the secondary currency must be positive when the journal item is a debit and negative when if it is a credit.', ['amount_currency']),
(_check_currency_amount, 'The amount expressed in the secondary currency must be positive when account is debited and negative when account is credited.', ['amount_currency']),
(_check_currency_company, "You cannot provide a secondary currency if it is the same than the company one." , ['currency_id']),
]

View File

@ -384,6 +384,7 @@
<group expand="0" string="Group By...">
<filter string="User" context="{'group_by':'user_id'}" icon="terp-personal"/>
<filter string="Type" context="{'group_by':'type'}" icon="terp-stock_symbol-selection"/>
<filter string="Company" context="{'group_by':'company_id'}" icon="terp-go-home" groups="base.group_multi_company"/>
</group>
</search>
</field>
@ -881,6 +882,7 @@
<field name="price_include"/>
<field name="description"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<field name="type_tax_use" invisible="1"/>
</tree>
</field>
</record>
@ -891,6 +893,12 @@
<search string="Search Taxes">
<field name="name" filter_domain="['|', ('name','ilike',self), ('description','ilike',self)]" string="Tax"/>
<field name="company_id" groups="base.group_multi_company"/>
<filter string="Sale" domain="[('type_tax_use','=','sale')]" />
<filter string="Purchase" domain="[('type_tax_use','=','purchase')]" />
<group string="Group By...">
<filter string="Company" domain="[]" context="{'group_by':'company_id'}"/>
<filter string="Tax Application" domain="[]" context="{'group_by':'type_tax_use'}"/>
</group>
</search>
</field>
</record>

View File

@ -1,46 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="action_company_analysis_tree" model="ir.actions.act_window">
<field name="name">Company Analysis</field>
<field name="res_model">account.entries.report</field>
<field name="view_type">form</field>
<field name="view_mode">tree,graph</field>
<field name="context">{'group_by':['user_type'], 'group_by_no_leaf':1}</field>
<field name="view_id" ref="account.view_account_entries_report_tree"/>
<field name="domain">[('year','=',time.strftime('%Y'))]</field>
</record>
<record id="board_account_form" model="ir.ui.view">
<field name="name">board.account.form</field>
<field name="model">board.board</field>
<field name="arch" type="xml">
<form string="Account Board" version="7.0">
<board style="2-1">
<column>
<action name="%(action_company_analysis_tree)d" string="Company Analysis"/>
</column>
</board>
</form>
</field>
</record>
<record id="open_board_account" model="ir.actions.act_window">
<field name="name">Accounting</field>
<field name="res_model">board.board</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="usage">menu</field>
<field name="view_id" ref="board_account_form"/>
</record>
<menuitem id="menu_board_account"
action="open_board_account"
icon="terp-graph"
parent="base.menu_reporting_dashboard"
groups="group_account_user,group_account_manager"
sequence="45"/>
</data>
</openerp>

View File

@ -97,7 +97,7 @@
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<page name="sales_purchases" position="after" version="7.0">
<page string="Accounting" col="4" name="accounting" attrs="{'invisible': [('is_company','=',False),('parent_id','!=',False)]}">
<page string="Accounting" col="4" name="accounting" attrs="{'invisible': [('is_company','=',False),('parent_id','!=',False)]}" groups="account.group_account_invoice">
<group>
<group>
<field name="property_account_position" widget="selection"/>
@ -127,7 +127,7 @@
</tree>
</field>
</page>
<page string="Accounting" name="accounting_disabled" attrs="{'invisible': ['|',('is_company','=',True),('parent_id','=',False)]}">
<page string="Accounting" name="accounting_disabled" attrs="{'invisible': ['|',('is_company','=',True),('parent_id','=',False)]}" groups="account.group_account_invoice">
<div>
<p>Accounting-related settings are managed on <button name="open_commercial_entity" type="object" string="the parent company" class="oe_link"/></p>
</div>

View File

@ -1,199 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
<!--
Process
-->
<record id="process_process_invoiceprocess0" model="process.process">
<field eval="1" name="active"/>
<field name="model_id" ref="account.model_account_invoice"/>
<field eval="&quot;&quot;&quot;Customer Invoice&quot;&quot;&quot;" name="name"/>
</record>
<!--
Process Node
-->
<record id="process_node_analytic0" model="process.node">
<field name="menu_id" ref="account.account_analytic_def_account"/>
<field name="model_id" ref="analytic.model_account_analytic_account"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Analytic Costs&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Analytic costs to invoice&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_invoiceprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('draft', 'open', 'pending', 'close')&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_draftinvoices0" model="process.node">
<field name="menu_id" ref="account.menu_action_invoice_tree1"/>
<field name="model_id" ref="account.model_account_invoice"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Draft Invoice&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Draft state of an invoice&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_invoiceprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_invoiceinvoice0" model="process.node">
<field name="menu_id" ref="account.menu_finance_receivables"/>
<field name="model_id" ref="account.model_account_invoice"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Create Invoice&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Invoice's state is Open&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_invoiceprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_accountingentries0" model="process.node">
<field name="menu_id" ref="account.menu_action_move_journal_line_form"/>
<field name="model_id" ref="account.model_account_move"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Accounting&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Accounting entries.&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_invoiceprocess0"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_bankstatement0" model="process.node">
<field name="menu_id" ref="account.menu_bank_statement_tree"/>
<field name="model_id" ref="account.model_account_bank_statement"/>
<field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Bank Statement&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Registered payment&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_invoiceprocess0"/>
<field name="subflow_id" ref="process_process_statementprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_paymententries0" model="process.node">
<field name="menu_id" ref="account.menu_action_move_journal_line_form"/>
<field name="model_id" ref="account.model_account_move_line"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Payment&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Payment entries&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_invoiceprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('draft', 'valid')&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_reconciliation0" model="process.node">
<field name="model_id" ref="account.model_account_move_reconcile"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Reconciliation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Comparison between accounting and payment entries&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_invoiceprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='valid'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_paidinvoice0" model="process.node">
<field name="menu_id" ref="account.menu_action_invoice_tree1"/>
<field name="model_id" ref="account.model_account_invoice"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Paid invoice&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Invoice's state is Done&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_invoiceprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='paid'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_accountingstatemententries0" model="process.node">
<field name="model_id" ref="account.model_account_move_line"/>
<field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Bank Statement&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Bank statement&quot;&quot;&quot;" name="note"/>
<field name="subflow_id" ref="account.process_process_invoiceprocess0"/>
<field name="process_id" ref="process_process_statementprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('draft', 'valid')&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<!--
Process Transition
-->
<record id="process_transition_confirmstatementfromdraft0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Confirm statement&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The accountant confirms the statement.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_accountingstatemententries0"/>
<field name="source_node_id" ref="account.process_node_draftstatement0"/>
</record>
<record id="process_transition_analyticinvoice0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;From analytic accounts&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Analytic costs (timesheets, some purchased products, ...) come from analytic accounts. These generate draft invoices.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_draftinvoices0"/>
<field name="source_node_id" ref="process_node_analytic0"/>
</record>
<record id="process_transition_customerinvoice0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Validation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Draft invoices are checked, validated and printed.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_invoiceinvoice0"/>
<field name="source_node_id" ref="process_node_draftinvoices0"/>
<field eval="[(6,0,[ref('account.pro2_to_open')])]" name="transition_ids"/>
</record>
<record id="process_transition_validentries0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Validation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Accountant validates the accounting entries coming from the invoice.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_accountingentries0"/>
<field name="source_node_id" ref="process_node_invoiceinvoice0"/>
</record>
<record id="process_transition_entriesreconcile0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Accounting entries&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Accounting entries are the first input of the reconciliation.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_reconciliation0"/>
<field name="source_node_id" ref="process_node_accountingentries0"/>
</record>
<record id="process_transition_statemententries0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Validation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Manual or automatic creation of payment entries according to the statements&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_paymententries0"/>
<field name="source_node_id" ref="process_node_bankstatement0"/>
</record>
<record id="process_transition_paymentreconcile0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Payment entries&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Payment entries are the second input of the reconciliation.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_reconciliation0"/>
<field name="source_node_id" ref="process_node_paymententries0"/>
</record>
<record id="process_transition_reconcilepaid0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Payment&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;As soon as the reconciliation is done, the invoice can be paid.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_paidinvoice0"/>
<field name="source_node_id" ref="process_node_reconciliation0"/>
</record>
<!--
Process Action
-->
<record id="process_transition_action_createentries0" model="process.transition.action">
<field eval="&quot;&quot;&quot;action_move_create&quot;&quot;&quot;" name="action"/>
<field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
<field eval="&quot;&quot;&quot;Create entry&quot;&quot;&quot;" name="name"/>
<field name="transition_id" ref="process_transition_customerinvoice0"/>
</record>
</data>
</openerp>

View File

@ -1,93 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
<!--
Process
-->
<record id="process_process_statementprocess0" model="process.process">
<field eval="1" name="active"/>
<field name="model_id" ref="account.model_account_bank_statement"/>
<field eval="&quot;&quot;&quot;Statement&quot;&quot;&quot;" name="name"/>
</record>
<!--
Process Node
-->
<record id="process_node_electronicfile0" model="process.node">
<field name="menu_id" ref="account.menu_bank_statement_tree"/>
<field name="model_id" ref="account.model_account_bank_statement"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Electronic File&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Automatic entry&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_statementprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_manually0" model="process.node">
<field name="menu_id" ref="account.menu_bank_statement_tree"/>
<field name="model_id" ref="account.model_account_bank_statement"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Manually&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Manual entry&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_statementprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_importinvoice0" model="process.node">
<field name="menu_id" ref="account.menu_bank_statement_tree"/>
<field name="model_id" ref="account.model_account_bank_statement"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Import from invoice&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Statement from invoice or payment&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_statementprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_draftstatement0" model="process.node">
<field name="menu_id" ref="account.menu_bank_statement_tree"/>
<field name="model_id" ref="account.model_account_bank_statement"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Draft statement&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;State is draft&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_statementprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<!--
Process Transition
-->
<record id="process_transition_filestatement0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Automatic import of the bank statement&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Import of the statement in the system from an electronic file&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_draftstatement0"/>
<field name="source_node_id" ref="process_node_electronicfile0"/>
</record>
<record id="process_transition_invoicemanually0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Manual entry&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;A statement with manual entries becomes a draft statement.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_draftstatement0"/>
<field name="source_node_id" ref="process_node_manually0"/>
</record>
<record id="process_transition_invoiceimport0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Import from invoice or payment&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Import of the statement in the system from a supplier or customer invoice&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_draftstatement0"/>
<field name="source_node_id" ref="process_node_importinvoice0"/>
</record>
</data>
</openerp>

View File

@ -1,168 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
<!--
Process
-->
<record id="process_process_supplierinvoiceprocess0" model="process.process">
<field eval="1" name="active"/>
<field name="model_id" ref="account.model_account_invoice"/>
<field eval="&quot;&quot;&quot;Supplier Invoice&quot;&quot;&quot;" name="name"/>
</record>
<!--
Process Node
-->
<record id="process_node_analyticcost0" model="process.node">
<field name="menu_id" ref="account.account_analytic_def_account"/>
<field name="model_id" ref="analytic.model_account_analytic_account"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Analytic Costs&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Analytic costs to invoice&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_supplierinvoiceprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('draft', 'open', 'pending', 'close')&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_supplierdraftinvoices0" model="process.node">
<field name="menu_id" ref="account.menu_action_invoice_tree2"/>
<field name="model_id" ref="account.model_account_invoice"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Draft Invoices&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Draft state of an invoice&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_supplierinvoiceprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_supplierinvoiceinvoice0" model="process.node">
<field name="menu_id" ref="account.menu_finance_payables"/>
<field name="model_id" ref="account.model_account_invoice"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Create Invoice&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Invoice's state is Open&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_supplierinvoiceprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_supplierbankstatement0" model="process.node">
<field name="menu_id" ref="account.menu_bank_statement_tree"/>
<field name="model_id" ref="account.model_account_bank_statement"/>
<field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Bank Statement&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Manually or automatically entered in the system&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_supplierinvoiceprocess0"/>
<field name="subflow_id" ref="process_process_statementprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_supplieraccountingentries0" model="process.node">
<field name="menu_id" ref="account.menu_action_move_journal_line_form"/>
<field name="model_id" ref="account.model_account_move"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Accounting&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Accounting entries.&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_supplierinvoiceprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='posted'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_supplierpaymentorder0" model="process.node">
<field name="model_id" ref="account.model_account_move_line"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Payment Order&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Payment of invoices&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_supplierinvoiceprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_supplierreconciliation0" model="process.node">
<field name="model_id" ref="account.model_account_move_reconcile"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Reconciliation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Comparison between accounting and payment entries&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_supplierinvoiceprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='valid'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_supplierpaidinvoice0" model="process.node">
<field name="menu_id" ref="account.menu_action_invoice_tree1"/>
<field name="model_id" ref="account.model_account_invoice"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Paid invoice&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Invoice's state is Done.&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_supplierinvoiceprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='paid'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<!--
Process Transition
-->
<record id="process_transition_supplieranalyticcost0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;From analytic accounts&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Analytic costs (timesheets, some purchased products, ...) come from analytic accounts. These generate draft supplier invoices.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_supplierdraftinvoices0"/>
<field name="source_node_id" ref="process_node_analyticcost0"/>
</record>
<record id="process_transition_suppliercustomerinvoice0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Validation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Draft invoices are validated. &quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_supplierinvoiceinvoice0"/>
<field name="source_node_id" ref="process_node_supplierdraftinvoices0"/>
<field eval="[(6,0,[ref('account.pro2_to_open')])]" name="transition_ids"/>
</record>
<record id="process_transition_suppliervalidentries0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Validation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Accountant validates the accounting entries coming from the invoice. &quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_supplieraccountingentries0"/>
<field name="source_node_id" ref="process_node_supplierinvoiceinvoice0"/>
</record>
<record id="process_transition_supplierentriesreconcile0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Accounting entries&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Accounting entries are an input of the reconciliation.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_supplierreconciliation0"/>
<field name="source_node_id" ref="process_node_supplieraccountingentries0"/>
</record>
<record id="process_transition_paymentorderbank0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Payment entries&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The payment order is sent to the bank.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_supplierbankstatement0"/>
<field name="source_node_id" ref="process_node_supplierpaymentorder0"/>
</record>
<record id="process_transition_paymentorderreconcilation0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Validation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Bank statements are entered in the system.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_supplierreconciliation0"/>
<field name="source_node_id" ref="process_node_supplierbankstatement0"/>
</record>
<record id="process_transition_supplierreconcilepaid0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;System payment&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;As soon as the reconciliation is done, the invoice's state turns to “done” (i.e. paid) in the system.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_supplierpaidinvoice0"/>
<field name="source_node_id" ref="process_node_supplierreconciliation0"/>
</record>
</data>
</openerp>

View File

@ -259,6 +259,12 @@ class account_config_settings(osv.osv_memory):
def onchange_tax_rate(self, cr, uid, ids, rate, context=None):
return {'value': {'purchase_tax_rate': rate or False}}
def onchange_multi_currency(self, cr, uid, ids, group_multi_currency, context=None):
res = {}
if not group_multi_currency:
res['value'] = {'income_currency_exchange_account_id': False, 'expense_currency_exchange_account_id': False}
return res
def onchange_start_date(self, cr, uid, id, start_date):
if start_date:
start_date = datetime.datetime.strptime(start_date, "%Y-%m-%d")

View File

@ -122,7 +122,7 @@
<label for="id" string="Features"/>
<div>
<div name="group_multi_currency">
<field name="group_multi_currency" class="oe_inline"/>
<field name="group_multi_currency" class="oe_inline" on_change="onchange_multi_currency(group_multi_currency)"/>
<label for="group_multi_currency"/>
</div>
<div>

View File

@ -35,7 +35,7 @@ in one place. OpenERP's user interface is designed with productivity in mind.
<div class="oe_span6">
<img class="oe_picture oe_screenshot" src="account_sc_01.png">
</div>
</div>
</section>
@ -60,7 +60,7 @@ Share access to your latest business numbers with your team and your accountant
<p class='oe_mt32'>
Import your bank statements and reconcile them in just a few clicks. Prepare payment orders based on your supplier invoices and payment terms.
</p>
</div>
</div>
<div class="oe_span6">
<img class="oe_picture" src="account_illu_01.png">
</div>
@ -90,7 +90,7 @@ Create and send professional invoices &amp; get paid online. Get rid of the stre
<p class='oe_mt32'>
Automatically create invoices from sales orders, delivery orders or base them on time and material. Re-invoice expenses on projects to your customer in just a few clicks.
</p>
</div>
</div>
<div class="oe_span6">
<img class="oe_picture oe_screenshot" src="account_sc_04.png">
</div>
@ -119,7 +119,7 @@ Control supplier invocies based on purchase orders. Get real-time inventory valu
<p class='oe_mt32'>
Integrate your analytic accounting operations with timesheets, projects, invoices, expenses, etc. No need to record transactions, all analytic entries are posted automatically following your business rules.
</p>
</div>
</div>
<div class="oe_span6">
<img class="oe_picture oe_screenshot" src="account_sc_06.png">
</div>
@ -133,7 +133,7 @@ Integrate your analytic accounting operations with timesheets, projects, invoice
<div class="oe_span6">
<img src="account_illu_02.png">
</div>
<div class="oe_span6">
<div class="oe_span6">
<p class='oe_mt32'>
Manage your assets, track expenses, control budgets, multi-level analytic accounting; OpenERP has all the features you need to sustain all your business activities.
</p>
@ -143,34 +143,21 @@ Manage your assets, track expenses, control budgets, multi-level analytic accoun
<section class="oe_container oe_dark">
<div class="oe_row">
<div class="oe_row">
<h2 class="oe_slogan">Scale With Your Organization</h2>
<h3 class="oe_slogan">Used by very small to very large organizations</h3>
<div class="oe_span6">
<p class='oe_mt32'>
OpenERP supports multiple currencies, multiple users with different access rights, multiple companies with real time consolidation and unlimited analytic plans.
</p>
</div>
</div>
<div class="oe_span6">
<img class="oe_picture oe_screenshot" src="account_illu_03.png">
</div>
</div>
</div>
</section>
<section class="oe_container">
<div class="oe_row">
<h2 class="oe_slogan">Dashboard & KPIs</h2>
<div class="oe_span6">
<img class="oe_picture oe_screenshot" src="account_sc_06.png">
</div>
<div class="oe_span6">
<p class='oe_mt32'>
Get direct access to key information with dynamic and customizable dashboards. Analyse your financial activities with the drill-up, drill-down, drill-across and filter features.
</p>
</div>
</div>
</section>
<section class="oe_container oe_dark">
<div class="oe_row">
<div class="oe_span12">
<h2 class="oe_slogan">Many companies already enjoy it</h2>

View File

@ -0,0 +1,62 @@
# Slovak translation for openobject-addons
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2012-12-21 17:05+0000\n"
"PO-Revision-Date: 2014-04-26 16:04+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Slovak <sk@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-27 05:58+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: account_anglo_saxon
#: model:ir.model,name:account_anglo_saxon.model_product_category
msgid "Product Category"
msgstr ""
#. module: account_anglo_saxon
#: model:ir.model,name:account_anglo_saxon.model_account_invoice_line
msgid "Invoice Line"
msgstr ""
#. module: account_anglo_saxon
#: model:ir.model,name:account_anglo_saxon.model_purchase_order
msgid "Purchase Order"
msgstr ""
#. module: account_anglo_saxon
#: model:ir.model,name:account_anglo_saxon.model_product_template
msgid "Product Template"
msgstr ""
#. module: account_anglo_saxon
#: field:product.category,property_account_creditor_price_difference_categ:0
#: field:product.template,property_account_creditor_price_difference:0
msgid "Price Difference Account"
msgstr ""
#. module: account_anglo_saxon
#: model:ir.model,name:account_anglo_saxon.model_account_invoice
msgid "Invoice"
msgstr ""
#. module: account_anglo_saxon
#: model:ir.model,name:account_anglo_saxon.model_stock_picking
msgid "Picking List"
msgstr ""
#. module: account_anglo_saxon
#: help:product.category,property_account_creditor_price_difference_categ:0
#: help:product.template,property_account_creditor_price_difference:0
msgid ""
"This account will be used to value price difference between purchase price "
"and cost price."
msgstr ""

View File

@ -189,7 +189,7 @@ class account_voucher(osv.osv):
if not ids:
return []
if context is None: context = {}
return [(r['id'], (str("%.2f" % r['amount']) or '')) for r in self.read(cr, uid, ids, ['amount'], context, load='_classic_write')]
return [(r['id'], (r['number'] or _('Voucher'))) for r in self.read(cr, uid, ids, ['number'], context, load='_classic_write')]
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
mod_obj = self.pool.get('ir.model.data')

View File

@ -0,0 +1,135 @@
# Slovak translation for openobject-addons
# Copyright (c) 2014 Rosetta Contributors and Canonical Ltd 2014
# This file is distributed under the same license as the openobject-addons package.
# FIRST AUTHOR <EMAIL@ADDRESS>, 2014.
#
msgid ""
msgstr ""
"Project-Id-Version: openobject-addons\n"
"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
"POT-Creation-Date: 2011-01-11 11:14+0000\n"
"PO-Revision-Date: 2014-04-26 16:22+0000\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: Slovak <sk@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"X-Launchpad-Export-Date: 2014-04-27 05:58+0000\n"
"X-Generator: Launchpad (build 16985)\n"
#. module: association
#: field:profile.association.config.install_modules_wizard,wiki:0
msgid "Wiki"
msgstr ""
#. module: association
#: view:profile.association.config.install_modules_wizard:0
msgid "Event Management"
msgstr ""
#. module: association
#: field:profile.association.config.install_modules_wizard,project_gtd:0
msgid "Getting Things Done"
msgstr ""
#. module: association
#: model:ir.module.module,description:association.module_meta_information
msgid "This module is to create Profile for Associates"
msgstr ""
#. module: association
#: field:profile.association.config.install_modules_wizard,progress:0
msgid "Configuration Progress"
msgstr ""
#. module: association
#: view:profile.association.config.install_modules_wizard:0
msgid ""
"Here are specific applications related to the Association Profile you "
"selected."
msgstr ""
#. module: association
#: view:profile.association.config.install_modules_wizard:0
msgid "title"
msgstr ""
#. module: association
#: help:profile.association.config.install_modules_wizard,event_project:0
msgid "Helps you to manage and organize your events."
msgstr ""
#. module: association
#: field:profile.association.config.install_modules_wizard,config_logo:0
msgid "Image"
msgstr ""
#. module: association
#: help:profile.association.config.install_modules_wizard,hr_expense:0
msgid ""
"Tracks and manages employee expenses, and can automatically re-invoice "
"clients if the expenses are project-related."
msgstr ""
#. module: association
#: help:profile.association.config.install_modules_wizard,project_gtd:0
msgid ""
"GTD is a methodology to efficiently organise yourself and your tasks. This "
"module fully integrates GTD principle with OpenERP's project management."
msgstr ""
#. module: association
#: view:profile.association.config.install_modules_wizard:0
msgid "Resources Management"
msgstr ""
#. module: association
#: model:ir.module.module,shortdesc:association.module_meta_information
msgid "Association profile"
msgstr ""
#. module: association
#: field:profile.association.config.install_modules_wizard,hr_expense:0
msgid "Expenses Tracking"
msgstr ""
#. module: association
#: model:ir.actions.act_window,name:association.action_config_install_module
#: view:profile.association.config.install_modules_wizard:0
msgid "Association Application Configuration"
msgstr ""
#. module: association
#: help:profile.association.config.install_modules_wizard,wiki:0
msgid ""
"Lets you create wiki pages and page groups in order to keep track of "
"business knowledge and share it with and between your employees."
msgstr ""
#. module: association
#: help:profile.association.config.install_modules_wizard,project:0
msgid ""
"Helps you manage your projects and tasks by tracking them, generating "
"plannings, etc..."
msgstr ""
#. module: association
#: model:ir.model,name:association.model_profile_association_config_install_modules_wizard
msgid "profile.association.config.install_modules_wizard"
msgstr ""
#. module: association
#: field:profile.association.config.install_modules_wizard,event_project:0
msgid "Events"
msgstr ""
#. module: association
#: view:profile.association.config.install_modules_wizard:0
#: field:profile.association.config.install_modules_wizard,project:0
msgid "Project Management"
msgstr ""
#. module: association
#: view:profile.association.config.install_modules_wizard:0
msgid "Configure"
msgstr ""

View File

@ -1,25 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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/>.
#
##############################################################################
import audittrail
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,47 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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/>.
#
##############################################################################
{
'name': 'Audit Trail',
'version': '1.0',
'category': 'Tools',
'description': """
This module lets administrator track every user operation on all the objects of the system.
===========================================================================================
The administrator can subscribe to rules for read, write and delete on objects
and can check logs.
""",
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'depends': ['base'],
'data': [
'wizard/audittrail_view_log_view.xml',
'audittrail_view.xml',
'security/ir.model.access.csv',
],
'demo': ['audittrail_demo.xml'],
'installable': True,
'auto_install': False,
'images': ['images/audittrail1.jpeg','images/audittrail2.jpeg','images/audittrail3.jpeg'],
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,538 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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/>.
#
##############################################################################
import openerp
from openerp.osv import fields, osv
import openerp.service.model
from openerp.tools.translate import _
import time
from openerp import tools
from openerp import SUPERUSER_ID
class audittrail_rule(osv.osv):
"""
For Auddittrail Rule
"""
_name = 'audittrail.rule'
_description = "Audittrail Rule"
_columns = {
"name": fields.char("Rule Name", size=32, required=True),
"object_id": fields.many2one('ir.model', 'Object', required=True, help="Select object for which you want to generate log."),
"user_id": fields.many2many('res.users', 'audittail_rules_users',
'user_id', 'rule_id', 'Users', help="if User is not added then it will applicable for all users"),
"log_read": fields.boolean("Log Reads", help="Select this if you want to keep track of read/open on any record of the object of this rule"),
"log_write": fields.boolean("Log Writes", help="Select this if you want to keep track of modification on any record of the object of this rule"),
"log_unlink": fields.boolean("Log Deletes", help="Select this if you want to keep track of deletion on any record of the object of this rule"),
"log_create": fields.boolean("Log Creates",help="Select this if you want to keep track of creation on any record of the object of this rule"),
"log_action": fields.boolean("Log Action",help="Select this if you want to keep track of actions on the object of this rule"),
"log_workflow": fields.boolean("Log Workflow",help="Select this if you want to keep track of workflow on any record of the object of this rule"),
"state": fields.selection((("draft", "Draft"), ("subscribed", "Subscribed")), "Status", required=True),
"action_id": fields.many2one('ir.actions.act_window', "Action ID"),
}
_defaults = {
'state': 'draft',
'log_create': 1,
'log_unlink': 1,
'log_write': 1,
}
_sql_constraints = [
('model_uniq', 'unique (object_id)', """There is already a rule defined on this object\n You cannot define another: please edit the existing one.""")
]
__functions = {}
def subscribe(self, cr, uid, ids, *args):
"""
Subscribe Rule for auditing changes on object and apply shortcut for logs on that object.
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of Auddittrail Rules IDs.
@return: True
"""
obj_action = self.pool.get('ir.actions.act_window')
obj_model = self.pool.get('ir.model.data')
#start Loop
for thisrule in self.browse(cr, uid, ids):
if thisrule.object_id.model not in self.pool:
raise osv.except_osv(
_('WARNING: audittrail is not part of the pool'),
_('Change audittrail depends -- Setting rule as DRAFT'))
self.write(cr, uid, [thisrule.id], {"state": "draft"})
val = {
"name": 'View Log',
"res_model": 'audittrail.log',
"src_model": thisrule.object_id.model,
"domain": "[('object_id','=', " + str(thisrule.object_id.id) + "), ('res_id', '=', active_id)]"
}
action_id = obj_action.create(cr, SUPERUSER_ID, val)
self.write(cr, uid, [thisrule.id], {"state": "subscribed", "action_id": action_id})
keyword = 'client_action_relate'
value = 'ir.actions.act_window,' + str(action_id)
res = obj_model.ir_set(cr, SUPERUSER_ID, 'action', keyword, 'View_log_' + thisrule.object_id.model, [thisrule.object_id.model], value, replace=True, isobject=True, xml_id=False)
#End Loop
return True
def unsubscribe(self, cr, uid, ids, *args):
"""
Unsubscribe Auditing Rule on object
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of Auddittrail Rules IDs.
@return: True
"""
obj_action = self.pool.get('ir.actions.act_window')
ir_values_obj = self.pool.get('ir.values')
value=''
#start Loop
for thisrule in self.browse(cr, uid, ids):
if thisrule.id in self.__functions:
for function in self.__functions[thisrule.id]:
setattr(function[0], function[1], function[2])
w_id = obj_action.search(cr, uid, [('name', '=', 'View Log'), ('res_model', '=', 'audittrail.log'), ('src_model', '=', thisrule.object_id.model)])
if w_id:
obj_action.unlink(cr, SUPERUSER_ID, w_id)
value = "ir.actions.act_window" + ',' + str(w_id[0])
val_id = ir_values_obj.search(cr, uid, [('model', '=', thisrule.object_id.model), ('value', '=', value)])
if val_id:
res = ir_values_obj.unlink(cr, uid, [val_id[0]])
self.write(cr, uid, [thisrule.id], {"state": "draft"})
#End Loop
return True
class audittrail_log(osv.osv):
"""
For Audittrail Log
"""
_name = 'audittrail.log'
_description = "Audittrail Log"
def _name_get_resname(self, cr, uid, ids, *args):
data = {}
for resname in self.browse(cr, uid, ids,[]):
model_object = resname.object_id
res_id = resname.res_id
if model_object and res_id:
model_pool = self.pool[model_object.model]
res = model_pool.read(cr, uid, res_id, ['name'])
data[resname.id] = res['name']
else:
data[resname.id] = False
return data
_columns = {
"name": fields.char("Resource Name",size=64),
"object_id": fields.many2one('ir.model', 'Object'),
"user_id": fields.many2one('res.users', 'User'),
"method": fields.char("Method", size=64),
"timestamp": fields.datetime("Date"),
"res_id": fields.integer('Resource Id'),
"line_ids": fields.one2many('audittrail.log.line', 'log_id', 'Log lines'),
}
_defaults = {
"timestamp": lambda *a: time.strftime("%Y-%m-%d %H:%M:%S")
}
_order = "timestamp desc"
class audittrail_log_line(osv.osv):
"""
Audittrail Log Line.
"""
_name = 'audittrail.log.line'
_description = "Log Line"
_columns = {
'field_id': fields.many2one('ir.model.fields', 'Fields', required=True),
'log_id': fields.many2one('audittrail.log', 'Log'),
'log': fields.integer("Log ID"),
'old_value': fields.text("Old Value"),
'new_value': fields.text("New Value"),
'old_value_text': fields.text('Old value Text'),
'new_value_text': fields.text('New value Text'),
'field_description': fields.char('Field Description', size=64),
}
# Monkeypatch the model RPC endpoint for auditing changes.
def get_value_text(cr, uid, pool, resource_pool, method, field, value):
"""
Gets textual values for the fields.
If the field is a many2one, it returns the name.
If it's a one2many or a many2many, it returns a list of name.
In other cases, it just returns the value.
:param cr: the current row, from the database cursor,
:param uid: the current users ID for security checks,
:param pool: current db's pooler object.
:param resource_pool: pooler object of the model which values are being changed.
:param field: for which the text value is to be returned.
:param value: value of the field.
:param recursive: True or False, True will repeat the process recursively
:return: string value or a list of values(for O2M/M2M)
"""
field_obj = (resource_pool._all_columns.get(field)).column
if field_obj._type in ('one2many','many2many'):
data = pool[field_obj._obj].name_get(cr, uid, value)
#return the modifications on x2many fields as a list of names
res = map(lambda x:x[1], data)
elif field_obj._type == 'many2one':
#return the modifications on a many2one field as its value returned by name_get()
res = value and value[1] or value
else:
res = value
return res
def create_log_line(cr, uid, log_id, model, lines=None):
"""
Creates lines for changed fields with its old and new values
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param model: Object which values are being changed
@param lines: List of values for line is to be created
"""
if lines is None:
lines = []
pool = openerp.registry(cr.dbname)
obj_pool = pool[model.model]
model_pool = pool.get('ir.model')
field_pool = pool.get('ir.model.fields')
log_line_pool = pool.get('audittrail.log.line')
for line in lines:
field_obj = obj_pool._all_columns.get(line['name'])
assert field_obj, _("'%s' field does not exist in '%s' model" %(line['name'], model.model))
field_obj = field_obj.column
old_value = line.get('old_value', '')
new_value = line.get('new_value', '')
search_models = [model.id]
if obj_pool._inherits:
search_models += model_pool.search(cr, uid, [('model', 'in', obj_pool._inherits.keys())])
field_id = field_pool.search(cr, uid, [('name', '=', line['name']), ('model_id', 'in', search_models)])
if field_obj._type == 'many2one':
old_value = old_value and old_value[0] or old_value
new_value = new_value and new_value[0] or new_value
vals = {
"log_id": log_id,
"field_id": field_id and field_id[0] or False,
"old_value": old_value,
"new_value": new_value,
"old_value_text": line.get('old_value_text', ''),
"new_value_text": line.get('new_value_text', ''),
"field_description": field_obj.string
}
line_id = log_line_pool.create(cr, uid, vals)
return True
def log_fct(cr, uid_orig, model, method, fct_src, *args, **kw):
"""
Logging function: This function is performing the logging operation
@param model: Object whose values are being changed
@param method: method to log: create, read, write, unlink, action or workflow action
@param fct_src: execute method of Object proxy
@return: Returns result as per method of Object proxy
"""
pool = openerp.registry(cr.dbname)
resource_pool = pool[model]
model_pool = pool.get('ir.model')
model_ids = model_pool.search(cr, SUPERUSER_ID, [('model', '=', model)])
model_id = model_ids and model_ids[0] or False
assert model_id, _("'%s' Model does not exist..." %(model))
model = model_pool.browse(cr, SUPERUSER_ID, model_id)
# fields to log. currently only used by log on read()
field_list = []
old_values = new_values = {}
if method == 'create':
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
if res:
res_ids = [res]
new_values = get_data(cr, uid_orig, pool, res_ids, model, method)
elif method == 'read':
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
if isinstance(res, dict):
records = [res]
else:
records = res
# build the res_ids and the old_values dict. Here we don't use get_data() to
# avoid performing an additional read()
res_ids = []
for record in records:
res_ids.append(record['id'])
old_values[(model.id, record['id'])] = {'value': record, 'text': record}
# log only the fields read
field_list = args[1]
elif method == 'unlink':
res_ids = args[0]
old_values = get_data(cr, uid_orig, pool, res_ids, model, method)
# process_data first as fct_src will unlink the record
self.process_data(cr, uid_orig, pool, res_ids, model, method, old_values, new_values, field_list)
return fct_src(cr, uid_orig, model.model, method, *args, **kw)
else: # method is write, action or workflow action
res_ids = []
if args:
res_ids = args[0]
if isinstance(res_ids, (long, int)):
res_ids = [res_ids]
if res_ids:
# store the old values into a dictionary
old_values = get_data(cr, uid_orig, pool, res_ids, model, method)
# process the original function, workflow trigger...
res = fct_src(cr, uid_orig, model.model, method, *args, **kw)
if method == 'copy':
res_ids = [res]
if res_ids:
# check the new values and store them into a dictionary
new_values = get_data(cr, uid_orig, pool, res_ids, model, method)
# compare the old and new values and create audittrail log if needed
process_data(cr, uid_orig, pool, res_ids, model, method, old_values, new_values, field_list)
return res
def get_data(cr, uid, pool, res_ids, model, method):
"""
This function simply read all the fields of the given res_ids, and also recurisvely on
all records of a x2m fields read that need to be logged. Then it returns the result in
convenient structure that will be used as comparison basis.
:param cr: the current row, from the database cursor,
:param uid: the current users ID. This parameter is currently not used as every
operation to get data is made as super admin. Though, it could be usefull later.
:param pool: current db's pooler object.
:param res_ids: Id's of resource to be logged/compared.
:param model: Object whose values are being changed
:param method: method to log: create, read, unlink, write, actions, workflow actions
:return: dict mapping a tuple (model_id, resource_id) with its value and textual value
{ (model_id, resource_id): { 'value': ...
'textual_value': ...
},
}
"""
data = {}
resource_pool = pool[model.model]
# read all the fields of the given resources in super admin mode
for resource in resource_pool.read(cr, SUPERUSER_ID, res_ids, resource_pool._all_columns):
values = {}
values_text = {}
resource_id = resource['id']
# loop on each field on the res_ids we just have read
for field in resource:
if field in ('__last_update', 'id'):
continue
values[field] = resource[field]
# get the textual value of that field for this record
values_text[field] = get_value_text(cr, SUPERUSER_ID, pool, resource_pool, method, field, resource[field])
field_obj = resource_pool._all_columns.get(field).column
if field_obj._type in ('one2many','many2many'):
# check if an audittrail rule apply in super admin mode
if check_rules(cr, SUPERUSER_ID, field_obj._obj, method):
# check if the model associated to a *2m field exists, in super admin mode
x2m_model_ids = pool.get('ir.model').search(cr, SUPERUSER_ID, [('model', '=', field_obj._obj)])
x2m_model_id = x2m_model_ids and x2m_model_ids[0] or False
assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj))
x2m_model = pool.get('ir.model').browse(cr, SUPERUSER_ID, x2m_model_id)
field_resource_ids = list(set(resource[field]))
if model.model == x2m_model.model:
# we need to remove current resource_id from the many2many to prevent an infinit loop
if resource_id in field_resource_ids:
field_resource_ids.remove(resource_id)
data.update(get_data(cr, SUPERUSER_ID, pool, field_resource_ids, x2m_model, method))
data[(model.id, resource_id)] = {'text':values_text, 'value': values}
return data
def prepare_audittrail_log_line(cr, uid, pool, model, resource_id, method, old_values, new_values, field_list=None):
"""
This function compares the old data (i.e before the method was executed) and the new data
(after the method was executed) and returns a structure with all the needed information to
log those differences.
:param cr: the current row, from the database cursor,
:param uid: the current users ID. This parameter is currently not used as every
operation to get data is made as super admin. Though, it could be usefull later.
:param pool: current db's pooler object.
:param model: model object which values are being changed
:param resource_id: ID of record to which values are being changed
:param method: method to log: create, read, unlink, write, actions, workflow actions
:param old_values: dict of values read before execution of the method
:param new_values: dict of values read after execution of the method
:param field_list: optional argument containing the list of fields to log. Currently only
used when performing a read, it could be usefull later on if we want to log the write
on specific fields only.
:return: dictionary with
* keys: tuples build as ID of model object to log and ID of resource to log
* values: list of all the changes in field values for this couple (model, resource)
return {
(model.id, resource_id): []
}
The reason why the structure returned is build as above is because when modifying an existing
record, we may have to log a change done in a x2many field of that object
"""
if field_list is None:
field_list = []
key = (model.id, resource_id)
lines = {
key: []
}
# loop on all the fields
for field_name, field_definition in pool[model.model]._all_columns.items():
if field_name in ('__last_update', 'id'):
continue
#if the field_list param is given, skip all the fields not in that list
if field_list and field_name not in field_list:
continue
field_obj = field_definition.column
if field_obj._type in ('one2many','many2many'):
# checking if an audittrail rule apply in super admin mode
if check_rules(cr, SUPERUSER_ID, field_obj._obj, method):
# checking if the model associated to a *2m field exists, in super admin mode
x2m_model_ids = pool.get('ir.model').search(cr, SUPERUSER_ID, [('model', '=', field_obj._obj)])
x2m_model_id = x2m_model_ids and x2m_model_ids[0] or False
assert x2m_model_id, _("'%s' Model does not exist..." %(field_obj._obj))
x2m_model = pool.get('ir.model').browse(cr, SUPERUSER_ID, x2m_model_id)
# the resource_ids that need to be checked are the sum of both old and previous values (because we
# need to log also creation or deletion in those lists).
x2m_old_values_ids = old_values.get(key, {'value': {}})['value'].get(field_name, [])
x2m_new_values_ids = new_values.get(key, {'value': {}})['value'].get(field_name, [])
# We use list(set(...)) to remove duplicates.
res_ids = list(set(x2m_old_values_ids + x2m_new_values_ids))
if model.model == x2m_model.model:
# we need to remove current resource_id from the many2many to prevent an infinit loop
if resource_id in res_ids:
res_ids.remove(resource_id)
for res_id in res_ids:
lines.update(prepare_audittrail_log_line(cr, SUPERUSER_ID, pool, x2m_model, res_id, method, old_values, new_values, field_list))
# if the value value is different than the old value: record the change
if key not in old_values or key not in new_values or old_values[key]['value'][field_name] != new_values[key]['value'][field_name]:
data = {
'name': field_name,
'new_value': key in new_values and new_values[key]['value'].get(field_name),
'old_value': key in old_values and old_values[key]['value'].get(field_name),
'new_value_text': key in new_values and new_values[key]['text'].get(field_name),
'old_value_text': key in old_values and old_values[key]['text'].get(field_name)
}
lines[key].append(data)
return lines
def process_data(cr, uid, pool, res_ids, model, method, old_values=None, new_values=None, field_list=None):
"""
This function processes and iterates recursively to log the difference between the old
data (i.e before the method was executed) and the new data and creates audittrail log
accordingly.
:param cr: the current row, from the database cursor,
:param uid: the current users ID,
:param pool: current db's pooler object.
:param res_ids: Id's of resource to be logged/compared.
:param model: model object which values are being changed
:param method: method to log: create, read, unlink, write, actions, workflow actions
:param old_values: dict of values read before execution of the method
:param new_values: dict of values read after execution of the method
:param field_list: optional argument containing the list of fields to log. Currently only
used when performing a read, it could be usefull later on if we want to log the write
on specific fields only.
:return: True
"""
if field_list is None:
field_list = []
# loop on all the given ids
for res_id in res_ids:
# compare old and new values and get audittrail log lines accordingly
lines = prepare_audittrail_log_line(cr, uid, pool, model, res_id, method, old_values, new_values, field_list)
# if at least one modification has been found
for model_id, resource_id in lines:
line_model = pool.get('ir.model').browse(cr, SUPERUSER_ID, model_id).model
vals = {
'method': method,
'object_id': model_id,
'user_id': uid,
'res_id': resource_id,
}
if (model_id, resource_id) not in old_values and method not in ('copy', 'read'):
# the resource was not existing so we are forcing the method to 'create'
# (because it could also come with the value 'write' if we are creating
# new record through a one2many field)
vals.update({'method': 'create'})
if (model_id, resource_id) not in new_values and method not in ('copy', 'read'):
# the resource is not existing anymore so we are forcing the method to 'unlink'
# (because it could also come with the value 'write' if we are deleting the
# record through a one2many field)
name = old_values[(model_id, resource_id)]['value'].get('name',False)
vals.update({'method': 'unlink'})
else :
name = pool[line_model].name_get(cr, uid, [resource_id])[0][1]
vals.update({'name': name})
# create the audittrail log in super admin mode, only if a change has been detected
if lines[(model_id, resource_id)]:
log_id = pool.get('audittrail.log').create(cr, SUPERUSER_ID, vals)
model = pool.get('ir.model').browse(cr, uid, model_id)
create_log_line(cr, SUPERUSER_ID, log_id, model, lines[(model_id, resource_id)])
return True
def check_rules(cr, uid, model, method):
"""
Checks if auditrails is installed for that db and then if one rule match
@param cr: the current row, from the database cursor,
@param uid: the current users ID,
@param model: value of _name of the object which values are being changed
@param method: method to log: create, read, unlink,write,actions,workflow actions
@return: True or False
"""
pool = openerp.registry(cr.dbname)
if 'audittrail.rule' in pool.models:
model_ids = pool.get('ir.model').search(cr, SUPERUSER_ID, [('model', '=', model)])
model_id = model_ids and model_ids[0] or False
if model_id:
rule_ids = pool.get('audittrail.rule').search(cr, SUPERUSER_ID, [('object_id', '=', model_id), ('state', '=', 'subscribed')])
for rule in pool.get('audittrail.rule').read(cr, SUPERUSER_ID, rule_ids, ['user_id','log_read','log_write','log_create','log_unlink','log_action','log_workflow']):
if len(rule['user_id']) == 0 or uid in rule['user_id']:
if rule.get('log_'+method,0):
return True
elif method not in ('default_get','read','fields_view_get','fields_get','search','search_count','name_search','name_get','get','request_get', 'get_sc', 'unlink', 'write', 'create', 'read_group', 'import_data'):
if rule['log_action']:
return True
# Replace the openerp.service.model functions.
original_execute_cr = openerp.service.model.execute_cr
original_exec_workflow_cr = openerp.service.model.exec_workflow_cr
def execute_cr(cr, uid, model, method, *args, **kw):
fct_src = original_execute_cr
if check_rules(cr,uid,model,method):
return log_fct(cr, uid, model, method, fct_src, *args, **kw)
return fct_src(cr, uid, model, method, *args, **kw)
def exec_workflow_cr(cr, uid, model, method, *args, **kw):
fct_src = original_exec_workflow_cr
if check_rules(cr,uid,model,'workflow'):
return log_fct(cr, uid, model, method, fct_src, *args, **kw)
return fct_src(cr, uid, model, method, *args, **kw)
openerp.service.model.execute_cr = execute_cr
openerp.service.model.exec_workflow_cr = exec_workflow_cr
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,10 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data noupdate="1">
<record model="audittrail.rule" id="demo_audittrail_rule">
<field name="name">Audit on Partners</field>
<field name="object_id" search="[('model','=','res.partner')]"/>
<field name="user_id" search="[]"/>
</record>
</data>
</openerp>

View File

@ -1,185 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
<menuitem id="menu_audit" name="Audit" parent="base.menu_reporting" sequence="50" groups="base.group_system"/>
<!-- Audittrail Rule -->
<record model="ir.ui.view" id="view_audittrail_rule_form">
<field name="name">audittrail.rule.form</field>
<field name="model">audittrail.rule</field>
<field name="arch" type="xml">
<form string="AuditTrail Rule" version="7.0">
<header>
<button string="_Subscribe" name="subscribe" icon="gtk-ok"
type="object" states="draft"/>
<button string="UnSubscribe" name="unsubscribe" icon="gtk-cancel"
type="object" states="subscribed"/>
<field name="state" widget="statusbar"/>
</header>
<sheet>
<group col="4">
<field name="name" required="1"/>
<field name="object_id"/>
<field name="log_read"/>
<field name="log_write"/>
<field name="log_unlink"/>
<field name="log_create"/>
<field name="log_action"/>
<field name="log_workflow"/>
<separator string="Users (if User is not added then it will applicable for all users)" colspan="4"/>
<field name="user_id" colspan="4" nolabel="1"/>
<field name="action_id" colspan="4" readonly="1" groups="base.group_no_one"/>
</group>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_audittrail_rule_tree">
<field name="name">audittrail.rule.tree</field>
<field name="model">audittrail.rule</field>
<field name="arch" type="xml">
<tree colors="blue:state == 'draft';black:state == 'subscribed'" string="AuditTrail Rules">
<field name="name"/>
<field name="object_id"/>
<field name="log_read"/>
<field name="log_write"/>
<field name="log_unlink"/>
<field name="log_create"/>
<field name="log_action"/>
<field name="log_workflow"/>
<field name="state"/>
</tree>
</field>
</record>
<record id="view_audittrail_rule_search" model="ir.ui.view">
<field name="name">audittrail.rule.search</field>
<field name="model">audittrail.rule</field>
<field name="arch" type="xml">
<search string="Search Audittrail Rule">
<field name="name" string="Audittrail Rule"/>
<filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Rule"/>
<filter icon="terp-camera_test" string="Subscribed" domain="[('state','=','subscribed')]" help="Subscribed Rule"/>
<field name="object_id" string="Model"/>
<group expand="0" string="Group By...">
<filter string="Status" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_audittrail_rule_tree">
<field name="name">Audit Rules</field>
<field name="res_model">audittrail.rule</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'search_default_draft': 1}</field>
<field name="search_view_id" ref="view_audittrail_rule_search"/>
</record>
<menuitem id="menu_action_audittrail_rule_tree" parent="menu_audit" action="action_audittrail_rule_tree"/>
<!-- AuditTrail Log -->
<record model="ir.ui.view" id="view_audittrail_log_form">
<field name="name">audittrail.log.form</field>
<field name="model">audittrail.log</field>
<field name="arch" type="xml">
<form string="AuditTrail Logs" version="7.0">
<sheet>
<group col="4">
<field name="timestamp" required="1" readonly="1"/>
<field name="user_id" readonly="1"/>
<field name="method" readonly="1"/>
<field name="name" readonly="1"/>
<field name="res_id" readonly="1"/>
<field name="object_id" readonly="1"/>
</group>
<field name="line_ids" mode="tree"
widget="one2many_list" readonly="1">
<form string="Log Lines" version="7.0">
<group col="4">
<field name="field_id" colspan="4"
readonly="1"/>
<newline/>
<field name="field_description" colspan="4"
readonly="1"/>
<newline/>
<separator string="Old Value : "
colspan="2"/>
<separator string="New Value : "
colspan="2"/>
<newline/>
<field name="old_value" nolabel="1"
colspan="2" readonly="1"/>
<field name="new_value" nolabel="1"
colspan="2" readonly="1"/>
<newline/>
<separator string="Old Value Text : "
colspan="2"/>
<separator string="New Value Text: "
colspan="2"/>
<newline/>
<field name="old_value_text" nolabel="1"
colspan="2" readonly="1"/>
<field name="new_value_text" nolabel="1"
colspan="2" readonly="1"/>
</group>
</form>
<tree string="Log Lines">
<field name="field_description"/>
<field name="old_value_text"/>
<field name="new_value_text"/>
</tree>
</field>
</sheet>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_audittrail_log_tree">
<field name="name">audittrail.log.tree</field>
<field name="model">audittrail.log</field>
<field name="arch" type="xml">
<tree string="AuditTrail Logs" create="false">
<field name="timestamp"/>
<field name="name"/>
<field name="object_id"/>
<field name="method"/>
<field name="user_id"/>
</tree>
</field>
</record>
<record id="view_audittrail_log_search" model="ir.ui.view">
<field name="name">audittrail.log.search</field>
<field name="model">audittrail.log</field>
<field name="arch" type="xml">
<search string="Search Audittrail Log">
<field name="name" string="Audittrail Log"/>
<field name="object_id" string="Model"/>
<field name="user_id"/>
<group expand="0" string="Group By...">
<filter string="User" icon="terp-personal" domain="[]" context="{'group_by':'user_id'}"/>
<filter string="Object" icon="terp-stock_align_left_24" domain="[]" context="{'group_by':'object_id'}"/>
<filter string="Audit Month" icon="terp-go-month" domain="[]" context="{'group_by':'timestamp'}" help="Audit Date by Month"/>
</group>
</search>
</field>
</record>
<record model="ir.actions.act_window" id="action_audittrail_log_tree">
<field name="name">Audit Logs</field>
<field name="res_model">audittrail.log</field>
<field name="view_type">form</field>
<field name="search_view_id" ref="view_audittrail_log_search"/>
</record>
<menuitem id="menu_audit_logs" name="Audit Logs" parent="menu_audit" action="action_audittrail_log_tree"/>
</data>
</openerp>

View File

@ -1,5 +0,0 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_audittrail_rule_all_users,audittrail rule all,model_audittrail_rule,base.group_system,1,1,1,0
access_audittrail_rule_all_access,audittrail rule all,model_audittrail_rule,base.group_erp_manager,1,1,1,0
access_audittrail_log_all_users,audittrail log all,model_audittrail_log,base.group_user,1,0,1,0
access_audittrail_log_line_all_users,audittrail log line all,model_audittrail_log_line,base.group_user,1,0,1,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_audittrail_rule_all_users audittrail rule all model_audittrail_rule base.group_system 1 1 1 0
3 access_audittrail_rule_all_access audittrail rule all model_audittrail_rule base.group_erp_manager 1 1 1 0
4 access_audittrail_log_all_users audittrail log all model_audittrail_log base.group_user 1 0 1 0
5 access_audittrail_log_line_all_users audittrail log line all model_audittrail_log_line base.group_user 1 0 1 0

View File

@ -1,24 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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/>.
#
##############################################################################
import audittrail_view_log
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,65 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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 openerp.osv import fields, osv
import time
class audittrail_view_log(osv.osv_memory):
_name = "audittrail.view.log"
_description = "View Log"
_columns = {
'from':fields.datetime('Log From'),
'to':fields.datetime('Log To', required = True)
}
_defaults = {
'to': lambda *a: time.strftime("%Y-%m-%d %H:%M:%S"),
}
def log_open_window(self, cr, uid, ids, context=None):
"""
Open Log form from given date range..
@param cr: the current row, from the database cursor,
@param uid: the current users ID for security checks,
@param ids: List of audittrail view logs IDs.
@return: Dictionary of audittrail log form on given date range.
"""
mod_obj = self.pool.get('ir.model.data')
act_obj = self.pool.get('ir.actions.act_window')
result = mod_obj._get_id(cr, uid, 'audittrail', 'action_audittrail_log_tree')
id = mod_obj.read(cr, uid, [result], ['res_id'], context=context)[0]['res_id']
result = act_obj.read(cr, uid, [id], context=context)[0]
#start Loop
for datas in self.read(cr, uid, ids, context=context):
if not datas.get('from', None):
if datas.get('to') <> time.strftime("%Y-%m-%d %H:%M:%S"):
result['domain'] = str([('timestamp', '<', datas.get('to'))])
else:
pass
else:
result['domain'] = str([('timestamp', '>', datas.get('from', None)), ('timestamp', '<', datas.get('to'))])
#End Loop
return result
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- Audittrail View Log wizard-->
<record id="view_audittrail_view_log" model="ir.ui.view">
<field name="name">audittrail.view.log.form</field>
<field name="model">audittrail.view.log</field>
<field name="arch" type="xml">
<form string="Audit Logs" version="7.0">
<group col="4">
<field name="from"/>
<field name="to"/>
</group>
<footer>
<button string="Open Logs" name="log_open_window" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/>
</footer>
</form>
</field>
</record>
<!-- action for audittrail view log wizard -->
<record id="action_audittrail_view_log" model="ir.actions.act_window">
<field name="name">View log</field>
<field name="res_model">audittrail.view.log</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_audittrail_view_log"/>
<field name="target">new</field>
</record>
</data>
</openerp>

View File

@ -32,5 +32,4 @@ Re-implement openerp's file import system:
'views/base_import.xml',
],
'qweb': ['static/src/xml/import.xml'],
'test': ['static/test/states.js'],
}

View File

@ -1,6 +0,0 @@
$(document).ready(function () {
module('foo');
test('dummy', function () {
ok(42);
});
});

View File

@ -51,7 +51,6 @@ Dashboard for CRM will include:
'depends': [
'base_action_rule',
'base_setup',
'process',
'mail',
'email_template',
'calendar',
@ -87,10 +86,7 @@ Dashboard for CRM will include:
'report/crm_lead_report_view.xml',
'report/crm_phonecall_report_view.xml',
'process/crm_configuration_process.xml',
'res_partner_view.xml',
'board_crm_view.xml',
'res_config_view.xml',
'base_partner_merge_view.xml',
@ -122,7 +118,6 @@ Dashboard for CRM will include:
'application': True,
'auto_install': False,
'images': [
'images/crm_dashboard.png',
'images/customers.png',
'images/leads.png',
'images/opportunities_kanban.png',

View File

@ -1,85 +0,0 @@
<?xml version="1.0"?>
<openerp>
<data>
<!-- CRM dashboard -->
<record model="ir.ui.view" id="view_crm_opportunity_stage_graph">
<field name="name">Opportunities By Stage - Graph</field>
<field name="model">crm.lead.report</field>
<field name="arch" type="xml">
<graph string="Opportunities By Stage" type="bar">
<field name="stage_id" type="row"/>
</graph>
</field>
</record>
<record model="ir.actions.act_window" id="act_opportunity_stage">
<field name="name">Opportunities By Stage</field>
<field name="res_model">crm.lead.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_opportunity_stage_graph"/>
<!-- avoid done / cancelled -->
<field name="domain">['&amp;', ('stage_id.fold', '=', False), ('type', '=', 'opportunity')]</field>
<field name="context">{'search_default_Stage':1}</field>
</record>
<!--Planned Revenue By User line graph-->
<record model="ir.ui.view" id="view_crm_opportunity_user_stage_graph">
<field name="name">Opportunities By Stage Per User - Graph</field>
<field name="model">crm.lead.report</field>
<field name="arch" type="xml">
<graph string="Opportunities By Stage" stacked="True">
<field name="stage_id" type="row"/>
<field name="user_id" type="row"/>
<field name="planned_revenue" type="measure"/>
</graph>
</field>
</record>
<!--Planned Revenue By User line graph action-->
<record model="ir.actions.act_window" id="act_oppor_stage_user">
<field name="name">Planned Revenue By User and Stage</field>
<field name="res_model">crm.lead.report</field>
<field name="view_type">form</field>
<field name="view_mode">graph,tree,form</field>
<field name="view_id" ref="view_crm_opportunity_user_stage_graph"/>
<!-- avoid cancelled -->
<field name="domain">['|', ('stage_id.fold', '=', False), ('stage_id.probability', '=', 100)]</field>
<field name="context">{'search_default_user': 1, 'search_default_Stage': 1}</field>
</record>
<record model="ir.ui.view" id="board_crm_statistical_form">
<field name="name">CRM - Statistical Dashboard Form</field>
<field name="model">board.board</field>
<field name="arch" type="xml">
<form string="Statistics Dashboard" version="7.0">
<board style="1-1">
<column>
<action string="Planned Revenue by Stage and User" name="%(act_oppor_stage_user)d"/>
</column>
<column>
<action string="Opportunities by Stage" name="%(act_opportunity_stage)d"/>
</column>
</board>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="open_board_statistical_dash">
<field name="name">CRM</field>
<field name="res_model">board.board</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="usage">menu</field>
<field name="view_id" ref="board_crm_statistical_form"/>
</record>
<menuitem
id="menu_board_statistics_dash"
parent="base.menu_reporting_dashboard"
action="open_board_statistical_dash"
sequence="10"
groups="base.group_sale_manager"/>
</data>
</openerp>

View File

@ -1,84 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!--
Process
-->
<record id="process_process_contractprocess0" model="process.process">
<field eval="1" name="active"/>
<field eval="&quot;&quot;&quot;Contract&quot;&quot;&quot;" name="name"/>
</record>
<!--
Process Node
-->
<record id="process_node_leads0" model="process.node">
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Leads&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Very first contact with new prospect&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_contractprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('draft', 'open', 'pending', 'done', 'cancel')&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_partner0" model="process.node">
<field name="menu_id" ref="base.menu_partner_form"/>
<field name="model_id" ref="base.model_res_partner"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Partner&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Convert to prospect to business partner&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_contractprocess0"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_opportunities0" model="process.node">
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Opportunities&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;When a real project/opportunity is detected&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_contractprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('draft', 'open', 'pending', 'done', 'cancel')&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_meeting0" model="process.node">
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Meeting&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Schedule a normal or phone meeting&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_contractprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('draft', 'open', 'pending', 'done', 'cancel')&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<!--
Process Transition
-->
<record id="process_transition_leadopportunity0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Prospect Opportunity&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Creating business opportunities from Leads&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_opportunities0"/>
<field name="source_node_id" ref="process_node_leads0"/>
</record>
<record id="process_transition_leadpartner0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Prospect Partner&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Prospect is converting to business partner&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_partner0"/>
<field name="source_node_id" ref="process_node_leads0"/>
</record>
<record id="process_transition_opportunitymeeting0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Opportunity Meeting&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Normal or phone meeting for opportunity&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_meeting0"/>
<field name="source_node_id" ref="process_node_opportunities0"/>
</record>
</data>
</openerp>

View File

@ -33,7 +33,6 @@
<graph string="Leads Analysis" type="pivot" stacked="True">
<field name="date_deadline" type="row"/>
<field name="user_id" type="col"/>
<field name="stage_id" type="col"/>
<field name="planned_revenue" type="measure"/>
</graph>
</field>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

View File

@ -164,24 +164,7 @@ Customize your sales cycle by configuring sales stages that perfectly fit your s
</section>
<section class="oe_container oe_dark">
<div class="oe_spaced oe_row">
<h2 class="oe_slogan">Reporting and Dashboards</h2>
<h3 class="oe_slogan">Get access to the right information to take smart decisions</h3>
<div class="oe_span6">
<div class="oe_row_img oe_centered">
<img class="oe_picture oe_screenshot" src="crm_sc_05.png">
</div>
</div>
<div class="oe_span6">
<p class="oe_mt32">
Get the insights you need to make smarter decisions. Design custom dashboards to get a picture of your business at a glance. Dig deeper with real-time reports that anyone can create and share.
</p>
</div>
</div>
</section>
<section class="oe_spaced oe_container">
<div class="oe_row">
<div class="oe_row oe_spaced">
<h2 class="oe_slogan">Drive Engagement with Gamification</h2>
<h3 class="oe_slogan">Leverage sales' natural desire for competition</h3>
<p class="oe_mt32">
@ -217,7 +200,7 @@ Get the insights you need to make smarter decisions. Design custom dashboards to
</div>
</section>
<section class="oe_container oe_dark">
<section class="oe_container">
<div class="oe_row">
<div class="oe_span12">
<h2 class="oe_slogan">Many companies already enjoy it</h2>

View File

@ -46,7 +46,6 @@ Key Features
'event_view.xml',
'event_data.xml',
'report/report_event_registration_view.xml',
'board_association_view.xml',
'res_partner_view.xml',
'email_template.xml',
'views/event.xml',

View File

@ -1,74 +0,0 @@
<?xml version="1.0"?>
<openerp>
<data>
<!-- Events dashboard -->
<record model ="ir.ui.view" id="view_report_event_reg_graph">
<field name="name">Registration Event report</field>
<field name="model">report.event.registration</field>
<field name="arch" type="xml">
<graph string="Events Filling Status" type="bar" >
<field name="event_id" type="row"/>
<field name="draft_state" type="measure"/>
</graph>
</field>
</record>
<record model="ir.actions.act_window" id="act_event_reg">
<field name="name">Events Filling Status</field>
<field name="res_model">report.event.registration</field>
<field name="view_type">form</field>
<field name="domain">[('event_state','not in',('cancel','done'))]</field>
<field name="view_mode">graph,tree</field>
<field name="view_id" ref="view_report_event_reg_graph"/>
</record>
<record model="ir.actions.act_window" id="act_event_view">
<field name="name">Next Events</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">event.event</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','not in',('cancel','done'))]</field>
</record>
<record model="ir.actions.act_window" id="act_event_view_registration">
<field name="name">New Registration</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">event.registration</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','draft')]</field>
</record>
<record model="ir.ui.view" id="board_associations_manager_form">
<field name="name">board.associations.manager.form</field>
<field name="model">board.board</field>
<field name="arch" type="xml">
<form string="Association Dashboard" version="7.0">
<board style="2-1">
<column>
<action string="Next Events" name="%(act_event_view)d"/>
</column>
<column>
<action string="Events Filling By Status" name="%(act_event_reg)d"/>
</column>
</board>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="open_board_associations_manager">
<field name="name">Events</field>
<field name="res_model">board.board</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="board_associations_manager_form"/>
</record>
<menuitem id="menu_board_associations_manager"
parent="base.menu_reporting_dashboard"
action="open_board_associations_manager"
sequence="40"
icon="terp-graph"/>
</data>
</openerp>

View File

@ -1,56 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.actions.act_window" id="action_fleet_vehicle_log_fuel_graph">
<field name="name">Fuel Costs by Month</field>
<field name="res_model">fleet.vehicle.cost</field>
<field name="view_id" ref="fleet_vehicle_costs_graph"></field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="domain">['&amp;',('parent_id','=',False),('cost_type','=','fuel')]</field>
</record>
<record model="ir.actions.act_window" id="action_fleet_vehicle_log_services_graph">
<field name="name">Services Costs by Month</field>
<field name="res_model">fleet.vehicle.cost</field>
<field name="view_id" ref="fleet_vehicle_costs_graph" />
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="domain">['&amp;',('parent_id','=',False),('cost_type','=','services')]</field>
</record>
<record model="ir.actions.act_window" id="action_fleet_vehicle_log_contract_graph">
<field name="name">Contracts Costs by Month</field>
<field name="res_model">fleet.vehicle.cost</field>
<field name="view_id" ref="fleet_vehicle_costs_graph"></field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="domain">['&amp;',('parent_id','=',False),('cost_type','=','contract')]</field>
</record>
<record model="ir.actions.act_window" id="action_fleet_vehicle_costs_graph">
<field name="name">Costs by Month</field>
<field name="res_model">fleet.vehicle.cost</field>
<field name="view_id" ref="fleet_vehicle_costs_graph"></field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="domain">[('parent_id','=',False)]</field>
</record>
<record model="ir.actions.act_window" id="action_fleet_vehicle_kanban">
<field name="name">Vehicles with alerts</field>
<field name="res_model">fleet.vehicle</field>
<field name="view_id" ref="fleet_vehicle_kanban"></field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="domain">['|',('contract_renewal_due_soon','=',True),('contract_renewal_overdue','=',True)]</field>
<field name="help" type="html">
<p>
Here are displayed vehicles for which one or more contracts need to be renewed. If you see this message, then there is no contracts to renew.
</p>
</field>
</record>
<record model="ir.actions.act_window" id="action_fleet_reporting_costs">
<field name="name">Costs Analysis</field>
<field name="res_model">fleet.vehicle.cost</field>
@ -88,55 +38,6 @@
</p>
</field>
</record>
<record id="board_fleet_form" model="ir.ui.view">
<field name="name">board.fleet.form</field>
<field name="model">board.board</field>
<field name="arch" type="xml">
<form string="Fleet Dashboard" version="7.0">
<board style="2-1">
<column>
<action string="Vehicles With Alerts" name="%(fleet.action_fleet_vehicle_kanban)d" view_mode="kanban"/>
<action string="Costs by Month" name="%(fleet.action_fleet_vehicle_costs_graph)d" view_mode="graph,tree"/>
</column>
<column>
<action string="Fuel Costs" name="%(fleet.action_fleet_vehicle_log_fuel_graph)d" view_mode="graph,tree"/>
<action string="Services Costs" name="%(fleet.action_fleet_vehicle_log_services_graph)d" view_mode="graph,tree"/>
<action string="Contracts Costs" name="%(fleet.action_fleet_vehicle_log_contract_graph)d" view_mode="graph,tree"/>
</column>
</board>
</form>
</field>
</record>
<record id="open_board_fleet" model="ir.actions.act_window">
<field name="name">Fleet</field>
<field name="res_model">board.board</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="usage">menu</field>
<field name="view_id" ref="board_fleet_form"/>
<field name="help" type="html">
<div class="oe_empty_custom_dashboard">
<p>
<b>Fleet dashboard is empty.</b>
</p><p>
To add your first report into this dashboard, go to any
menu, switch to list or graph view, and click <i>'Add to
Dashboard'</i> in the extended search options.
</p><p>
You can filter and group data before inserting into the
dashboard using the search options.
</p>
</div>
</field>
</record>
<menuitem id="menu_fleet_dashboard"
parent="base.menu_reporting_dashboard"
action="open_board_fleet"
sequence="50"
groups="group_fleet_user"/>
<menuitem name="Fleet" parent="base.menu_reporting" id="menu_fleet_reporting" sequence="50" groups="group_fleet_manager"/>

View File

@ -52,9 +52,7 @@ You can manage:
'data': [
'security/hr_security.xml',
'security/ir.model.access.csv',
'board_hr_view.xml',
'hr_view.xml',
'process/hr_process.xml',
'hr_installer.xml',
'hr_data.xml',
'res_config_view.xml',

View File

@ -1,49 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="board_hr_form" model="ir.ui.view">
<field name="name">board.hr.form</field>
<field name="model">board.board</field>
<field name="arch" type="xml">
<form string="Human Resources Dashboard" version="7.0">
<board style="2-1">
<column/>
<column/>
</board>
</form>
</field>
</record>
<record id="open_board_hr" model="ir.actions.act_window">
<field name="name">Human Resources</field>
<field name="res_model">board.board</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="usage">menu</field>
<field name="view_id" ref="board_hr_form"/>
<field name="help" type="html">
<div class="oe_empty_custom_dashboard">
<p>
<b>Human Resources dashboard is empty.</b>
</p><p>
To add your first report into this dashboard, go to any
menu, switch to list or graph view, and click <i>'Add to
Dashboard'</i> in the extended search options.
</p><p>
You can filter and group data before inserting into the
dashboard using the search options.
</p>
</div>
</field>
</record>
<menuitem id="menu_hr_dashboard"
parent="base.menu_reporting_dashboard"
action="open_board_hr"
sequence="50"/>
<menuitem id="menu_hr_reporting"
parent="base.menu_reporting"
name="Human Resources"
sequence="40" />
</data>
</openerp>

View File

@ -7,6 +7,7 @@
id="menu_hr_root"
groups="base.group_hr_manager,base.group_hr_user,base.group_user"
sequence="90"/>
<menuitem id="menu_hr_reporting" parent="base.menu_reporting" name="Human Resources" sequence="40" />
<menuitem id="menu_hr_main" parent="menu_hr_root" name="Human Resources" sequence="0"/>
<menuitem id="menu_hr_configuration" name="Configuration" parent="hr.menu_hr_root" groups="base.group_hr_manager" sequence="50"/>
<menuitem id="menu_hr_reporting_timesheet" name="Reports"

View File

@ -1,70 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
<!--
Process
-->
<record id="process_process_employeecontractprocess0" model="process.process">
<field eval="1" name="active"/>
<field name="model_id" ref="hr.model_hr_employee"/>
<field eval="&quot;&quot;&quot;Employee Contract&quot;&quot;&quot;" name="name"/>
</record>
<!--
Process Node
-->
<record id="process_node_employee0" model="process.node">
<field name="menu_id" ref="hr.menu_open_view_employee_list_my"/>
<field name="model_id" ref="hr.model_hr_employee"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Employee&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Employee form and structure&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_employeecontractprocess0"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_employeecontact0" model="process.node">
<field name="menu_id" ref="hr.menu_open_view_employee_list_my"/>
<field name="model_id" ref="hr.model_hr_employee"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Employee Contact&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Other information&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_employeecontractprocess0"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_openerpuser0" model="process.node">
<field name="menu_id" ref="base.menu_users"/>
<field name="model_id" ref="base.model_res_users"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Openerp user&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Creation of a OpenERP user&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_employeecontractprocess0"/>
<field eval="0" name="flow_start"/>
</record>
<!--
Process Transition
-->
<record id="process_transition_employeeuser0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Link a user to an employee&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The Related user field on the Employee form allows to link the OpenERP user (and her rights) to the employee.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_openerpuser0"/>
<field name="source_node_id" ref="process_node_employee0"/>
</record>
<record id="process_transition_contactofemployee0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Link the employee to information&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;In the Employee form, there are different kind of information like Contact information.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_employeecontact0"/>
<field name="source_node_id" ref="process_node_employee0"/>
</record>
</data>
</openerp>

View File

@ -39,8 +39,6 @@ actions(Sign in/Sign out) performed by them.
'security/ir.model.access.csv',
'hr_attendance_view.xml',
'hr_attendance_report.xml',
'wizard/hr_attendance_bymonth_view.xml',
'wizard/hr_attendance_byweek_view.xml',
'wizard/hr_attendance_error_view.xml',
'res_config_view.xml',
'views/report_attendanceerrors.xml',

View File

@ -20,10 +20,12 @@
##############################################################################
import time
from datetime import datetime
from openerp.osv import fields, osv
from openerp.tools.translate import _
class hr_action_reason(osv.osv):
_name = "hr.action.reason"
_description = "Action Reason"
@ -40,14 +42,32 @@ def _employee_get(obj, cr, uid, context=None):
ids = obj.pool.get('hr.employee').search(cr, uid, [('user_id', '=', uid)], context=context)
return ids and ids[0] or False
class hr_attendance(osv.osv):
_name = "hr.attendance"
_description = "Attendance"
def _day_compute(self, cr, uid, ids, fieldnames, args, context=None):
res = dict.fromkeys(ids, '')
def _worked_hours_compute(self, cr, uid, ids, fieldnames, args, context=None):
"""For each hr.attendance record of action sign-in: assign 0.
For each hr.attendance record of action sign-out: assign number of hours since last sign-in.
"""
res = {}
for obj in self.browse(cr, uid, ids, context=context):
res[obj.id] = time.strftime('%Y-%m-%d', time.strptime(obj.name, '%Y-%m-%d %H:%M:%S'))
if obj.action == 'sign_in':
res[obj.id] = 0
elif obj.action == 'sign_out':
# Get the associated sign-in
last_signin_id = self.search(cr, uid, [
('employee_id', '=', obj.employee_id.id),
('name', '<', obj.name), ('action', '=', 'sign_in')
], limit=1, order='name DESC')
last_signin = self.browse(cr, uid, last_signin_id, context=context)[0]
# Compute time elapsed between sign-in and sign-out
last_signin_datetime = datetime.strptime(last_signin.name, '%Y-%m-%d %H:%M:%S')
signout_datetime = datetime.strptime(obj.name, '%Y-%m-%d %H:%M:%S')
workedhours_datetime = (signout_datetime - last_signin_datetime)
res[obj.id] = ((workedhours_datetime.seconds) / 60) / 60
return res
_columns = {
@ -55,7 +75,7 @@ class hr_attendance(osv.osv):
'action': fields.selection([('sign_in', 'Sign In'), ('sign_out', 'Sign Out'), ('action','Action')], 'Action', required=True),
'action_desc': fields.many2one("hr.action.reason", "Action Reason", domain="[('action_type', '=', action)]", help='Specifies the reason for Signing In/Signing Out in case of extra hours.'),
'employee_id': fields.many2one('hr.employee', "Employee", required=True, select=True),
'day': fields.function(_day_compute, type='char', string='Day', store=True, select=1, size=32),
'worked_hours': fields.function(_worked_hours_compute, type='float', string='Worked Hours', store=True),
}
_defaults = {
'name': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'), #please don't remove the lambda, if you remove it then the current time will not change
@ -110,7 +130,7 @@ class hr_employee(osv.osv):
for res in cr.fetchall():
result[res[1]] = res[0] == 'sign_in' and 'present' or 'absent'
return result
def _last_sign(self, cr, uid, ids, name, args, context=None):
result = {}
if not ids:

View File

@ -40,7 +40,6 @@
<field name="employee_id"/>
<field name="name"/>
<field name="action"/>
<field name="day" invisible="1"/>
</tree>
</field>
</record>
@ -53,17 +52,30 @@
<field name="name" string="Attendance"/>
<field name="action"/>
<filter icon="terp-go-today" string="Today" name="today" domain="[('name','&gt;=',current_date),('name','&lt;=',current_date)]" />
<filter string="Current Month" domain="[('name','&gt;=', datetime.datetime.now().strftime('%Y-%m-01'))]" />
<separator/>
<filter icon="terp-stock_align_left_24" string="My Attendance" domain="[('employee_id.user_id.id', '=', uid)]" />
<field name="employee_id"/>
<group expand="0" string="Group By...">
<filter name="employee" string="Employee" icon="terp-personal" domain="[]" context="{'group_by':'employee_id'}"/>
<filter string="Day" icon="terp-go-today" domain="[]" context="{'group_by':'day'}"/>
<filter name="name" string="Date" icon="terp-personal" domain="[]" context="{'group_by':'name'}"/>
</group>
</search>
</field>
</record>
<record id="view_hr_attendance_graph" model="ir.ui.view">
<field name="name">hr.attendance.graph</field>
<field name="model">hr.attendance</field>
<field name="arch" type="xml">
<graph string="Attendance" type="pivot">
<field name="employee_id" type="row"/>
<field name="name" type="col"/>
<field name="worked_hours" type="measure"/>
</graph>
</field>
</record>
<record id="open_view_attendance" model="ir.actions.act_window">
<field name="name">Attendances</field>
<field name="res_model">hr.attendance</field>
@ -74,12 +86,27 @@
<field name="help">The Time Tracking functionality aims to manage employee attendances from Sign in/Sign out actions. You can also link this feature to an attendance device using OpenERP's web service features.</field>
</record>
<record id="action_hr_attendance_graph" model="ir.actions.act_window">
<field name="name">Attendance Analysis</field>
<field name="res_model">hr.attendance</field>
<field name="view_type">form</field>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_hr_attendance_graph"/>
</record>
<menuitem id="menu_hr_time_tracking" name="Time Tracking" parent="hr.menu_hr_root" sequence="5" groups="base.group_user,base.group_hr_user,base.group_hr_manager"/>
<menuitem id="menu_hr_attendance" name="Attendances" parent="hr.menu_hr_root" sequence="10" groups="base.group_hr_attendance"/>
<menuitem action="open_view_attendance" id="menu_open_view_attendance" parent="menu_hr_attendance" sequence="20" groups="base.group_hr_attendance"/>
<menuitem
action="action_hr_attendance_graph"
id="menu_hr_attendance_graph"
parent="hr.menu_hr_reporting"
sequence="3"
/>
<record id="edit_attendance_reason" model="ir.ui.view">
<field name="name">hr.action.reason.form</field>
<field name="model">hr.action.reason</field>

View File

@ -20,7 +20,5 @@
##############################################################################
import attendance_errors
import attendance_by_month
import timesheet
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,196 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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 datetime import datetime, timedelta
from dateutil.relativedelta import relativedelta
import time
import openerp
from openerp.report import report_sxw
from openerp.report.interface import report_rml
from openerp.report.interface import toxml
from openerp.tools import to_xml, ustr
from openerp.tools.translate import _
one_day = relativedelta(days=1)
month2name = [0, 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December']
def hour2str(h):
hours = int(h)
minutes = int(round((h - hours) * 60, 0))
return '%02dh%02d' % (hours, minutes)
def lengthmonth(year, month):
if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))):
return 29
return [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]
class report_custom(report_rml):
def create_xml(self, cr, uid, ids, datas, context=None):
registry = openerp.registry(cr.dbname)
obj_emp = registry['hr.employee']
if context is None:
context = {}
month = datetime(datas['form']['year'], datas['form']['month'], 1)
emp_ids = datas['active_ids']
user_xml = ['<month>%s</month>' % _(month2name[month.month]), '<year>%s</year>' % month.year]
if emp_ids:
for emp in obj_emp.read(cr, uid, emp_ids, ['name']):
stop, days_xml = False, []
total_wh = 0.0
user_repr = '''
<user>
<name>%s</name>
%%s
</user>
''' % (ustr(toxml(emp['name'])))
today, tomor = month, month + one_day
while today.month == month.month:
#### Work hour calculation
sql = '''
select action, att.name
from hr_employee as emp inner join hr_attendance as att
on emp.id = att.employee_id
where att.name between %s and %s and emp.id = %s
order by att.name
'''
cr.execute(sql, (today.strftime('%Y-%m-%d %H:%M:%S'), tomor.strftime('%Y-%m-%d %H:%M:%S'), emp['id']))
attendences = cr.dictfetchall()
wh = 0.0
# Fake sign ins/outs at week ends, to take attendances across week ends into account
if attendences and attendences[0]['action'] == 'sign_out':
attendences.insert(0, {'name': today.strftime('%Y-%m-%d %H:%M:%S'), 'action':'sign_in'})
if attendences and attendences[-1]['action'] == 'sign_in':
attendences.append({'name': tomor.strftime('%Y-%m-%d %H:%M:%S'), 'action':'sign_out'})
# sum up the attendances' durations
ldt = None
for att in attendences:
dt = datetime.strptime(att['name'], '%Y-%m-%d %H:%M:%S')
if ldt and att['action'] == 'sign_out':
if dt.date() > ldt.date():
dt = ldt
wh += (float((dt - ldt).seconds)/60/60)
else:
ldt = dt
# Week xml representation
total_wh += wh
wh = hour2str(wh)
today_xml = '<day num="%s"><wh>%s</wh></day>' % ((today - month).days+1, (wh))
dy=(today - month).days+1
days_xml.append(today_xml)
today, tomor = tomor, tomor + one_day
total_wh = hour2str(total_wh)
today_xml = '<day num="Total"><wh>%s</wh></day>' % (total_wh)
days_xml.append(today_xml)
user_xml.append(user_repr % '\n'.join(days_xml))
rpt_obj = obj_emp
rml_obj=report_sxw.rml_parse(cr, uid, rpt_obj._name,context)
header_xml = '''
<header>
<date>%s</date>
<company>%s</company>
</header>
''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),to_xml(registry['res.users'].browse(cr,uid,uid).company_id.name))
first_date = str(month)
som = datetime.strptime(first_date, '%Y-%m-%d %H:%M:%S')
eom = som + timedelta(int(dy)-1)
day_diff=eom-som
date_xml=[]
cell=1
date_xml.append('<days>')
if day_diff.days>=30:
date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som.replace(day=x).strftime('%a')),x-som.day+1) for x in range(som.day, lengthmonth(som.year, som.month)+1)]
else:
if day_diff.days>=(lengthmonth(som.year, som.month)-som.day):
date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som.replace(day=x).strftime('%a')),x-som.day+1) for x in range(som.day, lengthmonth(som.year, som.month)+1)]
else:
date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som.replace(day=x).strftime('%a')),x-som.day+1) for x in range(som.day, eom.day+1)]
cell=x-som.day+1
day_diff1=day_diff.days-cell+1
width_dict={}
month_dict={}
i=1
j=1
year=som.year
month=som.month
month_dict[j]=som.strftime('%B')
width_dict[j]=cell
while day_diff1>0:
if month+i<=12:
if day_diff1 > lengthmonth(year,i+month): # Not on 30 else you have problems when entering 01-01-2009 for example
som1=datetime.date(year,month+i,1)
date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, lengthmonth(year,i+month)+1)]
i=i+1
j=j+1
month_dict[j]=som1.strftime('%B')
cell=cell+x
width_dict[j]=x
else:
som1=datetime.date(year,month+i,1)
date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, eom.day+1)]
i=i+1
j=j+1
month_dict[j]=som1.strftime('%B')
cell=cell+x
width_dict[j]=x
day_diff1=day_diff1-x
else:
years=year+1
year=years
month=0
i=1
if day_diff1>=30:
som1=datetime.date(years,i,1)
date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, lengthmonth(years,i)+1)]
i=i+1
j=j+1
month_dict[j]=som1.strftime('%B')
cell=cell+x
width_dict[j]=x
else:
som1=datetime.date(years,i,1)
i=i+1
j=j+1
month_dict[j]=som1.strftime('%B')
date_xml += ['<dayy number="%d" name="%s" cell="%d"/>' % (x, _(som1.replace(day=x).strftime('%a')),cell+x) for x in range(1, eom.day+1)]
cell=cell+x
width_dict[j]=x
day_diff1=day_diff1-x
date_xml += ['<dayy name="Total" cell="Total"/>']
date_xml.append('</days>')
date_xml.append('<cols>3.5cm%s,1.2cm</cols>\n' % (',0.74cm' * (int(dy))))
xml = '''<?xml version="1.0" encoding="UTF-8" ?>
<report>
%s
<title>%s</title>
%s
%s
</report>
''' % (header_xml,_('Attendances by Month'),'\n'.join(user_xml),date_xml)
return xml
report_custom('report.hr.attendance.bymonth', 'hr.employee', '', 'addons/hr_attendance/report/bymonth.xsl')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,81 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:import href="hr_custom_default.xsl"/>
<xsl:import href="hr_custom_rml.xsl"/>
<xsl:template match="/">
<xsl:call-template name="rml" />
</xsl:template>
<xsl:template name="stylesheet">
<paraStyle name="title" fontName="Helvetica-Bold" fontSize="15.0" leading="17" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="terp_header_Centre" fontName="Helvetica-Bold" fontSize="14.0" leading="17" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="name" fontName="Helvetica" textColor="green" fontSize="7"/>
<paraStyle name="normal" fontName="Helvetica" fontSize="6"/>
<blockTableStyle id="week">
<blockFont name="Helvetica-BoldOblique" size="6" alignment="center" start="0,0" stop="-1,1"/>
<blockFont name="Helvetica" size="5" alignment="center" start="0,1" stop="-1,-1"/>
<blockBackground colorName="#AAAAAA" start="1,0" stop="-1,1"/>
<lineStyle kind="LINEABOVE" colorName="black" start="0,0" stop="-1,0" />
<lineStyle kind="LINEBEFORE" colorName="black" start="0,0" stop="-1,-1"/>
<lineStyle kind="LINEAFTER" colorName="black" start="-1,0" stop="-1,-1"/>
<lineStyle kind="LINEBELOW" colorName="black" start="0,0" stop="-1,-1"/>
<blockValign value="TOP"/>
</blockTableStyle>
</xsl:template>
<xsl:template name="story">
<spacer length="1cm" />
<xsl:apply-templates select="report/title"/>
<spacer length="1cm" />
<blockTable>
<xsl:attribute name="style">week</xsl:attribute>
<xsl:attribute name="colWidths"><xsl:value-of select="report/cols" /></xsl:attribute>
<tr>
<td><xsl:value-of select="/report/year" /></td>
<xsl:for-each select="report/days/dayy">
<td>
<xsl:value-of select="attribute::name" />
</td>
</xsl:for-each>
</tr>
<tr>
<td><xsl:value-of select="/report/month" /></td>
<xsl:for-each select="report/days/dayy">
<td>
<xsl:value-of select="attribute::number" />
</td>
</xsl:for-each>
</tr>
<xsl:apply-templates select="report/user"/>
</blockTable>
</xsl:template>
<xsl:template match="title">
<para style="title">
<xsl:value-of select="."/>
</para>
<spacer length="1cm"/>
</xsl:template>
<xsl:template match="user">
<!-- <tr></tr>-->
<tr>
<td>
<para style="name"><xsl:value-of select="name" /></para>
</td>
<xsl:for-each select="day">
<td><xsl:value-of select="wh" /></td>
</xsl:for-each>
</tr>
<!-- <tr>-->
<!-- <td>Worked</td>-->
<!-- -->
<!-- </tr>-->
</xsl:template>
</xsl:stylesheet>

View File

@ -1,36 +0,0 @@
<?xml version = '1.0' encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template name="first_page_graphics_corporation">
<!--logo-->
<fill color="black"/>
<stroke color="black"/>
<setFont name="DejaVuSans" size="8"/>
<drawString x="1.3cm" y="19.5cm"><xsl:value-of select="//report/header/date"/></drawString>
<setFont name="DejaVuSans-Bold" size="10"/>
<drawString x="13.8cm" y="19.5cm"><xsl:value-of select="//report/header/company"/></drawString>
<stroke color="#000000"/>
<lines>1.3cm 19.3cm 28.5cm 19.3cm</lines>
</xsl:template>
<xsl:template name="other_pages_graphics_corporation">
<!--logo-->
<fill color="black"/>
<stroke color="black"/>
<setFont name="DejaVuSans" size="8"/>
<drawString x="1.3cm" y="19.5cm"><xsl:value-of select="//report/header/date"/></drawString>
<setFont name="DejaVuSans-Bold" size="10"/>
<drawString x="27.8cm" y="19.5cm"><xsl:value-of select="//report/header/company"/></drawString>
<stroke color="#000000"/>
<lines>1.3cm 19.3cm 28.5cm 19.3cm</lines>
</xsl:template>
<xsl:template name="first_page_frames">
<frame id="col1" x1="2.0cm" y1="2.5cm" width="24.7cm" height="17cm"/>
</xsl:template>
<xsl:template name="other_pages_frames">
<frame id="col1" x1="2.0cm" y1="2.5cm" width="24.7cm" height="17cm"/>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,37 +0,0 @@
<?xml version = '1.0' encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template name="first_page_graphics_report"/>
<xsl:template name="other_pages_graphics_report"/>
<xsl:template name="rml">
<document filename="example.pdf">
<template pageSize="29.7cm,21cm" leftMargin="2.0cm" rightMargin="2.0cm" topMargin="2.0cm" bottomMargin="2.0cm" title="Timesheets" author="Generated by Open ERP, Fabien Pinckaers" allowSplitting="20">
<pageTemplate id="first_page">
<pageGraphics>
<xsl:call-template name="first_page_graphics_corporation"/>
</pageGraphics>
<xsl:call-template name="first_page_frames"/>
</pageTemplate>
<pageTemplate id="other_pages">
<pageGraphics>
<xsl:call-template name="other_pages_graphics_corporation"/>
</pageGraphics>
<xsl:call-template name="other_pages_frames"/>
</pageTemplate>
</template>
<stylesheet>
<xsl:call-template name="stylesheet"/>
</stylesheet>
<story>
<xsl:call-template name="story"/>
</story>
</document>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,127 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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 datetime import datetime
from dateutil.relativedelta import relativedelta
import time
import openerp
from openerp import tools
from openerp.report import report_sxw
from openerp.report.interface import report_rml, toxml
from openerp.tools.translate import _
one_week = relativedelta(days=7)
num2day = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday']
def to_hour(h):
return int(h), int(round((h - int(h)) * 60, 0))
class report_custom(report_rml):
def create_xml(self, cr, uid, ids, datas, context=None):
registry = openerp.registry(cr.dbname)
obj_emp = registry['hr.employee']
emp_ids = datas['active_ids']
start_date = datetime.strptime(datas['form']['init_date'], '%Y-%m-%d')
end_date = datetime.strptime(datas['form']['end_date'], '%Y-%m-%d')
first_monday = start_date - relativedelta(days=start_date.date().weekday())
last_monday = end_date + relativedelta(days=7 - end_date.date().weekday())
if last_monday < first_monday:
first_monday, last_monday = last_monday, first_monday
rpt_obj = obj_emp
rml_obj=report_sxw.rml_parse(cr, uid, rpt_obj._name,context)
header_xml = '''
<header>
<date>%s</date>
<company>%s</company>
</header>
''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),registry['res.users'].browse(cr,uid,uid).company_id.name)
user_xml = []
for employee_id in emp_ids:
emp = obj_emp.read(cr, uid, [employee_id], ['id', 'name'])[0]
monday, n_monday = first_monday, first_monday + one_week
stop, week_xml = False, []
user_repr = '''
<user>
<name>%s</name>
%%s
</user>
''' % tools.ustr(toxml(emp['name']))
while monday != last_monday:
#### Work hour calculation
sql = '''
select action, att.name
from hr_employee as emp inner join hr_attendance as att
on emp.id = att.employee_id
where att.name between %s and %s and emp.id = %s
order by att.name
'''
for idx in range(7):
cr.execute(sql, (monday.strftime('%Y-%m-%d %H:%M:%S'), (monday + relativedelta(days=idx+1)).strftime('%Y-%m-%d %H:%M:%S'), employee_id))
attendances = cr.dictfetchall()
week_wh = {}
# Fake sign ins/outs at week ends, to take attendances across week ends into account
# XXX this is wrong for the first sign-in ever and the last sign out to this date
if attendances and attendances[0]['action'] == 'sign_out':
attendances.insert(0, {'name': monday.strftime('%Y-%m-%d %H:%M:%S'), 'action': 'sign_in'})
if attendances and attendances[-1]['action'] == 'sign_in':
attendances.append({'name': n_monday.strftime('%Y-%m-%d %H:%M:%S'), 'action': 'sign_out'})
# sum up the attendances' durations
ldt = None
for att in attendances:
dt = datetime.strptime(att['name'], '%Y-%m-%d %H:%M:%S')
if ldt and att['action'] == 'sign_out':
week_wh[ldt.date().weekday()] = week_wh.get(ldt.date().weekday(), 0) + (float((dt - ldt).seconds)/3600)
else:
ldt = dt
# Week xml representation
week_repr = ['<week>', '<weekstart>%s</weekstart>' % monday.strftime('%Y-%m-%d'), '<weekend>%s</weekend>' % (n_monday - relativedelta(days=1)).strftime('%Y-%m-%d')]
for idx in range(7):
week_repr.append('<%s>' % num2day[idx])
if idx in week_wh:
week_repr.append('<workhours>%sh%02d</workhours>' % to_hour(week_wh[idx]))
week_repr.append('</%s>' % num2day[idx])
week_repr.append('<total>')
week_repr.append('<worked>%sh%02d</worked>' % to_hour(reduce(lambda x,y:x+y, week_wh.values(), 0)))
week_repr.append('</total>')
week_repr.append('</week>')
week_xml.append('\n'.join(week_repr))
monday, n_monday = n_monday, n_monday + one_week
user_xml.append(user_repr % '\n'.join(week_xml))
xml = '''<?xml version="1.0" encoding="UTF-8" ?>
<report>
%s
<title>%s</title>
%s
</report>
''' % (header_xml,_('Attendances by Week'),'\n'.join(user_xml))
xml = tools.ustr(xml).encode('utf8')
return self.post_process_xml_data(cr, uid, xml, context)
report_custom('report.hr.attendance.allweeks', 'hr.employee', '', 'addons/hr_attendance/report/timesheet.xsl')
# vim:noexpandtab:tw=0

View File

@ -1,155 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:import href="hr_custom_default.xsl"/>
<xsl:import href="hr_custom_rml.xsl"/>
<xsl:template match="/">
<xsl:call-template name="rml" />
</xsl:template>
<xsl:template name="stylesheet">
<document filename="timesheet.pdf">
<template pageSize="29.7cm,21cm" leftMargin="2.0cm" rightMargin="2.0cm" topMargin="2.0cm" bottomMargin="2.0cm" title="Timesheets" author="Generated by Open ERP, Fabien Pinckaers" allowSplitting="20">
<pageTemplate id="first">
<pageGraphics>
<drawRightString x="19.0cm" y="26.0cm"><xsl:value-of select="date"/></drawRightString>
</pageGraphics>
<frame id="col1" x1="2.0cm" y1="2.5cm" width="22.7cm" height="18cm"/>
</pageTemplate>
</template>
<stylesheet>
<paraStyle name="title" fontName="Helvetica-Bold" fontSize="15.0" leading="17" alignment="CENTER" spaceBefore="12.0" spaceAfter="6.0"/>
<paraStyle name="emp" fontSize="13.0"/>
<blockTableStyle id="week">
<blockFont name="Helvetica" size="9" start="0,0" stop="-1,-1"/>
<blockFont name="Helvetica-BoldOblique" size="12" start="0,0" stop="0,0"/>
<blockBackground colorName="lightgrey" start="1,0" stop="-1,0"/>
<blockFont name="Helvetica-BoldOblique" start="-1,0" stop="-1,-1"/>
<lineStyle kind="LINEABOVE" colorName="black" start="0,0" stop="-1,0" />
<lineStyle kind="LINEBEFORE" colorName="black" start="0,0" stop="-1,-1"/>
<lineStyle kind="LINEAFTER" colorName="black" start="-1,0" stop="-1,-1"/>
<lineStyle kind="LINEBELOW" colorName="black" start="0,0" stop="-1,-1"/>
<blockValign value="TOP"/>
</blockTableStyle>
</stylesheet>
<story>
<xsl:call-template name="story"/>
</story>
</document>
</xsl:template>
<xsl:template name="story">
<spacer length="1cm" />
<xsl:apply-templates select="report/title"/>
<xsl:apply-templates select="report/user"/>
</xsl:template>
<xsl:template match="title">
<para style="title">
<xsl:value-of select="."/>
</para>
<spacer length="1cm"/>
</xsl:template>
<xsl:template match="user">
<spacer length="1cm" />
<para style="emp">
<b>Employee: </b>
<i><xsl:value-of select="name" /></i>
</para>
<spacer length="0.5cm" />
<xsl:for-each select="week">
<blockTable colWidths="8cm,2cm,2cm,2cm,2cm,2cm,2cm,2cm,2cm" style="week">
<tr>
<td>From <xsl:value-of select="weekstart" /> to <xsl:value-of select="weekend" /></td>
<td>Mon</td>
<td>Tue</td>
<td>Wed</td>
<td>Thu</td>
<td>Fri</td>
<td>Sat</td>
<td>Sun</td>
<td>Total</td>
</tr>
<tr>
<td>Worked hours</td>
<td>
<xsl:choose>
<xsl:when test="Monday/workhours">
<xsl:value-of select="Monday/workhours" />
</xsl:when>
<xsl:otherwise>0h00</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:choose>
<xsl:when test="Tuesday/workhours">
<xsl:value-of select="Tuesday/workhours" />
</xsl:when>
<xsl:otherwise>0h00</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:choose>
<xsl:when test="Wednesday/workhours">
<xsl:value-of select="Wednesday/workhours" />
</xsl:when>
<xsl:otherwise>0h00</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:choose>
<xsl:when test="Thursday/workhours">
<xsl:value-of select="Thursday/workhours" />
</xsl:when>
<xsl:otherwise>0h00</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:choose>
<xsl:when test="Friday/workhours">
<xsl:value-of select="Friday/workhours" />
</xsl:when>
<xsl:otherwise>0h00</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:choose>
<xsl:when test="Saturday/workhours">
<xsl:value-of select="Saturday/workhours" />
</xsl:when>
<xsl:otherwise>0h00</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:choose>
<xsl:when test="Sunday/workhours">
<xsl:value-of select="Sunday/workhours" />
</xsl:when>
<xsl:otherwise>0h00</xsl:otherwise>
</xsl:choose>
</td>
<td>
<xsl:value-of select="total/worked" />
</td>
</tr>
</blockTable>
<xsl:if test="position() != last()">
<blockTable colWidths="24cm" style="week">
<tr>
<td colspan="6"></td>
</tr>
</blockTable>
</xsl:if>
</xsl:for-each>
<xsl:if test="position() != last()">
<pageBreak/>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,11 +1,3 @@
-
Print the HR Attendance Report By Month through the wizard
-
!python {model: hr.employee}: |
from openerp.tools import test_reports
ctx = {'model': 'hr.employee','active_ids': [ref('hr.employee_fp'),ref('hr.employee_qdp'),ref('hr.employee_al')]}
data_dict = {}
test_reports.try_report_action(cr, uid, 'action_hr_attendance_month',wiz_data=data_dict, context=ctx, our_module='hr_attendance')
-
Print HR Attendance Error Report through the wizard
-

View File

@ -20,7 +20,5 @@
##############################################################################
import hr_attendance_error
import hr_attendance_byweek
import hr_attendance_bymonth
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,52 +0,0 @@
# -*- coding: utf-8 -*-
###############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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/>.
#
##############################################################################
import time
from openerp.osv import osv, fields
class hr_attendance_bymonth(osv.osv_memory):
_name = 'hr.attendance.month'
_description = 'Print Monthly Attendance Report'
_columns = {
'month': fields.selection([(1, 'January'), (2, 'February'), (3, 'March'), (4, 'April'), (5, 'May'), (6, 'June'), (7, 'July'), (8, 'August'), (9, 'September'), (10, 'October'), (11, 'November'), (12, 'December')], 'Month', required=True),
'year': fields.integer('Year', required=True)
}
_defaults = {
'month': lambda *a: time.gmtime()[1],
'year': lambda *a: time.gmtime()[0],
}
def print_report(self, cr, uid, ids, context=None):
datas = {
'ids': [],
'active_ids': context['active_ids'],
'model': 'hr.employee',
'form': self.read(cr, uid, ids)[0]
}
return {
'type': 'ir.actions.report.xml',
'report_name': 'hr.attendance.bymonth',
'datas': datas,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,42 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_hr_attendance_month" model="ir.ui.view">
<field name="name">Attendances Report Monthly</field>
<field name="model">hr.attendance.month</field>
<field name="arch" type="xml">
<form string="Print Attendance Report Monthly" version="7.0">
<group col="4">
<field name="month"/>
<field name="year"/>
</group>
<footer>
<button name="print_report" string="Print" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
<record id="action_hr_attendance_month" model="ir.actions.act_window">
<field name="name">Attendances By Month</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.attendance.month</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record model="ir.values" id="hr_attendance_month_values">
<field name="model_id" ref="hr.model_hr_employee" />
<field name="name">Attendances By Month</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_hr_attendance_month'))" />
<field name="key">action</field>
<field name="model">hr.employee</field>
</record>
</data>
</openerp>

View File

@ -1,53 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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 datetime import datetime
from dateutil.relativedelta import relativedelta
from openerp.osv import fields, osv
class hr_attendance_byweek(osv.osv_memory):
_name = 'hr.attendance.week'
_description = 'Print Week Attendance Report'
_columns = {
'init_date': fields.date('Starting Date', required=True),
'end_date': fields.date('Ending Date', required=True)
}
_defaults = {
'init_date': (datetime.today() - relativedelta(days=datetime.date(datetime.today()).weekday())).strftime('%Y-%m-%d'),
'end_date': (datetime.today() + relativedelta(days=6 - datetime.date(datetime.today()).weekday())).strftime('%Y-%m-%d'),
}
def print_report(self, cr, uid, ids, context=None):
datas = {
'ids': [],
'active_ids': context['active_ids'],
'model': 'hr.employee',
'form': self.read(cr, uid, ids)[0]
}
return {
'type': 'ir.actions.report.xml',
'report_name': 'hr.attendance.allweeks',
'datas': datas,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,41 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_hr_attendance_week" model="ir.ui.view">
<field name="name">Attendances Report Weekly</field>
<field name="model">hr.attendance.week</field>
<field name="arch" type="xml">
<form string="Print Attendance Report Weekly" version="7.0">
<group>
<field name="init_date"/>
<field name="end_date"/>
</group>
<footer>
<button name="print_report" string="Print" type="object" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>
<record id="action_hr_attendance_week" model="ir.actions.act_window">
<field name="name">Attendances By Week</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.attendance.week</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="target">new</field>
</record>
<record model="ir.values" id="hr_attendance_week_values">
<field name="model_id" ref="hr.model_hr_employee" />
<field name="name">Attendances By Week</field>
<field name="key2">client_print_multi</field>
<field name="value" eval="'ir.actions.act_window,' + str(ref('action_hr_attendance_week'))" />
<field name="key">action</field>
<field name="model">hr.employee</field>
</record>
</data>
</openerp>

View File

@ -54,7 +54,6 @@ Key Features
'security/hr_evaluation_security.xml',
'hr_evaluation_view.xml',
'report/hr_evaluation_report_view.xml',
'board_hr_evaluation_view.xml',
'survey_data_appraisal.xml',
'hr_evaluation_data.xml',
'hr_evaluation_installer.xml',

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.actions.act_window" id="action_hr_evaluation_interview_board">
<field name="name">Interview Requests</field>
<field name="res_model">hr.evaluation.interview</field>
<field name="view_type">form</field>
<field name="view_id" eval="False"/>
<field name="domain">[('is_evaluation' ,'=', True), ('user_id', '=', uid),('state','=','waiting_answer')]</field>
<field name="search_view_id" ref="view_hr_evaluation_interview_search"/>
</record>
<record id="board_hr_evaluation_form" model="ir.ui.view">
<field name="name">board.hr.evaluation.form</field>
<field name="model">board.board</field>
<field name="inherit_id" ref="hr.board_hr_form"/>
<field name="arch" type="xml">
<xpath expr="/form/board/column[2]" position="inside">
<action name="%(action_hr_evaluation_interview_board)d" string="Interview Requests"/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -54,10 +54,8 @@ This module also uses analytic accounting and is compatible with the invoice on
'hr_expense_workflow.xml',
'hr_expense_view.xml',
'hr_expense_report.xml',
'process/hr_expense_process.xml',
'security/ir_rule.xml',
'report/hr_expense_report_view.xml',
'board_hr_expense_view.xml',
'hr_expense_installer_view.xml',
'views/report_expense.xml',
],

View File

@ -1,26 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="action_my_expense" model="ir.actions.act_window">
<field name="name">My Expenses</field>
<field name="res_model">hr.expense.expense</field>
<field name="view_type">form</field>
<field name="domain">[('state','in',('confirm', 'accepted')),('user_id','=',uid)]</field>
<field name="context">{'default_user_id': uid}</field>
<field name="view_id" ref="hr_expense.view_editable_expenses_tree"/>
</record>
<record id="board_hr_expense_form" model="ir.ui.view">
<field name="name">board.hr.expense.form</field>
<field name="model">board.board</field>
<field name="inherit_id" ref="hr.board_hr_form"/>
<field name="arch" type="xml">
<xpath expr="/form/board/column[1]" position="inside">
<action name="%(action_my_expense)d" string="My Expenses"/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -1,181 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
<!--
Process
-->
<record id="process_process_expenseprocess0" model="process.process">
<field eval="1" name="active"/>
<field name="model_id" ref="model_hr_expense_expense"/>
<field eval="&quot;&quot;&quot;Expense&quot;&quot;&quot;" name="name"/>
</record>
<!--
Process Node
-->
<record id="process_node_draftexpenses0" model="process.node">
<field name="menu_id" ref="menu_expense_all"/>
<field name="model_id" ref="model_hr_expense_expense"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Draft Expenses&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Employee encode all his expenses&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_expenseprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_confirmedexpenses0" model="process.node">
<field name="menu_id" ref="menu_expense_all"/>
<field name="model_id" ref="model_hr_expense_expense"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Confirmed Expenses&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The employee validates his expense sheet&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_expenseprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='confirm'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_refused0" model="process.node">
<field name="menu_id" ref="menu_expense_all"/>
<field name="model_id" ref="model_hr_expense_expense"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Refused&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The direct manager refuses the sheet.Reset as draft.&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_expenseprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='canceled'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_approved0" model="process.node">
<field name="menu_id" ref="menu_expense_all"/>
<field name="model_id" ref="model_hr_expense_expense"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Approved&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The direct manager approves the sheet&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_expenseprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='accepted'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_supplierinvoice0" model="process.node">
<field name="menu_id" ref="account.menu_action_invoice_tree2"/>
<field name="model_id" ref="account.model_account_invoice"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Supplier Invoice&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The accoutant validates the sheet&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_expenseprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_reimbursement0" model="process.node">
<field name="menu_id" ref="account.menu_action_invoice_tree2"/>
<field name="model_id" ref="account.model_account_invoice"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Reimbursement&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The accoutant reimburse the expenses&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_expenseprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='paid'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_reinvoicing0" model="process.node">
<field name="menu_id" ref="account.menu_action_invoice_tree1"/>
<field name="model_id" ref="account.model_account_invoice"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Reinvoicing&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Some costs may be reinvoices to the customer&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_expenseprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<!--
Process Transition
-->
<record id="process_transition_confirmexpense0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Confirm expense&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Expense is confirmed.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_confirmedexpenses0"/>
<field name="source_node_id" ref="process_node_draftexpenses0"/>
</record>
<record id="process_transition_refuseexpense0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Refuse expense&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Expense is refused.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_refused0"/>
<field name="source_node_id" ref="process_node_confirmedexpenses0"/>
</record>
<record id="process_transition_approveexpense0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Approve expense&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Expense is approved.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_approved0"/>
<field name="source_node_id" ref="process_node_confirmedexpenses0"/>
</record>
<record id="process_transition_approveinvoice0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Supplier Invoice&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Creates supplier invoice.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_supplierinvoice0"/>
<field name="source_node_id" ref="process_node_approved0"/>
</record>
<record id="process_transition_reimburseexpense0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Reimburse expense&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;After creating invoice, reimburse expenses&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_reimbursement0"/>
<field name="source_node_id" ref="process_node_supplierinvoice0"/>
</record>
<record id="process_transition_reimbursereinvoice0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Reinvoice&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Create Customer invoice&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_reinvoicing0"/>
<field name="source_node_id" ref="process_node_reimbursement0"/>
</record>
<!--
Process Transition Action
-->
<record id="process_transition_action_confirm0" model="process.transition.action">
<field eval="&quot;&quot;&quot;expense_confirm&quot;&quot;&quot;" name="action"/>
<field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
<field eval="&quot;&quot;&quot;Confirm&quot;&quot;&quot;" name="name"/>
<field name="transition_id" ref="process_transition_confirmexpense0"/>
</record>
<record id="process_transition_action_refuse0" model="process.transition.action">
<field eval="&quot;&quot;&quot;expense_canceled&quot;&quot;&quot;" name="action"/>
<field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
<field eval="&quot;&quot;&quot;Refuse&quot;&quot;&quot;" name="name"/>
<field name="transition_id" ref="process_transition_refuseexpense0"/>
</record>
<record id="process_transition_action_accept0" model="process.transition.action">
<field eval="&quot;&quot;&quot;expense_accept&quot;&quot;&quot;" name="action"/>
<field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
<field eval="&quot;&quot;&quot;Accept&quot;&quot;&quot;" name="name"/>
<field name="transition_id" ref="process_transition_approveexpense0"/>
</record>
<record id="process_transition_action_supplierinvoice0" model="process.transition.action">
<field eval="&quot;&quot;&quot;action_invoice_create&quot;&quot;&quot;" name="action"/>
<field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
<field eval="&quot;&quot;&quot;Invoice&quot;&quot;&quot;" name="name"/>
<field name="transition_id" ref="process_transition_approveinvoice0"/>
</record>
</data>
</openerp>

View File

@ -45,7 +45,7 @@ You can keep track of leaves in different ways by following reports:
A synchronization with an internal agenda (Meetings of the CRM module) is also possible in order to automatically create a meeting when a holiday request is accepted by setting up a type of meeting in Leave Type.
""",
'images': ['images/hr_allocation_requests.jpeg', 'images/hr_leave_requests.jpeg', 'images/leaves_analysis.jpeg'],
'depends': ['hr', 'calendar', 'process', 'resource'],
'depends': ['hr', 'calendar', 'resource'],
'data': [
'security/ir.model.access.csv',
'security/ir_rule.xml',
@ -57,7 +57,6 @@ A synchronization with an internal agenda (Meetings of the CRM module) is also p
'report/available_holidays_view.xml',
'wizard/hr_holidays_summary_department_view.xml',
'wizard/hr_holidays_summary_employees_view.xml',
'board_hr_holidays_view.xml',
],
'demo': ['hr_holidays_demo.xml',],
'qweb': [

View File

@ -1,27 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record model="ir.actions.act_window" id="action_hr_holidays_leaves_by_month">
<field name="name">My Leaves</field>
<field name="res_model">hr.holidays.status</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" eval="False"/>
<field name="context">{}</field>
<field name="domain">[]</field>
</record>
<record id="board_hr_holidays_leave_by_month_form" model="ir.ui.view">
<field name="name">board.hr.holidays.leave.month.form</field>
<field name="model">board.board</field>
<field name="inherit_id" ref="hr.board_hr_form"/>
<field name="arch" type="xml">
<xpath expr="/form/board/column[1]" position="inside">
<action name="%(action_hr_holidays_leaves_by_month)d" string="My Leaves"/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -1,173 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
<!--
Process
-->
<record id="process_process_holidaysprocess0" model="process.process">
<field eval="&quot;&quot;&quot;Holidays&quot;&quot;&quot;" name="name"/>
<field name="model_id" ref="hr_holidays.model_hr_holidays"/>
<field eval="1" name="active"/>
</record>
<!--
Process Node
-->
<record id="process_node_holidaysdefinition0" model="process.node">
<field name="menu_id" ref="hr_holidays.menu_open_ask_holidays_new"/>
<field name="model_id" ref="hr_holidays.model_hr_holidays_per_user"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Encoding of annual available holidays.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Holidays Definition&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_holidaysprocess0"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_holidaysrequest0" model="process.node">
<field name="menu_id" ref="hr_holidays.menu_open_ask_holidays_new"/>
<field name="model_id" ref="hr_holidays.model_hr_holidays"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Employee fills in a request for holidays&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Holidays Request&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_holidaysprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_refused0" model="process.node">
<field name="menu_id" ref="hr_holidays.menu_open_ask_holidays_new"/>
<field name="model_id" ref="hr_holidays.model_hr_holidays"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;His manager refuses the request&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Refused&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_holidaysprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='refuse'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_approved0" model="process.node">
<field name="menu_id" ref="hr_holidays.menu_open_ask_holidays_new"/>
<field name="model_id" ref="hr_holidays.model_hr_holidays"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;His manager approves the request&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Approved&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_holidaysprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='validate'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_calendar0" model="process.node">
<field name="menu_id" ref="hr_holidays.menu_open_ask_holidays_new"/>
<field name="model_id" ref="hr_holidays.model_hr_holidays"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;The holiday is set in the calendar&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Calendar&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_holidaysprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='validate'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_holidays0" model="process.node">
<field name="menu_id" ref="hr_holidays.menu_open_ask_holidays"/>
<field name="model_id" ref="hr_holidays.model_hr_holidays"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Holidays&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Encode number of available holidays&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="hr.process_process_employeecontractprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('draft', 'validate', 'confirm', 'refuse', 'cancel')&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_legaldeclaration0" model="process.node">
<field name="menu_id" ref="hr_holidays.menu_open_ask_holidays"/>
<field name="model_id" ref="hr_holidays.model_hr_holidays"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Secretariat Social&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Legal Declaration Document to declare new employee&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="hr.process_process_employeecontractprocess0"/>
<field eval="0" name="flow_start"/>
</record>
<!--
Process Transition
-->
<record id="process_transition_employeedeclaration0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Employee Declaration&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Document for employee&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_legaldeclaration0"/>
<field name="source_node_id" ref="hr.process_node_employee0"/>
</record>
<record id="process_transition_holidaysdefrequest0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Holidays def Request&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;If holidays available, employee can take it and fill it.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_holidaysrequest0"/>
<field name="source_node_id" ref="process_node_holidaysdefinition0"/>
</record>
<record id="process_transition_refusedrequest0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Refused Request&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Request is refused.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_refused0"/>
<field name="source_node_id" ref="process_node_holidaysrequest0" />
</record>
<record id="process_transition_approvedrequest0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Approved Request&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Request is approved.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_approved0"/>
<field name="source_node_id" ref="process_node_holidaysrequest0"/>
</record>
<record id="process_transition_setholiday0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Set Holiday&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Holiday is set in the calendar.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_calendar0"/>
<field name="source_node_id" ref="process_node_approved0"/>
</record>
<record id="process_transition_employeeholidays0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Employee Holidays&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Employee get holidays&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_holidays0"/>
<field name="source_node_id" ref="process_node_legaldeclaration0"/>
</record>
<!--
Process Transition Action
-->
<record id="process_transition_action_confirm0" model="process.transition.action">
<field eval="&quot;&quot;&quot;holidays_confirm&quot;&quot;&quot;" name="action"/>
<field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
<field eval="&quot;&quot;&quot;Confirm&quot;&quot;&quot;" name="name"/>
<field name="transition_id" ref="process_transition_holidaysdefrequest0"/>
</record>
<record id="process_transition_action_reufse0" model="process.transition.action">
<field eval="&quot;&quot;&quot;holidays_refuse&quot;&quot;&quot;" name="action"/>
<field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
<field eval="&quot;&quot;&quot;Refuse&quot;&quot;&quot;" name="name"/>
<field name="transition_id" ref="process_transition_refusedrequest0"/>
</record>
<record id="process_transition_action_validate0" model="process.transition.action">
<field eval="&quot;&quot;&quot;holidays_validate&quot;&quot;&quot;" name="action"/>
<field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
<field eval="&quot;&quot;&quot;Validate&quot;&quot;&quot;" name="name"/>
<field name="transition_id" ref="process_transition_approvedrequest0"/>
</record>
</data>
</openerp>

1251
addons/hr_payroll/i18n/fa.po Normal file

File diff suppressed because it is too large Load Diff

View File

@ -54,7 +54,6 @@ You can define the different phases of interviews and easily rate the applicant
'security/hr_recruitment_security.xml',
'security/ir.model.access.csv',
'report/hr_recruitment_report_view.xml',
'board_hr_recruitment_statistical_view.xml',
'hr_recruitment_installer_view.xml',
'res_config_view.xml',
'survey_data_recruitment.xml',

View File

@ -1,41 +0,0 @@
<?xml version="1.0"?>
<openerp>
<data>
<record id="view_applicants_status_tree" model="ir.ui.view">
<field name="name">applicants.status.tree</field>
<field name="model">hr.applicant</field>
<field name="arch" type="xml">
<tree string="Applicants Status">
<field name="create_date"/>
<field name="job_id"/>
<field name="partner_name"/>
<field name="stage_id"/>
<field name="user_id"/>
</tree>
</field>
</record>
<record id="action_applicants_status" model="ir.actions.act_window">
<field name="name">Applicants Status</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">hr.applicant</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('stage_id.fold', '!=', True)]</field>
<field name="view_id" ref="view_applicants_status_tree"/>
</record>
<record id="board_hr_applicants_status_form" model="ir.ui.view">
<field name="name">board.hr.applicants.status.form</field>
<field name="model">board.board</field>
<field name="inherit_id" ref="hr.board_hr_form"/>
<field name="arch" type="xml">
<xpath expr="/form/board/column[1]" position="inside">
<action name="%(action_applicants_status)d" string="Applications to be Processed"/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -8,7 +8,6 @@
<graph string="Recruitment Analysis" type="pivot">
<field name="stage_id" type="row"/>
<field name="date_create" interval="week" type="col"/>
<field name="date_create" interval="day" type="col"/>
</graph>
</field>
</record>

View File

@ -21,7 +21,6 @@
import hr_timesheet
import wizard
import report
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -41,14 +41,11 @@ up a management by affair.
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'images': ['images/hr_timesheet_lines.jpeg'],
'depends': ['account', 'hr', 'base', 'hr_attendance', 'process'],
'depends': ['account', 'hr', 'base', 'hr_attendance'],
'data': [
'security/ir.model.access.csv',
'security/hr_timesheet_security.xml',
'hr_timesheet_view.xml',
'hr_timesheet_report.xml',
'hr_timesheet_wizard.xml',
'process/hr_timesheet_process.xml',
'wizard/hr_timesheet_sign_in_out_view.xml',
'hr_timesheet_installer.xml',
'hr_timesheet_data.xml'

View File

@ -1,9 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report auto="False" id="report_user_timesheet" menu="False" model="hr.employee" name="hr.analytical.timesheet" string="Employee timesheet" xsl="hr_timesheet/report/user_timesheet.xsl"/>
<report auto="False" id="report_users_timesheet" menu="False" model="hr.employee" name="hr.analytical.timesheet_users" string="Employees Timesheet" xsl="hr_timesheet/report/users_timesheet.xsl"/>
</data>
</openerp>

View File

@ -1,5 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
</data>
</openerp>

View File

@ -1,6 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
</data>
</openerp>

View File

@ -1,26 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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/>.
#
##############################################################################
import user_timesheet
import users_timesheet
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,36 +0,0 @@
<?xml version = '1.0' encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template name="first_page_graphics_corporation">
<!--logo-->
<fill color="black"/>
<stroke color="black"/>
<setFont name="DejaVuSans" size="8"/>
<drawString x="1.3cm" y="19.5cm"><xsl:value-of select="//report/header/date"/></drawString>
<setFont name="DejaVuSans-Bold" size="10"/>
<drawString x="13.8cm" y="19.5cm"><xsl:value-of select="//report/header/company"/></drawString>
<stroke color="#000000"/>
<lines>1.3cm 19.3cm 28.5cm 19.3cm</lines>
</xsl:template>
<xsl:template name="other_pages_graphics_corporation">
<!--logo-->
<fill color="black"/>
<stroke color="black"/>
<setFont name="DejaVuSans" size="8"/>
<drawString x="1.3cm" y="19.5cm"><xsl:value-of select="//report/header/date"/></drawString>
<setFont name="DejaVuSans-Bold" size="10"/>
<drawString x="27.8cm" y="19.5cm"><xsl:value-of select="//report/header/company"/></drawString>
<stroke color="#000000"/>
<lines>1.3cm 19.3cm 28.5cm 19.3cm</lines>
</xsl:template>
<xsl:template name="first_page_frames">
<frame id="col1" x1="2.0cm" y1="2.5cm" width="24.7cm" height="17cm"/>
</xsl:template>
<xsl:template name="other_pages_frames">
<frame id="col1" x1="2.0cm" y1="2.5cm" width="24.7cm" height="17cm"/>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,37 +0,0 @@
<?xml version = '1.0' encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:template name="first_page_graphics_report"/>
<xsl:template name="other_pages_graphics_report"/>
<xsl:template name="rml">
<document filename="example.pdf">
<template pageSize="29.7cm,21cm" leftMargin="2.0cm" rightMargin="2.0cm" topMargin="2.0cm" bottomMargin="2.0cm" title="Timesheets" author="Generated by Open ERP, Fabien Pinckaers" allowSplitting="20">
<pageTemplate id="first_page">
<pageGraphics>
<xsl:call-template name="first_page_graphics_corporation"/>
</pageGraphics>
<xsl:call-template name="first_page_frames"/>
</pageTemplate>
<pageTemplate id="other_pages">
<pageGraphics>
<xsl:call-template name="other_pages_graphics_corporation"/>
</pageGraphics>
<xsl:call-template name="other_pages_frames"/>
</pageTemplate>
</template>
<stylesheet>
<xsl:call-template name="stylesheet"/>
</stylesheet>
<story>
<xsl:call-template name="story"/>
</story>
</document>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,124 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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/>.
#
##############################################################################
import datetime
import time
import openerp
from openerp.report.interface import report_rml
from openerp.report.interface import toxml
from openerp.tools.translate import _
from openerp.report import report_sxw
from openerp.tools import ustr
from openerp.tools import to_xml
def lengthmonth(year, month):
if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))):
return 29
return [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]
class report_custom(report_rml):
def get_month_name(self, cr, uid, month, context=None):
_months = {1:_("January"), 2:_("February"), 3:_("March"), 4:_("April"), 5:_("May"), 6:_("June"), 7:_("July"), 8:_("August"), 9:_("September"), 10:_("October"), 11:_("November"), 12:_("December")}
return _months[month]
def get_weekday_name(self, cr, uid, weekday, context=None):
_weekdays = {1:_('Mon'), 2:_('Tue'), 3:_('Wed'), 4:_('Thu'), 5:_('Fri'), 6:_('Sat'), 7:_('Sun')}
return _weekdays[weekday]
def create_xml(self, cr, uid, ids, data, context):
registry = openerp.registry(cr.dbname)
# Get the user id from the selected employee record
emp_id = data['form']['employee_id']
emp_obj = registry['hr.employee']
user_id = emp_obj.browse(cr, uid, emp_id).user_id.id
empl_name = emp_obj.browse(cr, uid, emp_id).name
# Computing the dates (start of month: som, and end of month: eom)
som = datetime.date(data['form']['year'], data['form']['month'], 1)
eom = som + datetime.timedelta(lengthmonth(som.year, som.month))
date_xml = ['<date month="%s" year="%d" />' % (self.get_month_name(cr, uid, som.month, context=context), som.year), '<days>']
date_xml += ['<day number="%d" name="%s" weekday="%d" />' % (x, self.get_weekday_name(cr, uid, som.replace(day=x).weekday()+1, context=context), som.replace(day=x).weekday()+1) for x in range(1, lengthmonth(som.year, som.month)+1)]
date_xml.append('</days>')
date_xml.append('<cols>2.5cm%s,2cm</cols>\n' % (',0.7cm' * lengthmonth(som.year, som.month)))
# Sum attendence by account, then by day
accounts = {}
header_xml = ''
if user_id:
# Computing the attendence by analytical account
cr.execute(
"select line.date, (unit_amount / unit.factor) as amount, account_id, account.name "\
"from account_analytic_line as line, hr_analytic_timesheet as hr, "\
"account_analytic_account as account, product_uom as unit "\
"where hr.line_id=line.id and line.account_id=account.id "\
"and product_uom_id = unit.id "\
"and line.user_id=%s and line.date >= %s and line.date < %s "
"order by line.date",
(user_id, som.strftime('%Y-%m-%d'), eom.strftime('%Y-%m-%d')))
for presence in cr.dictfetchall():
day = int(presence['date'][-2:])
account = accounts.setdefault((presence['account_id'], presence['name']), {})
account[day] = account.get(day, 0.0) + presence['amount']
xml = '''
<time-element date="%s">
<amount>%.2f</amount>
</time-element>
'''
rpt_obj = registry['hr.employee']
rml_obj = report_sxw.rml_parse(cr, uid, rpt_obj._name,context)
if user_id:
header_xml = '''
<header>
<date>%s</date>
<company>%s</company>
</header>
''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),to_xml(registry['res.users'].browse(cr,uid,user_id).company_id.name))
account_xml = []
for account, telems in accounts.iteritems():
aid, aname = account
aname = registry['account.analytic.account'].name_get(cr, uid, [aid], context)
aname = aname[0][1]
account_xml.append('<account id="%d" name="%s">' % (aid, toxml(aname)))
account_xml.append('\n'.join([xml % (day, amount) for day, amount in telems.iteritems()]))
account_xml.append('</account>')
# Computing the xml
xml = '''<?xml version="1.0" encoding="UTF-8" ?>
<report>
%s
<employee>%s</employee>
%s
</report>
''' % (header_xml, ustr(toxml(empl_name)), '\n'.join(date_xml) + '\n'.join(account_xml))
return xml
report_custom('report.hr.analytical.timesheet', 'hr.employee', '', 'addons/hr_timesheet/report/user_timesheet.xsl')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,123 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:import href="custom_default.xsl"/>
<xsl:import href="custom_rml.xsl"/>
<xsl:template match="/">
<xsl:call-template name="rml"/>
</xsl:template>
<xsl:template name="stylesheet">
<paraStyle name="normal" fontName="Helvetica" fontSize="6" alignment="left" />
<paraStyle name="normal-title" fontName="Helvetica" fontSize="6" />
<paraStyle name="title" fontName="Helvetica" fontSize="18" alignment="center" />
<paraStyle name="employee" fontName="Helvetica-Oblique" fontSize="10" textColor="blue" />
<paraStyle name="glande" textColor="red" fontSize="7" fontName="Helvetica"/>
<paraStyle name="normal_people" textColor="green" fontSize="7" fontName="Helvetica"/>
<paraStyle name="esclave" textColor="purple" fontSize="7" fontName="Helvetica"/>
<blockTableStyle id="month">
<blockAlignment value="CENTER" start="1,0" stop="-1,-1" />
<blockFont name="Helvetica" size="8" start="0,0" stop="-1,1"/>
<blockFont name="Helvetica" size="6" start="0,2" stop="-2,-2"/>
<blockFont name="Helvetica-BoldOblique" size="8" start="0,-1" stop="-1,-1"/>
<blockBackground colorName="#AAAAAA" start="1,0" stop="-2,1"/>
<xsl:for-each select="/report/days/day[@weekday=6 or @weekday=7]">
<xsl:variable name="col" select="attribute::number" />
<blockBackground>
<xsl:attribute name="colorName">lightgrey</xsl:attribute>
<xsl:attribute name="start">
<xsl:value-of select="$col" />
<xsl:text>,0</xsl:text>
</xsl:attribute>
<xsl:attribute name="stop">
<xsl:value-of select="$col" />
<xsl:text>,-1</xsl:text>
</xsl:attribute>
</blockBackground>
</xsl:for-each>
<lineStyle kind="LINEABOVE" colorName="black" start="0,0" stop="-1,-1" />
<lineStyle kind="LINEBEFORE" colorName="black" start="0,0" stop="-1,-1"/>
<lineStyle kind="LINEAFTER" colorName="black" start="-1,0" stop="-1,-1"/>
<lineStyle kind="LINEBELOW" colorName="black" start="0,-1" stop="-1,-1"/>
<blockValign value="TOP"/>
</blockTableStyle>
</xsl:template>
<xsl:template name="story">
<spacer length="1cm" />
<para style="title" t="1">Timesheet by Employee</para>
<spacer length="1cm" />
<para style="employee"><xsl:value-of select="/report/employee" /></para>
<spacer length="1cm" />
<blockTable>
<xsl:attribute name="style">month</xsl:attribute>
<xsl:attribute name="colWidths"><xsl:value-of select="report/cols" /></xsl:attribute>
<tr>
<td><xsl:value-of select="report/date/attribute::year" /></td>
<xsl:for-each select="report/days/day">
<td>
<xsl:value-of select="attribute::name" />
</td>
</xsl:for-each>
<td></td>
</tr>
<tr>
<td><xsl:value-of select="report/date/attribute::month" /></td>
<xsl:for-each select="report/days/day">
<td>
<xsl:value-of select="attribute::number" />
</td>
</xsl:for-each>
<td t="1">Total</td>
</tr>
<xsl:apply-templates select="report/account"/>
<tr>
<td t="1">Sum</td>
<xsl:for-each select="report/days/day">
<xsl:variable name="today" select="attribute::number" />
<td>
<para style="normal">
<xsl:choose>
<xsl:when test="sum(//time-element[@date=$today]) &lt; 7.5">
<xsl:attribute name="style">glande</xsl:attribute>
</xsl:when>
<xsl:when test="sum(//time-element[@date=$today]) &lt; 8.5 and sum(//time-element[@date=$today]) &gt;= 7.5">
<xsl:attribute name="style">normal_people</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="style">esclave</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="format-number(sum(//time-element[@date=$today]),'##.##')" />
</para>
</td>
</xsl:for-each>
<td>
<xsl:value-of select="format-number(sum(//time-element),'##.##')" />
</td>
</tr>
</blockTable>
</xsl:template>
<xsl:template match="account">
<xsl:variable name="aid" select="attribute::id" />
<tr>
<td>
<para style="normal-title"><xsl:value-of select="attribute::name" /></para>
</td>
<xsl:for-each select="/report/days/day">
<xsl:variable name="today" select="attribute::number" />
<td>
<para style="normal"><xsl:value-of select="//account[@id=$aid]/time-element[@date=$today]" /></para>
</td>
</xsl:for-each>
<td>
<para style="normal"><xsl:value-of select="format-number(sum(//account[@id=$aid]/time-element),'##.##')" /></para>
</td>
</tr>
</xsl:template>
</xsl:stylesheet>

View File

@ -1,123 +0,0 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 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/>.
#
##############################################################################
import datetime
import time
import openerp
from openerp.report.interface import report_rml
from openerp.report.interface import toxml
from openerp.tools.translate import _
from openerp.report import report_sxw
from openerp.tools import ustr
def lengthmonth(year, month):
if month == 2 and ((year % 4 == 0) and ((year % 100 != 0) or (year % 400 == 0))):
return 29
return [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31][month]
def emp_create_xml(cr, id, som, eom, emp):
# Computing the attendence by analytical account
cr.execute(
"select line.date, (unit_amount / unit.factor) as amount "\
"from account_analytic_line as line, hr_analytic_timesheet as hr, "\
"product_uom as unit "\
"where hr.line_id=line.id "\
"and product_uom_id = unit.id "\
"and line.user_id=%s and line.date >= %s and line.date < %s "
"order by line.date",
(id, som.strftime('%Y-%m-%d'), eom.strftime('%Y-%m-%d')))
# Sum by day
month = {}
for presence in cr.dictfetchall():
day = int(presence['date'][-2:])
month[day] = month.get(day, 0.0) + presence['amount']
xml = '''
<time-element date="%s">
<amount>%.2f</amount>
</time-element>
'''
time_xml = ([xml % (day, amount) for day, amount in month.iteritems()])
# Computing the xml
xml = '''
<employee id="%d" name="%s">
%s
</employee>
''' % (id, toxml(emp), '\n'.join(time_xml))
return xml
class report_custom(report_rml):
def get_month_name(self, cr, uid, month, context=None):
_months = {1:_("January"), 2:_("February"), 3:_("March"), 4:_("April"), 5:_("May"), 6:_("June"), 7:_("July"), 8:_("August"), 9:_("September"), 10:_("October"), 11:_("November"), 12:_("December")}
return _months[month]
def get_weekday_name(self, cr, uid, weekday, context=None):
_weekdays = {1:_('Mon'), 2:_('Tue'), 3:_('Wed'), 4:_('Thu'), 5:_('Fri'), 6:_('Sat'), 7:_('Sun')}
return _weekdays[weekday]
def create_xml(self, cr, uid, ids, data, context):
registry = openerp.registry(cr.dbname)
# Computing the dates (start of month: som, and end of month: eom)
som = datetime.date(data['form']['year'], data['form']['month'], 1)
eom = som + datetime.timedelta(lengthmonth(som.year, som.month))
date_xml = ['<date month="%s" year="%d" />' % (self.get_month_name(cr, uid, som.month, context=context), som.year), '<days>']
date_xml += ['<day number="%d" name="%s" weekday="%d" />' % (x, self.get_weekday_name(cr, uid, som.replace(day=x).weekday()+1, context=context), som.replace(day=x).weekday()+1) for x in range(1, lengthmonth(som.year, som.month)+1)]
date_xml.append('</days>')
date_xml.append('<cols>2.5cm%s,2cm</cols>\n' % (',0.7cm' * lengthmonth(som.year, som.month)))
emp_xml=''
emp_obj = registry['hr.employee']
for id in data['form']['employee_ids']:
user = emp_obj.browse(cr, uid, id).user_id.id
empl_name = emp_obj.browse(cr, uid, id).name
if user:
emp_xml += emp_create_xml(cr, user, som, eom, empl_name)
# Computing the xml
#Without this, report don't show non-ascii characters (TO CHECK)
date_xml = '\n'.join(date_xml)
rpt_obj = emp_obj
rml_obj=report_sxw.rml_parse(cr, uid, rpt_obj._name,context)
header_xml = '''
<header>
<date>%s</date>
<company>%s</company>
</header>
''' % (str(rml_obj.formatLang(time.strftime("%Y-%m-%d"),date=True))+' ' + str(time.strftime("%H:%M")),toxml(registry['res.users'].browse(cr,uid,uid).company_id.name))
xml='''<?xml version="1.0" encoding="UTF-8" ?>
<report>
%s
%s
%s
</report>
''' % (header_xml,date_xml, ustr(emp_xml))
return xml
report_custom('report.hr.analytical.timesheet_users', 'hr.employee', '', 'addons/hr_timesheet/report/users_timesheet.xsl')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -1,114 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:import href="custom_default.xsl"/>
<xsl:import href="custom_rml.xsl"/>
<xsl:template match="/">
<xsl:call-template name="rml" />
</xsl:template>
<xsl:template name="stylesheet">
<paraStyle name="normal" fontName="Helvetica" fontSize="6" alignment="center" />
<paraStyle name="normal-title" fontName="Helvetica" fontSize="6" />
<paraStyle name="title" fontName="Helvetica" fontSize="18" alignment="center" />
<paraStyle name="employee" fontName="Helvetica-Oblique" fontSize="10" textColor="blue" />
<paraStyle name="glande" textColor="red" fontSize="7" fontName="Helvetica"/>
<paraStyle name="normal_people" textColor="green" fontSize="7" fontName="Helvetica"/>
<paraStyle name="esclave" textColor="purple" fontSize="7" fontName="Helvetica"/>
<blockTableStyle id="month">
<blockAlignment value="CENTER" start="1,0" stop="-1,-1" />
<blockFont name="Helvetica" size="8" start="0,0" stop="-1,1"/>
<blockFont name="Helvetica" size="6" start="0,2" stop="-2,-2"/>
<blockFont name="Helvetica-BoldOblique" size="8" start="0,-1" stop="-1,-1"/>
<blockBackground colorName="#AAAAAA" start="1,0" stop="-2,1"/>
<xsl:for-each select="/report/days/day[@weekday=6 or @weekday=7]">
<xsl:variable name="col" select="attribute::number" />
<blockBackground>
<xsl:attribute name="colorName">lightgrey</xsl:attribute>
<xsl:attribute name="start">
<xsl:value-of select="$col" />
<xsl:text>,0</xsl:text>
</xsl:attribute>
<xsl:attribute name="stop">
<xsl:value-of select="$col" />
<xsl:text>,-1</xsl:text>
</xsl:attribute>
</blockBackground>
</xsl:for-each>
<lineStyle kind="LINEABOVE" colorName="black" start="0,0" stop="-1,-1" />
<lineStyle kind="LINEBEFORE" colorName="black" start="0,0" stop="-1,-1"/>
<lineStyle kind="LINEAFTER" colorName="black" start="-1,0" stop="-1,-1"/>
<lineStyle kind="LINEBELOW" colorName="black" start="0,-1" stop="-1,-1"/>
<blockValign value="TOP"/>
</blockTableStyle>
</xsl:template>
<xsl:template name="story">
<spacer length="1cm" />
<para style="title" t="1">Employees Timesheet</para>
<spacer length="1.5cm" />
<blockTable>
<xsl:attribute name="style">month</xsl:attribute>
<xsl:attribute name="colWidths"><xsl:value-of select="report/cols" /></xsl:attribute>
<tr>
<td><xsl:value-of select="report/date/attribute::year" /></td>
<xsl:for-each select="report/days/day">
<td>
<xsl:value-of select="attribute::name" />
</td>
</xsl:for-each>
<td></td>
</tr>
<tr>
<td><xsl:value-of select="report/date/attribute::month" /></td>
<xsl:for-each select="report/days/day">
<td>
<xsl:value-of select="attribute::number" />
</td>
</xsl:for-each>
<td t="1">Total</td>
</tr>
<xsl:apply-templates select="report/employee"/>
<xsl:for-each select="report/employee">
<xsl:variable name="id" select="attribute::id"/>
<tr>
<td><xsl:value-of select="attribute::name"/></td>
<xsl:for-each select="//report/days/day">
<xsl:variable name="today" select="attribute::number" />
<td>
<para>
<xsl:choose>
<xsl:when test="sum(//employee[@id=$id]/time-element[@date=$today]) &lt; 7.5">
<xsl:attribute name="style">glande</xsl:attribute>
</xsl:when>
<xsl:when test="sum(//employee[@id=$id]/time-element[@date=$today]) &lt; 8.5 and sum(//time-element[@date=$today]) &gt;= 7.5">
<xsl:attribute name="style">normal_people</xsl:attribute>
</xsl:when>
<xsl:otherwise>
<xsl:attribute name="style">esclave</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
<xsl:value-of select="format-number(sum(//employee[@id=$id]/time-element[@date=$today]), '##.##')" />
</para>
</td>
</xsl:for-each>
<td>
<xsl:value-of select="format-number(sum(//employee[@id=$id]/time-element),'##.##')"/>
</td>
</tr>
</xsl:for-each>
<tr>
<td t="1">Total</td>
<xsl:for-each select="report/days/day">
<xsl:variable name="today" select="attribute::number"/>
<td><xsl:value-of select="format-number(sum(//time-element[@date=$today]),'##.##')"/></td>
</xsl:for-each>
<td><xsl:value-of select="format-number(sum(//time-element),'##.##')"/></td>
</tr>
</blockTable>
</xsl:template>
</xsl:stylesheet>

View File

@ -46,14 +46,12 @@ The validation can be configured in the company:
'author': 'OpenERP SA',
'website': 'http://www.openerp.com',
'images': ['images/hr_my_current_timesheet.jpeg','images/hr_timesheet_analysis.jpeg','images/hr_timesheet_sheet_analysis.jpeg','images/hr_timesheet_activity.jpeg'],
'depends': ['hr_timesheet', 'hr_timesheet_invoice', 'process'],
'depends': ['hr_timesheet', 'hr_timesheet_invoice'],
'data': [
'security/ir.model.access.csv',
'security/hr_timesheet_sheet_security.xml',
'hr_timesheet_sheet_view.xml',
'hr_timesheet_workflow.xml',
'process/hr_timesheet_sheet_process.xml',
'board_hr_timesheet_view.xml',
'report/hr_timesheet_report_view.xml',
'report/timesheet_report_view.xml',
'wizard/hr_timesheet_current_view.xml',

View File

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="view_hr_timesheet_sheet_graph" model="ir.ui.view">
<field name="name">hr.timesheet.sheet.sheet.graph</field>
<field name="model">hr_timesheet_sheet.sheet</field>
<field name="arch" type="xml">
<graph orientation="horizontal" string="Available Attendance" type="bar">
<field name="name"/>
<field name="total_attendance" operator="+"/>
</graph>
</field>
</record>
<record id="action_week_attendance_graph" model="ir.actions.act_window">
<field name="name">My Total Attendances By Week</field>
<field name="res_model">hr_timesheet_sheet.sheet</field>
<field name="view_type">form</field>
<field name="view_mode">graph</field>
<field name="domain">[('user_id','=',uid)]</field>
<field name="view_id" ref="hr_timesheet_sheet.view_hr_timesheet_sheet_graph"/>
</record>
<record id="board_hr_week_attendace_form" model="ir.ui.view">
<field name="name">board.hr.timesheet.sheet.form</field>
<field name="model">board.board</field>
<field name="inherit_id" ref="hr.board_hr_form"/>
<field name="arch" type="xml">
<xpath expr="/form/board/column[2]" position="inside">
<action name="%(action_week_attendance_graph)d" string="My Total Attendance By Week"/>
</xpath>
</field>
</record>
</data>
</openerp>

View File

@ -1,174 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
<!--
Process
-->
<record id="process_process_hrtimesheetprocess0" model="process.process">
<field eval="1" name="active"/>
<field name="model_id" ref="hr_timesheet_sheet.model_hr_timesheet_sheet_sheet"/>
<field eval="&quot;&quot;&quot;Hr Timesheet&quot;&quot;&quot;" name="name"/>
</record>
<!--
Process Node
-->
<record id="process_node_attendance0" model="process.node">
<field name="model_id" ref="hr.model_hr_employee"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Attendance&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Employee's timesheet entry&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_hrtimesheetprocess0"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_timesheet0" model="process.node">
<field name="menu_id" ref="hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form"/>
<field name="model_id" ref="hr_timesheet_sheet.model_hr_timesheet_sheet_sheet"/>
<field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Timesheet&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Information of time spent on a service&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_hrtimesheetprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_drafttimesheetsheet0" model="process.node">
<field name="menu_id" ref="hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form"/>
<field name="model_id" ref="hr_timesheet_sheet.model_hr_timesheet_sheet_sheet"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Draft Timesheet&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;State is 'draft'.&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_hrtimesheetprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_confirmedtimesheet0" model="process.node">
<field name="menu_id" ref="hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form"/>
<field name="model_id" ref="hr_timesheet_sheet.model_hr_timesheet_sheet_sheet"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Confirmed&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;State is 'confirmed'.&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_hrtimesheetprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='confirm'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_validatedtimesheet0" model="process.node">
<field name="menu_id" ref="hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form"/>
<field name="model_id" ref="hr_timesheet_sheet.model_hr_timesheet_sheet_sheet"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Validated&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;State is 'validated'.&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="process_process_hrtimesheetprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='done'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_invoiceonwork0" model="process.node">
<field name="menu_id" ref="account.menu_finance_receivables"/>
<field name="model_id" ref="account.model_account_invoice"/>
<field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Invoice on Work&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Based on the timesheet&quot;&quot;&quot;" name="note"/>
<field name="subflow_id" ref="account.process_process_invoiceprocess0"/>
<field name="process_id" ref="process_process_hrtimesheetprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_workontask0" model="process.node">
<field name="menu_id" ref="hr_timesheet_sheet.menu_act_hr_timesheet_sheet_form"/>
<field name="model_id" ref="hr_timesheet_sheet.model_hr_timesheet_sheet_sheet"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Work on Task&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Defines the work summary of task&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="hr_timesheet_sheet.process_process_hrtimesheetprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('open', pending', 'done', 'cancelled')&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</record>
<!--
Process Transition
-->
<record id="process_transition_attendancetimesheet0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Sign in/out&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The employee signs in and signs out.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_drafttimesheetsheet0"/>
<field name="source_node_id" ref="process_node_attendance0"/>
</record>
<record id="process_transition_timesheetdraft0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Service&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The timesheet line represents the time spent by the employee on a specific service provided.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_drafttimesheetsheet0"/>
<field name="source_node_id" ref="process_node_timesheet0"/>
</record>
<record id="process_transition_confirmtimesheet0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Confirmation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The employee periodically confirms his own timesheets.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_confirmedtimesheet0"/>
<field name="source_node_id" ref="process_node_drafttimesheetsheet0"/>
<field eval="[(6,0,[ref('hr_timesheet_sheet.t1')])]" name="transition_ids"/>
</record>
<record id="process_transition_validatetimesheet0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Validation&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The project manager validates the timesheets.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_validatedtimesheet0"/>
<field name="source_node_id" ref="process_node_confirmedtimesheet0"/>
</record>
<record id="process_transition_invoiceontimesheet0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Billing&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The invoice is created based on the timesheet.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_invoiceonwork0"/>
<field name="source_node_id" ref="process_node_confirmedtimesheet0"/>
</record>
<record id="process_transition_tasktimesheet0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Task timesheet&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Moves task entry into the timesheet line&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_timesheet0"/>
<field name="source_node_id" ref="process_node_workontask0"/>
</record>
<!--
Process Action
-->
<record id="process_transition_action_draftconfirmtimesheet0" model="process.transition.action">
<field eval="&quot;&quot;&quot;button_confirm&quot;&quot;&quot;" name="action"/>
<field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
<field eval="&quot;&quot;&quot;Confirm&quot;&quot;&quot;" name="name"/>
<field name="transition_id" ref="process_transition_confirmtimesheet0"/>
</record>
<record id="process_transition_action_validatetimesheet0" model="process.transition.action">
<field eval="&quot;&quot;&quot;write({'state':'done'})&quot;&quot;&quot;" name="action"/>
<field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
<field eval="&quot;&quot;&quot;Validate&quot;&quot;&quot;" name="name"/>
<field name="transition_id" ref="process_transition_validatetimesheet0"/>
</record>
<record id="process_transition_action_refusetimesheet0" model="process.transition.action">
<field eval="&quot;&quot;&quot;write({'state':'draft'})&quot;&quot;&quot;" name="action"/>
<field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
<field eval="&quot;&quot;&quot;Refuse&quot;&quot;&quot;" name="name"/>
<field name="transition_id" ref="process_transition_validatetimesheet0"/>
</record>
</data>
</openerp>

View File

@ -24,9 +24,6 @@ from openerp.addons.web.controllers.main import manifest_list, module_boot, html
drivers = {}
class Proxy(http.Controller):
def __init__(self):
self.scale = 'closed'
self.scale_weight = 0.0
def get_status(self):
statuses = {}
@ -154,40 +151,6 @@ class Proxy(http.Controller):
"""
print "help_canceled"
@http.route('/hw_proxy/weighting_start', type='json', auth='none', cors='*')
def weighting_start(self):
if self.scale == 'closed':
print "Opening (Fake) Connection to Scale..."
self.scale = 'open'
self.scale_weight = 0.0
time.sleep(0.1)
print "... Scale Open."
else:
print "WARNING: Scale already Connected !!!"
@http.route('/hw_proxy/weighting_read_kg', type='json', auth='none', cors='*')
def weighting_read_kg(self):
if self.scale == 'open':
print "Reading Scale..."
time.sleep(0.025)
self.scale_weight += 0.01
print "... Done."
return self.scale_weight
else:
print "WARNING: Reading closed scale !!!"
return 0.0
@http.route('/hw_proxy/weighting_end', type='json', auth='none', cors='*')
def weighting_end(self):
if self.scale == 'open':
print "Closing Connection to Scale ..."
self.scale = 'closed'
self.scale_weight = 0.0
time.sleep(0.1)
print "... Scale Closed."
else:
print "WARNING: Scale already Closed !!!"
@http.route('/hw_proxy/payment_request', type='json', auth='none', cors='*')
def payment_request(self, price):
"""

View File

@ -19,7 +19,7 @@
#
##############################################################################
import process
import controllers
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -2,7 +2,7 @@
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2010-Today OpenERP S.A. (<http://www.openerp.com>).
# Copyright (C) 2004-2010 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
@ -21,22 +21,25 @@
{
'name': 'Portal Project Long Term',
'name': 'Weighting Scale Hardware Driver',
'version': '1.0',
'category': 'Tools',
'complexity': 'easy',
'category': 'Hardware Drivers',
'sequence': 6,
'summary': 'Hardware Driver for Weighting Scales',
'description': """
This module adds necessary security rules and access rights for project long term and portal.
=============================================================================================
""",
Barcode Scanner Hardware Driver
================================
This module allows the point of sale to connect to a scale using a USB HSM Serial Scale Interface,
such as the Mettler Toledo Ariva.
""",
'author': 'OpenERP SA',
'depends': ['project_long_term', 'portal'],
'data': [
'security/portal_security.xml',
'security/ir.model.access.csv',
'depends': ['hw_proxy'],
'test': [
],
'installable': True,
'auto_install': True,
'category': 'Hidden',
'auto_install': False,
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,3 @@
import main
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

View File

@ -0,0 +1,205 @@
# -*- coding: utf-8 -*-
import logging
import os
import time
from os import listdir
from os.path import join
from threading import Thread, Lock
from select import select
from Queue import Queue, Empty
import openerp
import openerp.addons.hw_proxy.controllers.main as hw_proxy
from openerp import http
from openerp.http import request
from openerp.tools.translate import _
_logger = logging.getLogger(__name__)
try:
import serial
except ImportError:
_logger.error('OpenERP module hw_scale depends on the pyserial python module')
serial = None
class Scale(Thread):
def __init__(self):
Thread.__init__(self)
self.lock = Lock()
self.scalelock = Lock()
self.status = {'status':'connecting', 'messages':[]}
self.input_dir = '/dev/serial/by-id/'
self.weight = 0
self.weight_info = 'ok'
self.device = None
def lockedstart(self):
with self.lock:
if not self.isAlive():
self.daemon = True
self.start()
def set_status(self, status, message = None):
if status == self.status['status']:
if message != None and message != self.status['messages'][-1]:
self.status['messages'].append(message)
else:
self.status['status'] = status
if message:
self.status['messages'] = [message]
else:
self.status['messages'] = []
if status == 'error' and message:
_logger.error('Scale Error: '+message)
elif status == 'disconnected' and message:
_logger.warning('Disconnected Scale: '+message)
def get_device(self):
try:
devices = [ device for device in listdir(self.input_dir)]
scales = [ device for device in devices if ('mettler' in device.lower()) or ('toledo' in device.lower()) ]
if len(scales) > 0:
print join(self.input_dir,scales[0])
self.set_status('connected','Connected to '+scales[0])
return serial.Serial(join(self.input_dir,scales[0]),
baudrate = 9600,
bytesize = serial.SEVENBITS,
stopbits = serial.STOPBITS_ONE,
parity = serial.PARITY_EVEN,
#xonxoff = serial.XON,
timeout = 0.01,
writeTimeout= 0.01)
else:
self.set_status('disconnected','Scale Not Found')
return None
except Exception as e:
self.set_status('error',str(e))
return None
def get_weight(self):
self.lockedstart()
return self.weight
def get_weight_info(self):
self.lockedstart()
return self.weight_info
def get_status(self):
self.lockedstart()
return self.status
def read_weight(self):
with self.scalelock:
if self.device:
try:
self.device.write('W')
time.sleep(0.1)
answer = []
while True:
char = self.device.read(1)
if not char:
break
else:
answer.append(char)
if '?' in answer:
stat = ord(answer[answer.index('?')+1])
if stat == 0:
self.weight_info = 'ok'
else:
self.weight_info = []
if stat & 1 :
self.weight_info.append('moving')
if stat & 1 << 1:
self.weight_info.append('over_capacity')
if stat & 1 << 2:
self.weight_info.append('negative')
self.weight = 0.0
if stat & 1 << 3:
self.weight_info.append('outside_zero_capture_range')
if stat & 1 << 4:
self.weight_info.append('center_of_zero')
if stat & 1 << 5:
self.weight_info.append('net_weight')
else:
answer = answer[1:-1]
if 'N' in answer:
answer = answer[0:-1]
try:
self.weight = float(''.join(answer))
except ValueError as v:
self.set_status('error','No data Received, please power-cycle the scale');
self.device = None
except Exception as e:
self.set_status('error',str(e))
self.device = None
def set_zero(self):
with self.scalelock:
if self.device:
try:
self.device.write('Z')
except Exception as e:
self.set_status('error',str(e))
self.device = None
def set_tare(self):
with self.scalelock:
if self.device:
try:
self.device.write('T')
except Exception as e:
self.set_status('error',str(e))
self.device = None
def clear_tare(self):
with self.scalelock:
if self.device:
try:
self.device.write('C')
except Exception as e:
self.set_status('error',str(e))
self.device = None
def run(self):
self.device = None
while True:
if self.device:
self.read_weight()
time.sleep(0.05)
else:
with self.scalelock:
self.device = self.get_device()
if not self.device:
time.sleep(5)
s = Scale()
hw_proxy.drivers['scale'] = s
class ScaleDriver(hw_proxy.Proxy):
@http.route('/hw_proxy/scale_read/', type='json', auth='none', cors='*')
def scale_read(self):
return {'weight':s.get_weight(), 'unit':'kg', 'info':s.get_weight_info()}
@http.route('/hw_proxy/scale_zero/', type='json', auth='none', cors='*')
def scale_zero(self):
s.set_zero()
return True
@http.route('/hw_proxy/scale_tare/', type='json', auth='none', cors='*')
def scale_tare(self):
s.set_tare()
return True
@http.route('/hw_proxy/scale_clear_tare/', type='json', auth='none', cors='*')
def scale_clear_tare(self):
s.clear_tare()
return True

View File

@ -259,7 +259,7 @@
<!-- Short thread: Admin ask, Agrolait answer [DEMO: mark thread as done] -->
<record id="msg_discus1" model="mail.message">
<field name="subject">Feedback about our On Site Assistance</field>
<field name="body"><![CDATA[<p>Hi Virginie,</p><p>I writing to you about our <i>On Site Assistance Service</i> that we delivered to Agrolait last week. Do you have any feedback or remark about our service? I noticed you requested new IP phones. Will it be used for new employees, or did you have any issue with the ones we provided?<br />Best regards,</p>]]></field>
<field name="body"><![CDATA[<p>Hi Virginie,</p><p>I wrote to you about our <i>On Site Assistance Service</i> that we delivered to Agrolait last week. Do you have any feedback or remark about our service? I noticed you requested new IP phones. Will it be used for new employees, or did you have any issue with the ones we provided?<br />Best regards,</p>]]></field>
<field name="type">comment</field>
<field name="subtype_id" ref="mt_comment"/>
<field name="author_id" ref="base.partner_root"/>

View File

@ -109,8 +109,7 @@ class mail_notification(osv.Model):
Administrator
</p>
<div>
<small>Sent by <a ...>Your Company</a> using <a ...>OpenERP</a>.</small> OR
<small>Sent by Administrator using <a ...>OpenERP</a>.</small>
<small>Sent from <a ...>Your Company</a> using <a ...>OpenERP</a>.</small>
</div>
"""
footer = ""
@ -132,7 +131,7 @@ class mail_notification(osv.Model):
company = "<a style='color:inherit' href='%s'>%s</a>" % (website_url, user.company_id.name)
else:
company = user.company_id.name
sent_by = _('Sent by %(company)s using %(openerp)s.')
sent_by = _('Sent from %(company)s using %(openerp)s')
signature_company = '<small>%s</small>' % (sent_by % {
'company': company,
'openerp': "<a style='color:inherit' href='https://www.openerp.com/'>OpenERP</a>"

View File

@ -147,6 +147,8 @@ class mail_mail(osv.Model):
def _get_partner_access_link(self, cr, uid, mail, partner=None, context=None):
"""Generate URLs for links in mails: partner has access (is user):
link to action_mail_redirect action that will redirect to doc or Inbox """
if context is None:
context = {}
if partner and partner.user_ids:
base_url = self.pool.get('ir.config_parameter').get_param(cr, uid, 'web.base.url')
# the parameters to encode for the query and fragment part of url
@ -161,7 +163,7 @@ class mail_mail(osv.Model):
fragment.update(model=mail.model, res_id=mail.res_id)
url = urljoin(base_url, "/web?%s#%s" % (urlencode(query), urlencode(fragment)))
return _("""<span class='oe_mail_footer_access'><small>Access your messages and documents <a style='color:inherit' href="%s">in OpenERP</a></small></span>""") % url
return _("""<span class='oe_mail_footer_access'><small>about <a style='color:inherit' href="%s">%s %s</a></small></span>""") % (url, context.get('model_name', ''), mail.record_name)
else:
return None
@ -233,10 +235,19 @@ class mail_mail(osv.Model):
email sending process has failed
:return: True
"""
if context is None:
context = {}
ir_mail_server = self.pool.get('ir.mail_server')
for mail in self.browse(cr, SUPERUSER_ID, ids, context=context):
try:
# TDE note: remove me when model_id field is present on mail.message - done here to avoid doing it multiple times in the sub method
if mail.model:
model_id = self.pool['ir.model'].search(cr, SUPERUSER_ID, [('model', '=', mail.model)], context=context)[0]
model = self.pool['ir.model'].browse(cr, SUPERUSER_ID, model_id, context=context)
else:
model = None
if model:
context['model_name'] = model.name
# handle attachments
attachments = []
for attach in mail.attachment_ids:

View File

@ -39,13 +39,12 @@ It is integrated with sales and accounting to allow you to automatically
invoice and send propositions for membership renewal.
""",
'author': 'OpenERP SA',
'depends': ['base', 'product', 'account', 'process'],
'depends': ['base', 'product', 'account'],
'data': [
'security/ir.model.access.csv',
'wizard/membership_invoice_view.xml',
'membership_view.xml',
'report/report_membership_view.xml',
'process/membership_process.xml',
],
'demo': [
'membership_demo.xml',

View File

@ -1,134 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
<!--
Process
-->
<record id="process_process_membershipprocess0" model="process.process">
<field eval="&quot;&quot;&quot;Membership Process&quot;&quot;&quot;" name="name"/>
<field name="model_id" ref="base.model_res_partner"/>
<field eval="1" name="active"/>
</record>
<!--
Process Node
-->
<record id="process_node_membershipproduct0" model="process.node">
<field name="menu_id" ref="membership.menu_membership_products"/>
<field name="model_id" ref="product.model_product_product"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Define membership product.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Membership product&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_membershipprocess0"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_waitingmember0" model="process.node">
<field name="menu_id" ref="account.menu_action_invoice_tree1"/>
<field name="model_id" ref="account.model_account_invoice"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Draft invoice for membership.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Waiting member&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_membershipprocess0"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_invoicedmember0" model="process.node">
<field name="menu_id" ref="account.menu_action_invoice_tree1"/>
<field name="model_id" ref="account.model_account_invoice"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Open invoice.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Invoiced member&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_membershipprocess0"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_paidmember0" model="process.node">
<field name="menu_id" ref="account.menu_action_invoice_tree1"/>
<field name="model_id" ref="account.model_account_invoice"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Membership invoice paid.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Paid member&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_membershipprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='paid'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_setassociation0" model="process.node">
<field name="menu_id" ref="membership.menu_members"/>
<field name="model_id" ref="base.model_res_partner"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Set an associate member of partner.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Set association&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_membershipprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='paid'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_associatedmember0" model="process.node">
<field name="menu_id" ref="membership.menu_members"/>
<field name="model_id" ref="base.model_res_partner"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Member is associated.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Associated member&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_membershipprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='associated'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<!--
Process Transition
-->
<record id="process_transition_producttomember0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Product to member&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Define product for membership.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_waitingmember0"/>
<field name="source_node_id" ref="process_node_membershipproduct0"/>
</record>
<record id="process_transition_waitingtoinvoice0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Waiting to invoice&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Draft invoice is now open.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_invoicedmember0"/>
<field name="source_node_id" ref="process_node_waitingmember0"/>
</record>
<record id="process_transition_action_create0" model="process.transition.action">
<field eval="&quot;&quot;&quot;invoice_open&quot;&quot;&quot;" name="action"/>
<field eval="&quot;&quot;&quot;object&quot;&quot;&quot;" name="state"/>
<field eval="&quot;&quot;&quot;Create&quot;&quot;&quot;" name="name"/>
<field name="transition_id" ref="process_transition_waitingtoinvoice0"/>
</record>
<record id="process_transition_invoicetopaid0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Invoice to paid&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Invoice is be paid.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_paidmember0"/>
<field name="source_node_id" ref="process_node_invoicedmember0"/>
</record>
<record id="process_transition_invoicetoassociate0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;invoice to associate&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Invoiced member may be Associated member.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_associatedmember0"/>
<field name="source_node_id" ref="process_node_invoicedmember0"/>
</record>
<record id="process_transition_associationpartner0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Association Partner&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Associated partner.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_associatedmember0"/>
<field name="source_node_id" ref="process_node_setassociation0"/>
</record>
</data>
</openerp>

View File

@ -49,17 +49,11 @@
<field name="name">Members Analysis</field>
<field name="res_model">report.membership</field>
<field name="view_type">form</field>
<field name="view_mode">graph</field>
<field name="search_view_id" ref="view_report_membership_search"/>
<field name="context">{"search_default_year":1,"search_default_member":1, 'search_default_Revenue':1, 'search_default_this_month':1, 'search_default_salesman':1,'group_by_no_leaf':1}</field>
</record>
<record model="ir.actions.act_window.view" id="action_report_membership_tree_view2">
<field name="sequence" eval="3"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="view_report_membership_graph1"/>
<field name="act_window_id" ref="action_report_membership_tree"/>
</record>
<menuitem name="Members Analysis" parent="base.menu_report_association"
action="action_report_membership_tree"
id="menu_report_membership"

View File

@ -28,8 +28,8 @@
'category': 'Manufacturing',
'sequence': 18,
'summary': 'Manufacturing Orders, Bill of Materials, Routing',
'images': ['images/bill_of_materials.jpeg', 'images/manufacturing_order.jpeg', 'images/planning_manufacturing_order.jpeg', 'images/manufacturing_analysis.jpeg', 'images/production_dashboard.jpeg','images/routings.jpeg','images/work_centers.jpeg'],
'depends': ['product','procurement', 'stock', 'resource', 'purchase','process', 'report'],
'images': ['images/bill_of_materials.jpeg', 'images/manufacturing_order.jpeg', 'images/planning_manufacturing_order.jpeg', 'images/manufacturing_analysis.jpeg','images/routings.jpeg','images/work_centers.jpeg'],
'depends': ['product','procurement', 'stock', 'resource', 'purchase', 'report'],
'description': """
Manage the Manufacturing process in OpenERP
===========================================
@ -65,11 +65,7 @@ Dashboard / Reports for MRP will include:
'mrp_view.xml',
'mrp_report.xml',
'company_view.xml',
'process/stockable_product_process.xml',
'process/service_product_process.xml',
'process/procurement_process.xml',
'report/mrp_report_view.xml',
'board_manufacturing_view.xml',
'res_config_view.xml',
'views/report_mrporder.xml',

View File

@ -1,37 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="board_mrp_manager_form" model="ir.ui.view">
<field name="name">board.mrp.manager.form</field>
<field name="model">board.board</field>
<field name="arch" type="xml">
<form string="Manufacturing board" version="7.0">
<board style="2-1">
<column>
<action name="%(procurement.procurement_exceptions)d" string="Procurements in Exception" domain="[('state','=','exception')]"/>
</column>
<column>
<action name="%(mrp.action_report_in_out_picking_tree)d" string="Stock Value Variation"/>
</column>
</board>
</form>
</field>
</record>
<record id="open_board_manufacturing" model="ir.actions.act_window">
<field name="name">Manufacturing</field>
<field name="res_model">board.board</field>
<field name="view_type">form</field>
<field name="view_mode">form</field>
<field name="view_id" ref="board_mrp_manager_form"/>
</record>
<menuitem action="open_board_manufacturing"
icon="terp-graph"
id="menu_board_manufacturing"
parent="base.menu_reporting_dashboard"
sequence="30"
groups="group_mrp_manager"/>
</data>
</openerp>

View File

@ -1,227 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
<record id="process_node_productionorder0" model="process.node">
<field name="menu_id" ref="mrp.menu_mrp_production_action"/>
<field name="model_id" ref="mrp.model_mrp_production"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Drives the procurement orders for raw material.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Production Order&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="procurement.process_process_procurementprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('draft', 'picking_except', 'confirmed', 'ready', 'in_production', 'cancel', 'done')&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_minimumstockrule0" model="process.node">
<field name="menu_id" ref="procurement.menu_stock_order_points"/>
<field name="model_id" ref="procurement.model_stock_warehouse_orderpoint"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Linked to the 'Minimum stock rule' supplying method.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Minimum Stock&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="procurement.process_process_procurementprocess0"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_stockproduct0" model="process.node">
<field name="menu_id" ref="procurement.menu_stock_procurement_action"/>
<field name="model_id" ref="mrp.model_procurement_order"/>
<field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Product type is Stockable or Consumable.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Stockable Product&quot;&quot;&quot;" name="name"/>
<field name="subflow_id" ref="process_process_stockableproductprocess0"/>
<field name="process_id" ref="procurement.process_process_procurementprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('draft', 'confirmed', 'cancel', 'exception', 'running', 'done', 'waiting')&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_stockproduct1" model="process.node">
<field name="menu_id" ref="procurement.menu_stock_procurement_action"/>
<field name="model_id" ref="mrp.model_procurement_order"/>
<field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;For stockable products and consumables&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Stockable Product&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="mrp.process_process_stockableproductprocess0"/>
<field name="subflow_id" ref="procurement.process_process_procurementprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('draft', 'confirmed', 'cancel', 'exception', 'running', 'done', 'waiting')&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_serviceproduct0" model="process.node">
<field name="menu_id" ref="procurement.menu_stock_procurement_action"/>
<field name="model_id" ref="mrp.model_procurement_order"/>
<field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Product type is service&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Service&quot;&quot;&quot;" name="name"/>
<field name="subflow_id" ref="procurement.process_process_serviceproductprocess0"/>
<field name="process_id" ref="procurement.process_process_procurementprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('draft', 'confirmed', 'cancel', 'exception', 'running', 'done', 'waiting')&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_serviceproduct1" model="process.node">
<field name="menu_id" ref="procurement.menu_stock_procurement_action"/>
<field name="model_id" ref="mrp.model_procurement_order"/>
<field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;For Services.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Service&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="procurement.process_process_serviceproductprocess0"/>
<field name="subflow_id" ref="procurement.process_process_procurementprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('draft', 'confirmed', 'cancel', 'exception', 'running', 'done', 'waiting')&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_purchaseprocure0" model="process.node">
<field name="menu_id" ref="procurement.menu_stock_procurement_action"/>
<field name="model_id" ref="mrp.model_procurement_order"/>
<field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Procurement Orders&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;For purchased material&quot;&quot;&quot;" name="note"/>
<field name="subflow_id" ref="procurement.process_process_procurementprocess0"/>
<field name="process_id" ref="purchase.process_process_purchaseprocess0"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_productminimumstockrule0" model="process.node">
<field name="menu_id" ref="procurement.menu_stock_order_points"/>
<field name="model_id" ref="procurement.model_stock_warehouse_orderpoint"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Minimum Stock&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Automatic procurement rule&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="product.process_process_productprocess0"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_routing0" model="process.node">
<field name="menu_id" ref="mrp.menu_mrp_routing_action"/>
<field name="model_id" ref="mrp.model_mrp_routing"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Routing&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Manufacturing Steps.&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="product.process_process_productprocess0"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_billofmaterial0" model="process.node">
<field name="menu_id" ref="mrp.menu_mrp_bom_form_action"/>
<field name="model_id" ref="mrp.model_mrp_bom"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Bill of Material&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Product's structure&quot;&quot;&quot;" name="note"/>
<field name="process_id" ref="product.process_process_productprocess0"/>
<field eval="0" name="flow_start"/>
</record>
<!--
Process Transition
-->
<record id="process_node_procureproducts0" model="process.node">
<field name="menu_id" ref="procurement.menu_stock_procurement_action"/>
<field name="model_id" ref="mrp.model_procurement_order"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;The way to procurement depends on the product type.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Procure Products&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="procurement.process_process_procurementprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('draft', 'confirmed', 'cancel', 'exception', 'running', 'done', 'waiting')&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_transition_servicemto0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Make to Order&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;If the service has a 'Produce' supply method, this creates a task in the project management module of OpenERP.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="procurement.process_node_serviceonorder0"/>
<field name="source_node_id" ref="process_node_serviceproduct1"/>
</record>
<record id="process_transition_servicemts0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Make to Stock&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;This is used in case of a service without any impact in the system, a training session for instance.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="mrp.process_node_servicemts0"/>
<field name="source_node_id" ref="process_node_serviceproduct1"/>
</record>
<record id="process_transition_stockmts0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Make to Stock&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The system waits for the products to be available in the stock. These products are typically procured manually or through a minimum stock rule.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="mrp.process_node_mts0"/>
<field name="source_node_id" ref="process_node_stockproduct1"/>
</record>
<record id="process_transition_stockproduct0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Make to Order&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The system creates an order (production or purchased) depending on the sold quantity and the products parameters.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="mrp.process_node_stock0"/>
<field name="source_node_id" ref="process_node_stockproduct1"/>
</record>
<record id="process_transition_productionprocureproducts0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Procurement of raw material&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;In order to supply raw material (to be purchased or produced), the production order creates as much procurement orders as components listed in the BOM, through a run of the schedulers (MRP).&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_procureproducts0"/>
<field name="source_node_id" ref="process_node_productionorder0"/>
</record>
<record id="process_transition_minimumstockprocure0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;'Minimum stock rule' material&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The 'Minimum stock rule' allows the system to create procurement orders automatically as soon as the minimum stock is reached.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_procureproducts0"/>
<field name="source_node_id" ref="process_node_minimumstockrule0"/>
</record>
<record id="process_transition_procurestockableproduct0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Procurement of stockable Products&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Depending on the chosen method to supply the stockable products, the procurement order creates a RFQ, a production order, ... &quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_stockproduct0"/>
<field name="source_node_id" ref="process_node_procureproducts0"/>
</record>
<record id="process_transition_procureserviceproduct0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Procurement of services&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;Depending on the chosen method to 'supply' the service, the procurement order creates a RFQ for a subcontracting purchase order or waits until the service is done (= the delivery of the products).&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_serviceproduct0"/>
<field name="source_node_id" ref="process_node_procureproducts0"/>
</record>
<record id="process_transition_purchaseprocure0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Automatic RFQ&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The system launches automatically a RFQ to the preferred supplier.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="purchase.process_node_draftpurchaseorder0"/>
<field name="source_node_id" ref="process_node_purchaseprocure0"/>
</record>
<record id="process_transition_producttostockrules0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Procurement rule&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The Minimum Stock Rule is an automatic procurement rule based on a mini and maxi quantity. It's available in the Inventory management menu and configured by product.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_productminimumstockrule0"/>
<field name="source_node_id" ref="product.process_node_product0"/>
</record>
<record id="process_transition_billofmaterialrouting0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Material Routing&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The Bill of Material is linked to a routing, i.e. the succession of work centers.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_routing0"/>
<field name="source_node_id" ref="process_node_billofmaterial0"/>
</record>
<record id="process_transition_bom0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Manufacturing decomposition&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The Bill of Material is the product's decomposition. The components (that are products themselves) can also have their own Bill of Material (multi-level).&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_billofmaterial0"/>
<field name="source_node_id" ref="product.process_node_product0"/>
</record>
</data>
</openerp>

View File

@ -1,47 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
<!--
Process Node
-->
<record id="process_node_servicemts0" model="process.node">
<field name="menu_id" ref="procurement.menu_stock_procurement_action"/>
<field name="model_id" ref="mrp.model_procurement_order"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Assignment from stock.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Make to stock&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="procurement.process_process_serviceproductprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('draft', 'confirmed', 'cancel', 'exception', 'running', 'done', 'waiting')&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_orderrfq0" model="process.node">
<field name="menu_id" ref="purchase.menu_purchase_form_action"/>
<field name="model_id" ref="purchase.model_purchase_order"/>
<field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Request for Quotation.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;RFQ&quot;&quot;&quot;" name="name"/>
<field name="subflow_id" ref="purchase.process_process_purchaseprocess0"/>
<field name="process_id" ref="procurement.process_process_serviceproductprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<!--
Process Transition
-->
<record id="process_transition_servicerfq0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;To Buy&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;If the service has a 'Buy' supply method, this creates a RFQ, a subcontracting demand for instance.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_orderrfq0"/>
<field name="source_node_id" ref="procurement.process_node_serviceonorder0"/>
</record>
</data>
</openerp>

View File

@ -1,85 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
<!--
Process
-->
<record id="process_process_stockableproductprocess0" model="process.process">
<field eval="&quot;&quot;&quot;Stockable Product&quot;&quot;&quot;" name="name"/>
<field name="model_id" ref="mrp.model_procurement_order"/>
<field eval="1" name="active"/>
</record>
<!--
Process Node
-->
<record id="process_node_mts0" model="process.node">
<field name="menu_id" ref="procurement.menu_stock_procurement_action"/>
<field name="model_id" ref="mrp.model_procurement_order"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Assignment from stock.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Make to Stock&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_stockableproductprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('draft', 'confirmed', 'cancel', 'exception', 'running', 'done', 'waiting')&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_stock0" model="process.node">
<field name="menu_id" ref="procurement.menu_stock_procurement_action"/>
<field name="model_id" ref="mrp.model_procurement_order"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Assignment from Production or Purchase Order.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Make to Order&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_stockableproductprocess0"/>
<field eval="&quot;&quot;&quot;object.state in ('draft', 'confirmed', 'cancel', 'exception', 'running', 'done', 'waiting')&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_rfq0" model="process.node">
<field name="menu_id" ref="purchase.menu_purchase_form_action"/>
<field name="model_id" ref="purchase.model_purchase_order"/>
<field eval="&quot;&quot;&quot;subflow&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Request for Quotation.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;RFQ&quot;&quot;&quot;" name="name"/>
<field name="subflow_id" ref="purchase.process_process_purchaseprocess0"/>
<field name="process_id" ref="process_process_stockableproductprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_production0" model="process.node">
<field name="menu_id" ref="mrp.menu_mrp_production_action"/>
<field name="model_id" ref="mrp.model_mrp_production"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Manufacturing Plan.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Production Order&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_stockableproductprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='confirmed'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<!--
Process Transition
-->
<record id="process_transition_stockrfq0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;To Buy&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;In case the Supply method of the product is Buy, the system creates a purchase order.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_rfq0"/>
<field name="source_node_id" ref="process_node_stock0"/>
</record>
<record id="process_transition_stockproduction0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;To Produce&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;In case the Supply method of the product is Produce, the system creates a production order.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_production0"/>
<field name="source_node_id" ref="process_node_stock0"/>
</record>
</data>
</openerp>

View File

@ -44,7 +44,6 @@ access_resource_calendar_attendance_mrp_user,mrp.resource.calendar.attendance.mr
access_resource_calendar_attendance_manager,mrp.resource.calendar.attendance.manager,resource.model_resource_calendar_attendance,mrp.group_mrp_manager,1,1,1,1
access_product_puom_categ,product.uom.categ,product.model_product_uom_categ,mrp.group_mrp_user,1,0,0,0
access_resource_resource,resource.resource,resource.model_resource_resource,mrp.group_mrp_user,1,0,0,0
access_board_board_user,mrp.board.board,board.model_board_board,mrp.group_mrp_user,1,0,0,0
access_account_sequence_fiscalyear_manager,account.sequence.fiscalyear,account.model_account_sequence_fiscalyear,mrp.group_mrp_manager,1,0,0,0
access_product_supplierinfo_manager,product.supplierinfo user,product.model_product_supplierinfo,mrp.group_mrp_manager,1,0,0,0
access_stock_tracking_manager,stock.tracking,stock.model_stock_tracking,mrp.group_mrp_manager,1,0,0,0

1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
44 access_resource_calendar_attendance_manager mrp.resource.calendar.attendance.manager resource.model_resource_calendar_attendance mrp.group_mrp_manager 1 1 1 1
45 access_product_puom_categ product.uom.categ product.model_product_uom_categ mrp.group_mrp_user 1 0 0 0
46 access_resource_resource resource.resource resource.model_resource_resource mrp.group_mrp_user 1 0 0 0
access_board_board_user mrp.board.board board.model_board_board mrp.group_mrp_user 1 0 0 0
47 access_account_sequence_fiscalyear_manager account.sequence.fiscalyear account.model_account_sequence_fiscalyear mrp.group_mrp_manager 1 0 0 0
48 access_product_supplierinfo_manager product.supplierinfo user product.model_product_supplierinfo mrp.group_mrp_manager 1 0 0 0
49 access_stock_tracking_manager stock.tracking stock.model_stock_tracking mrp.group_mrp_manager 1 0 0 0

View File

@ -63,7 +63,6 @@ So, that we can compare the theoretic delay and real delay.
'mrp_operations_view.xml',
'mrp_operations_report.xml',
'report/mrp_workorder_analysis_view.xml',
'process/mrp_operation_process.xml',
'mrp_operations_workflow_instance.xml'
],
'demo': [

View File

@ -1,107 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data>
<!--
Process
-->
<record id="process_process_mrpoperationprocess0" model="process.process">
<field eval="&quot;&quot;&quot;Mrp Operations&quot;&quot;&quot;" name="name"/>
<field name="model_id" ref="mrp.model_mrp_production_workcenter_line"/>
<field eval="1" name="active"/>
</record>
<!--
Process Node
-->
<record id="process_node_productionorder0" model="process.node">
<field name="menu_id" ref="mrp.menu_mrp_production_action"/>
<field name="model_id" ref="mrp.model_mrp_production"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Information from the production order.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Production Order&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_mrpoperationprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_workorder0" model="process.node">
<field name="model_id" ref="mrp.model_mrp_production_workcenter_line"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Information from the routing definition.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Work Center&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_mrpoperationprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='draft'&quot;&quot;&quot;" name="model_states"/>
<field eval="1" name="flow_start"/>
</record>
<record id="process_node_startoperation0" model="process.node">
<field name="model_id" ref="mrp.model_mrp_production_workcenter_line"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Start the operation.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Start Operation&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_mrpoperationprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='startworking'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_doneoperation0" model="process.node">
<field name="model_id" ref="mrp.model_mrp_production_workcenter_line"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Finish the operation.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Operation Done&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_mrpoperationprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='done'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<record id="process_node_canceloperation0" model="process.node">
<field name="model_id" ref="mrp.model_mrp_production_workcenter_line"/>
<field eval="&quot;&quot;&quot;state&quot;&quot;&quot;" name="kind"/>
<field eval="&quot;&quot;&quot;Cancel the operation.&quot;&quot;&quot;" name="note"/>
<field eval="&quot;&quot;&quot;Operation Cancelled&quot;&quot;&quot;" name="name"/>
<field name="process_id" ref="process_process_mrpoperationprocess0"/>
<field eval="&quot;&quot;&quot;object.state=='cancel'&quot;&quot;&quot;" name="model_states"/>
<field eval="0" name="flow_start"/>
</record>
<!--
Process Transition
-->
<record id="process_transition_productionstart0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Creation of the work order&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;The work orders are created on the basis of the production order.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_startoperation0"/>
<field name="source_node_id" ref="process_node_productionorder0"/>
</record>
<record id="process_transition_workstartoperation0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Details of the work order&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;There is 1 work order per work center. The information about the number of cycles or the cycle time.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_startoperation0"/>
<field name="source_node_id" ref="process_node_workorder0"/>
</record>
<record id="process_transition_startdoneoperation0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Operation done&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;When the operation is finished, the operator updates the system by finishing the work order.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_doneoperation0"/>
<field name="source_node_id" ref="process_node_startoperation0"/>
</record>
<record id="process_transition_startcanceloperation0" model="process.transition">
<field eval="[(6,0,[])]" name="transition_ids"/>
<field eval="&quot;&quot;&quot;Operation cancelled&quot;&quot;&quot;" name="name"/>
<field eval="&quot;&quot;&quot;When the operation needs to be cancelled, you can do it in the work order form.&quot;&quot;&quot;" name="note"/>
<field name="target_node_id" ref="process_node_canceloperation0"/>
<field name="source_node_id" ref="process_node_startoperation0"/>
</record>
</data>
</openerp>

Some files were not shown because too many files have changed in this diff Show More