[CLEAN]: removed commented code, fixed proper indentation in dictionary and removed extra spaces at few places
bzr revid: rvo@tinyerp.co.in-20100813122005-qj1l1iumkfmocyvk
This commit is contained in:
parent
535e21cc06
commit
45a8d54f18
|
@ -36,8 +36,7 @@
|
|||
Credits: Sistheo Zeekom CrysaLEAD
|
||||
""",
|
||||
"depends" : ['base', 'account', 'account_chart', 'account_report', 'base_vat'],
|
||||
"init_xml" : [
|
||||
],
|
||||
"init_xml" : [],
|
||||
"update_xml" : [
|
||||
"report.xml",
|
||||
"pcg.xml",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -35,8 +35,8 @@ class l10n_fr_report(osv.osv):
|
|||
'line_ids': fields.one2many('l10n.fr.line', 'report_id', 'Lines'),
|
||||
}
|
||||
_sql_constraints = [
|
||||
('code_uniq', 'unique (code)','The code report must be unique !')
|
||||
]
|
||||
('code_uniq', 'unique (code)','The code report must be unique !')
|
||||
]
|
||||
l10n_fr_report()
|
||||
|
||||
class l10n_fr_line(osv.osv):
|
||||
|
@ -49,7 +49,7 @@ class l10n_fr_line(osv.osv):
|
|||
'report_id': fields.many2one('l10n.fr.report', 'Report'),
|
||||
}
|
||||
_sql_constraints = [
|
||||
('code_uniq', 'unique (code)', 'The variable name must be unique !')
|
||||
('code_uniq', 'unique (code)', 'The variable name must be unique !')
|
||||
]
|
||||
l10n_fr_line()
|
||||
|
||||
|
|
|
@ -1,8 +1,5 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!-- <menuitem name="Compte de resultat" parent="l10n_fr.menu_l10n_fr_report_doc" id="menu_action_cdr" action="wizard_l10n_fr_pcg_cdr_report" type="wizard" />-->
|
||||
<!---->
|
||||
<!-- <menuitem name="Bilan" id="menu_action_bilan" parent="l10n_fr.menu_l10n_fr_report_doc" action="wizard_l10n_fr_pcg_bilan_report" type="wizard" />-->
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
<record id="account_type_dettes" model="account.account.type">
|
||||
<field name="name">Dettes long terme</field>
|
||||
<field name="code">dettes</field>
|
||||
<!-- <field name="report_type">?</field> -->
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
|
||||
|
@ -35,7 +34,6 @@
|
|||
<record id="account_type_cloture" model="account.account.type">
|
||||
<field name="name">Cloture</field>
|
||||
<field name="code">cloture</field>
|
||||
<!-- <field name="report_type">?</field> -->
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
|
||||
|
@ -76,7 +74,6 @@
|
|||
<record model="account.account.type" id="account_type_tax">
|
||||
<field name="name">Tax</field>
|
||||
<field name="code">tax</field>
|
||||
<!-- <field name="report_type">?</field> -->
|
||||
<field name="close_method">unreconciled</field>
|
||||
</record>
|
||||
|
||||
|
@ -104,14 +101,12 @@
|
|||
<record model="account.account.type" id="account_type_provision">
|
||||
<field name="name">Provisions</field>
|
||||
<field name="code">provision</field>
|
||||
<!-- <field name="report_type">?</field> -->
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
|
||||
<record model="account.account.type" id="account_type_commitment">
|
||||
<field name="name">Engagements</field>
|
||||
<field name="code">commitment</field>
|
||||
<!-- <field name="report_type">?</field> -->
|
||||
<field name="close_method">balance</field>
|
||||
</record>
|
||||
|
||||
|
@ -125,7 +120,6 @@
|
|||
<record model="account.account.type" id="account_type_special">
|
||||
<field name="name">Comptes spéciaux</field>
|
||||
<field name="code">special</field>
|
||||
<!-- <field name="report_type">?</field> -->
|
||||
<field name="close_method">none</field>
|
||||
</record>
|
||||
|
||||
|
@ -9255,49 +9249,5 @@
|
|||
<field name="parent_id" ref="pcg_89"/>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- <record model="ir.property" id="account.property_account_receivable">
|
||||
<field name="value" eval="'account.account,'+str(ref('account.a_recv'))"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.property" id="account.property_account_payable">
|
||||
<field name="value" eval="'account.account,'+str(ref('account.a_pay'))"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.property" id="account.property_account_expense_categ">
|
||||
<field name="value" eval="'account.account,'+str(ref('account.a_expense'))"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.property" id="account.property_account_income_categ">
|
||||
<field name="value" eval="'account.account,'+str(ref('account.a_sale'))"/>
|
||||
</record>
|
||||
|
||||
<record model="account.journal" id="l10n_fr.opening_journal">
|
||||
<field name="default_debit_account_id" ref="pcg_890"/>
|
||||
<field name="default_credit_account_id" ref="pcg_890"/>
|
||||
</record>
|
||||
|
||||
<record model="account.journal" id="l10n_fr.closing_journal">
|
||||
<field name="default_debit_account_id" ref="pcg_891"/>
|
||||
<field name="default_credit_account_id" ref="pcg_891"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.values" id="l10n_fr.pl_credit">
|
||||
<field name="name">pl_credit</field>
|
||||
<field name="key">default</field>
|
||||
<field name="key2" eval="None"/>
|
||||
<field name="object" eval="False"/>
|
||||
<field name="model">wizard.l10n.fr.fiscalyear.close</field>
|
||||
<field name="value" eval="'I'+str(ref('pcg_120'))+chr(10)+'.'"/>
|
||||
</record>
|
||||
|
||||
<record model="ir.values" id="l10n_fr.pl_debit">
|
||||
<field name="name">pl_debit</field>
|
||||
<field name="key">default</field>
|
||||
<field name="key2" eval="None"/>
|
||||
<field name="object" eval="False"/>
|
||||
<field name="model">wizard.l10n.fr.fiscalyear.close</field>
|
||||
<field name="value" eval="'I'+str(ref('pcg_129'))+chr(10)+'.'"/>
|
||||
</record> -->
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -504,9 +504,6 @@
|
|||
|
||||
<record id="pcg_bpvar10" model="l10n.fr.line">
|
||||
<field name="name">Capitaux propres : Résultat de l'exercice</field>
|
||||
<!--
|
||||
<field name="definition">{'load':['-:120:S','-:129:S'], 'except':[]}</field>
|
||||
-->
|
||||
<field name="definition">{'load':['-:7:S','-:6:S'], 'except':[]}</field>
|
||||
<field name="code">bpvar10</field>
|
||||
<field name="report_id" ref="pcg_bilan"/>
|
||||
|
|
|
@ -32,7 +32,7 @@ from report import report_sxw
|
|||
class base_report(report_sxw.rml_parse):
|
||||
def __init__(self, cr, uid, name, context):
|
||||
super(base_report, self).__init__(cr, uid, name, context=context)
|
||||
self.localcontext.update( {
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'_load': self._load,
|
||||
'_get_variable': self._get_variable,
|
||||
|
@ -62,7 +62,6 @@ class base_report(report_sxw.rml_parse):
|
|||
return self.localcontext[variable]
|
||||
|
||||
def _load_accounts(self,form,code,definition,fiscalyear,period_query_cond):
|
||||
#self.context.copy()
|
||||
accounts={}
|
||||
for x in definition['load']:
|
||||
p=x.split(":")
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<!--
|
||||
<!--
|
||||
#
|
||||
# Indian Accounts tree
|
||||
#
|
||||
|
@ -29,7 +29,7 @@
|
|||
<field name="code">liability</field>
|
||||
<field name="report_type">liability</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.type" id="account_type_root_ind1">
|
||||
<field name="name">View</field>
|
||||
<field name="code">view</field>
|
||||
|
@ -58,17 +58,17 @@
|
|||
<field name="name">Closed</field>
|
||||
<field name="code">closed</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- ## account chart -->
|
||||
|
||||
|
||||
<record model="account.account.template" id="root">
|
||||
<field name="name">Indian Chart of Account</field>
|
||||
<field name="code">0</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_root_ind1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
</record>
|
||||
|
||||
<record model="account.account.template" id="IA_AC0">
|
||||
|
@ -76,131 +76,119 @@
|
|||
<field name="code">IA_AC0</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_root_ind1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="root"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC01">
|
||||
<field name="name">Assets</field>
|
||||
<field name="code">IA_AC01</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_asset_view"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC0"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC011">
|
||||
<field name="name">Current Assets</field>
|
||||
<field name="code">IA_AC011</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_asset1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC01"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC0111">
|
||||
<field name="name">Bank Account</field>
|
||||
<field name="code">IA_AC0111</field>
|
||||
<field name="type">receivable</field>
|
||||
<field name="user_type" ref="account_type_asset1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC011"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC0112">
|
||||
<field name="name">Cash In Hand Account</field>
|
||||
<field name="code">IA_AC0112</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_asset1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC011"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC01121">
|
||||
<field name="name">Cash Account</field>
|
||||
<field name="code">IA_AC01121</field>
|
||||
<field name="type">receivable</field>
|
||||
<field name="user_type" ref="account_type_asset1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC0112"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC0113">
|
||||
<field name="name">Deposit Account</field>
|
||||
<field name="code">IA_AC0113</field>
|
||||
<field name="type">receivable</field>
|
||||
<field name="user_type" ref="account_type_asset1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC011"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC0114">
|
||||
<field name="name">Loan & Advance(Assets) Account</field>
|
||||
<field name="code">IA_AC0114</field>
|
||||
<field name="type">receivable</field>
|
||||
<field name="user_type" ref="account_type_asset1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC011"/>
|
||||
</record>
|
||||
|
||||
<!-- <record model="account.account.template" id="IA_AC0115">-->
|
||||
<!-- <field name="name">Stock In Hand Account</field>-->
|
||||
<!-- <field name="code">IA_AC0115</field>-->
|
||||
<!-- <field name="type">receivable</field>-->
|
||||
<!-- <field name="user_type" ref="account_type_asset1"/>
|
||||
-->
|
||||
<!-- <field name="reconcile" eval="False"/>-->
|
||||
<!-- -->
|
||||
<!-- <field name="parent_id" ref="IA_AC011"/>-->
|
||||
<!-- </record>-->
|
||||
|
||||
<record model="account.account.template" id="IA_AC0116">
|
||||
<field name="name">Total Sundry Debtors Account</field>
|
||||
<field name="code">IA_AC0116</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_asset1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC011"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC01161">
|
||||
<field name="name">Sundry Debtors Account</field>
|
||||
<field name="code">IA_AC01161</field>
|
||||
<field name="type">receivable</field>
|
||||
<field name="user_type" ref="account_type_asset1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC0116"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC012">
|
||||
<field name="name">Fixed Assets</field>
|
||||
<field name="code">IA_AC012</field>
|
||||
<field name="type">receivable</field>
|
||||
<field name="user_type" ref="account_type_asset1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC01"/>
|
||||
</record>
|
||||
|
||||
|
@ -209,9 +197,9 @@
|
|||
<field name="code">IA_AC013</field>
|
||||
<field name="type">receivable</field>
|
||||
<field name="user_type" ref="account_type_asset1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC01"/>
|
||||
</record>
|
||||
|
||||
|
@ -220,54 +208,54 @@
|
|||
<field name="code">IA_AC014</field>
|
||||
<field name="type">receivable</field>
|
||||
<field name="user_type" ref="account_type_asset1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC01"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC02">
|
||||
<field name="name">Liabilities</field>
|
||||
<field name="code">IA_AC02</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_liability_view"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC0"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC021">
|
||||
<field name="name">Current Liabilities</field>
|
||||
<field name="code">IA_AC021</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_liability1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC02"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC0211">
|
||||
<field name="name">Duties & Taxes</field>
|
||||
<field name="code">IA_AC0211</field>
|
||||
<field name="type">payable</field>
|
||||
<field name="user_type" ref="account_type_liability1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC021"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC0212">
|
||||
<field name="name">Provision</field>
|
||||
<field name="code">IA_AC0212</field>
|
||||
<field name="type">payable</field>
|
||||
<field name="user_type" ref="account_type_liability1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC021"/>
|
||||
</record>
|
||||
|
||||
|
@ -276,20 +264,20 @@
|
|||
<field name="code">IA_AC0213</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_liability1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC021"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC02131">
|
||||
<field name="name">Sundry Creditors</field>
|
||||
<field name="code">IA_AC02131</field>
|
||||
<field name="type">payable</field>
|
||||
<field name="user_type" ref="account_type_liability1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC0213"/>
|
||||
</record>
|
||||
|
||||
|
@ -298,154 +286,154 @@
|
|||
<field name="code">IA_AC022</field>
|
||||
<field name="type">payable</field>
|
||||
<field name="user_type" ref="account_type_liability1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC02"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC023">
|
||||
<field name="name">Share Holder/Owner Fund</field>
|
||||
<field name="code">IA_AC023</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_liability1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC02"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC0231">
|
||||
<field name="name">Capital Account</field>
|
||||
<field name="code">IA_AC0231</field>
|
||||
<field name="type">payable</field>
|
||||
<field name="user_type" ref="account_type_liability1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC023"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC0232">
|
||||
<field name="name">Reserve and Surplus Account</field>
|
||||
<field name="code">IA_AC0232</field>
|
||||
<field name="type">payable</field>
|
||||
<field name="user_type" ref="account_type_liability1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC023"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC024">
|
||||
<field name="name">Loan(Liability) Account</field>
|
||||
<field name="code">IA_AC024</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_liability1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC02"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC0241">
|
||||
<field name="name">Bank OD Account</field>
|
||||
<field name="code">IA_AC0241</field>
|
||||
<field name="type">payable</field>
|
||||
<field name="user_type" ref="account_type_liability1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC024"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC0242">
|
||||
<field name="name">Secured Loan Account</field>
|
||||
<field name="code">IA_AC0242</field>
|
||||
<field name="type">payable</field>
|
||||
<field name="user_type" ref="account_type_liability1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC024"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC0243">
|
||||
<field name="name">Unsecured Loan Account</field>
|
||||
<field name="code">IA_AC0243</field>
|
||||
<field name="type">payable</field>
|
||||
<field name="user_type" ref="account_type_liability1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC024"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC025">
|
||||
<field name="name">Suspense Account</field>
|
||||
<field name="code">IA_AC025</field>
|
||||
<field name="type">payable</field>
|
||||
<field name="user_type" ref="account_type_liability1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC02"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC1">
|
||||
<field name="name">Profit And Loss Account</field>
|
||||
<field name="code">IA_AC1</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_root_ind1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="root"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC11">
|
||||
<field name="name">Expense</field>
|
||||
<field name="code">IA_AC11</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_expense_view"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC1"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC111">
|
||||
<field name="name">Direct Expenses</field>
|
||||
<field name="code">IA_AC111</field>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_expense1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC11"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC112">
|
||||
<field name="name">Indirect Expenses</field>
|
||||
<field name="code">IA_AC112</field>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_expense1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC11"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC113">
|
||||
<field name="name">Purchase</field>
|
||||
<field name="code">IA_AC113</field>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_expense1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC11"/>
|
||||
</record>
|
||||
<record model="account.account.template" id="IA_AC114">
|
||||
|
@ -453,54 +441,54 @@
|
|||
<field name="code">IA_AC114</field>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_expense1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC11"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC12">
|
||||
<field name="name">Income</field>
|
||||
<field name="code">IA_AC12</field>
|
||||
<field name="type">view</field>
|
||||
<field name="user_type" ref="account_type_income_view"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC1"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC121">
|
||||
<field name="name">Direct Incomes</field>
|
||||
<field name="code">IA_AC121</field>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_income1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC12"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC122">
|
||||
<field name="name">Indirect Incomes</field>
|
||||
<field name="code">IA_AC122</field>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_income1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC12"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.account.template" id="IA_AC123">
|
||||
<field name="name">Sales Account</field>
|
||||
<field name="code">IA_AC123</field>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_income1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC12"/>
|
||||
</record>
|
||||
<record model="account.account.template" id="IA_AC124">
|
||||
|
@ -508,52 +496,52 @@
|
|||
<field name="code">IA_AC124</field>
|
||||
<field name="type">other</field>
|
||||
<field name="user_type" ref="account_type_income1"/>
|
||||
|
||||
|
||||
<field name="reconcile" eval="False"/>
|
||||
|
||||
|
||||
<field name="parent_id" ref="IA_AC12"/>
|
||||
</record>
|
||||
|
||||
<!-- Tax detail -->
|
||||
|
||||
<!-- Tax detail -->
|
||||
|
||||
<record model="account.tax.code.template" id="vat_code_tax1">
|
||||
<field name="name">Tax</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.tax.code.template" id="vat_code_balance_net">
|
||||
<field name="name">Tax Balance to Pay</field>
|
||||
<field name="parent_id" ref="vat_code_tax1"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.tax.code.template" id="vat_code_due_tva">
|
||||
<field name="name">Tax Due (Tax to pay)</field>
|
||||
<field name="parent_id" ref="vat_code_balance_net"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.tax.code.template" id="vat_code_payable">
|
||||
<field name="name">Tax Payable</field>
|
||||
<field name="parent_id" ref="vat_code_balance_net"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="account.tax.code.template" id="vat_code_base_net">
|
||||
<field name="name">Tax Bases</field>
|
||||
<field name="parent_id" ref="vat_code_tax1"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
<record model="account.tax.code.template" id="vat_code_base_due">
|
||||
<field name="name">Base of Taxed Sales</field>
|
||||
<field name="parent_id" ref="vat_code_base_net"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
<record model="account.tax.code.template" id="vat_code_receivable_net">
|
||||
<field name="name">Base of Taxed Purchases</field>
|
||||
<field name="parent_id" ref="vat_code_base_net"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<record id="opening_journal" model="account.journal">
|
||||
<field name="name">Opening Journal</field>
|
||||
<field name="code">OPJ</field>
|
||||
|
@ -562,14 +550,14 @@
|
|||
<field name="sequence_id" ref="account.sequence_journal"/>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="cose_journal_opening" model="account.analytic.journal">
|
||||
<field name="code">OPJ</field>
|
||||
<field name="name">Opening Journal</field>
|
||||
<field name="type">situation</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Chart template -->
|
||||
<record id="indian_chart_template" model="account.chart.template">
|
||||
<field name="name">India - Chart of Accounts </field>
|
||||
|
@ -581,7 +569,7 @@
|
|||
<field name="property_account_expense_categ" ref="IA_AC112"/>
|
||||
<field name="property_account_income_categ" ref="IA_AC122"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -64,7 +64,7 @@ def extract_keys(lines):
|
|||
keys = []
|
||||
for line in lines:
|
||||
if line.startswith('/V'):
|
||||
pass #print 'value',line
|
||||
pass
|
||||
elif line.startswith('/T'):
|
||||
key = line[7:-2]
|
||||
key = ''.join(key.split('\x00'))
|
||||
|
@ -85,7 +85,6 @@ def write_fields(out, fields):
|
|||
for key in fields:
|
||||
value = fields[key]
|
||||
write_field(out, key, value)
|
||||
# write_field(out, key+"a", value) # pour copie-carbone sur autres pages
|
||||
out.write(TAIL)
|
||||
|
||||
def extract_keys_from_pdf(filename):
|
||||
|
|
|
@ -47,12 +47,9 @@
|
|||
'lunch_view.xml',
|
||||
'lunch_report.xml',
|
||||
'report/report_lunch_order_view.xml',
|
||||
#'process/lunch_process.xml'
|
||||
],
|
||||
"demo_xml": ['lunch_demo.xml',
|
||||
],
|
||||
"test": ['test/test_lunch.yml'
|
||||
],
|
||||
"demo_xml": ['lunch_demo.xml'],
|
||||
"test": ['test/test_lunch.yml'],
|
||||
"installable": True,
|
||||
}
|
||||
|
||||
|
|
|
@ -52,7 +52,7 @@ class lunch_product(osv.osv):
|
|||
|
||||
_defaults = {
|
||||
'active': lambda *a : True,
|
||||
}
|
||||
}
|
||||
|
||||
lunch_product()
|
||||
|
||||
|
@ -82,7 +82,7 @@ class lunch_cashbox(osv.osv):
|
|||
'manager': fields.many2one('res.users', 'Manager'),
|
||||
'name': fields.char('Name', size=30, required=True, unique = True),
|
||||
'sum_remain': fields.function(amount_available, method=True, string='Remained Total'),
|
||||
}
|
||||
}
|
||||
|
||||
lunch_cashbox()
|
||||
|
||||
|
@ -100,10 +100,10 @@ class lunch_cashmove(osv.osv):
|
|||
'box': fields.many2one('lunch.cashbox', 'Box Name', size=30, required=True),
|
||||
'active': fields.boolean('Active'),
|
||||
'create_date': fields.datetime('Created date', readonly=True),
|
||||
}
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'active': lambda *a: True,
|
||||
'active': lambda *a: True,
|
||||
}
|
||||
|
||||
lunch_cashmove()
|
||||
|
@ -215,7 +215,7 @@ class report_lunch_amount(osv.osv):
|
|||
'user_id': fields.many2one('res.users', 'User Name', readonly=True),
|
||||
'amount': fields.float('Amount', readonly=True, digits=(16, 2)),
|
||||
'box': fields.many2one('lunch.cashbox', 'Box Name', size=30, readonly=True),
|
||||
}
|
||||
}
|
||||
|
||||
def init(self, cr):
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -36,8 +36,8 @@ class order(report_sxw.rml_parse):
|
|||
super(order, self).__init__(cr, uid, name, context)
|
||||
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'sum_price': self.sum_price,
|
||||
'time': time,
|
||||
'sum_price': self.sum_price,
|
||||
})
|
||||
|
||||
report_sxw.report_sxw('report.lunch.order', 'lunch.order',
|
||||
|
|
|
@ -37,7 +37,7 @@ class report_lunch_order(osv.osv):
|
|||
'user_id': fields.many2one('res.users', 'User Name'),
|
||||
'box_name': fields.char('Name', size=30),
|
||||
'price_total':fields.float('Total Price', readonly=True),
|
||||
}
|
||||
}
|
||||
_order = 'date desc'
|
||||
def init(self, cr):
|
||||
tools.drop_view_if_exists(cr, 'report_lunch_order')
|
||||
|
|
|
@ -48,12 +48,13 @@ class lunch_cashbox_clean(osv.osv_memory):
|
|||
and box IN %s" , (tuple(data),))
|
||||
|
||||
for (user_id, box_id, amount) in res:
|
||||
cashmove_ref.create(cr, uid, {'name': 'Summary for user' + str(user_id),
|
||||
'amount': amount,
|
||||
'user_cashmove': user_id,
|
||||
'box': box_id,
|
||||
'active': True,
|
||||
})
|
||||
cashmove_ref.create(cr, uid, {
|
||||
'name': 'Summary for user' + str(user_id),
|
||||
'amount': amount,
|
||||
'user_cashmove': user_id,
|
||||
'box': box_id,
|
||||
'active': True,
|
||||
})
|
||||
return {}
|
||||
|
||||
lunch_cashbox_clean()
|
||||
|
|
|
@ -29,8 +29,8 @@ class lunch_order_confirm(osv.osv_memory):
|
|||
_description = "confirm Order"
|
||||
|
||||
_columns = {
|
||||
'confirm_cashbox':fields.many2one('lunch.cashbox', 'Name of box', required=True),
|
||||
}
|
||||
'confirm_cashbox':fields.many2one('lunch.cashbox', 'Name of box', required=True),
|
||||
}
|
||||
|
||||
def confirm(self, cr, uid, ids, context):
|
||||
"""
|
||||
|
|
|
@ -60,10 +60,10 @@ class mailgate_thread(osv.osv):
|
|||
default = {}
|
||||
|
||||
default.update({
|
||||
'message_ids': [],
|
||||
'date_closed': False,
|
||||
'date_open': False
|
||||
})
|
||||
'message_ids': [],
|
||||
'date_closed': False,
|
||||
'date_open': False
|
||||
})
|
||||
return super(mailgate_thread, self).copy(cr, uid, id, default, context=context)
|
||||
|
||||
def message_new(self, cr, uid, msg, context):
|
||||
|
@ -134,7 +134,7 @@ class mailgate_thread(osv.osv):
|
|||
if history:
|
||||
for att in attach:
|
||||
attachments.append(att_obj.create(cr, uid, {'name': att[0], 'datas': base64.encodestring(att[1])}))
|
||||
|
||||
|
||||
for param in (email, email_cc, email_bcc):
|
||||
if isinstance(param, list):
|
||||
param = ", ".join(param)
|
||||
|
@ -163,7 +163,7 @@ class mailgate_thread(osv.osv):
|
|||
mailgate_thread()
|
||||
|
||||
def format_date_tz(date, tz=None):
|
||||
if not date:
|
||||
if not date:
|
||||
return 'n/a'
|
||||
format = tools.DEFAULT_SERVER_DATETIME_FORMAT
|
||||
return tools.server_to_local_timestamp(date, format, format, tz)
|
||||
|
@ -213,7 +213,7 @@ class mailgate_message(osv.osv):
|
|||
'description': fields.text('Description', readonly=True),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner', required=False),
|
||||
'attachment_ids': fields.many2many('ir.attachment', 'message_attachment_rel', 'message_id', 'attachment_id', 'Attachments', readonly=True),
|
||||
'display_text': fields.function(_get_display_text, method=True, type='text', size="512", string='Display Text'),
|
||||
'display_text': fields.function(_get_display_text, method=True, type='text', size="512", string='Display Text'),
|
||||
}
|
||||
|
||||
def init(self, cr):
|
||||
|
@ -246,7 +246,7 @@ class mailgate_tool(osv.osv_memory):
|
|||
@param cr: the current row, from the database cursor,
|
||||
@param uid: the current user’s ID for security checks,
|
||||
@param model: OpenObject Model
|
||||
@param res_ids: Ids of the record of OpenObject model created
|
||||
@param res_ids: Ids of the record of OpenObject model created
|
||||
@param msg: Email details
|
||||
@param attach: Email attachments
|
||||
"""
|
||||
|
@ -256,19 +256,19 @@ class mailgate_tool(osv.osv_memory):
|
|||
msg_pool = self.pool.get('mailgate.message')
|
||||
for res_id in res_ids:
|
||||
msg_data = {
|
||||
'name': msg.get('subject', 'No subject'),
|
||||
'date': msg.get('date'),
|
||||
'description': msg.get('body', msg.get('from')),
|
||||
'history': True,
|
||||
'res_model': model,
|
||||
'email_cc': msg.get('cc'),
|
||||
'email_from': msg.get('from'),
|
||||
'email_to': msg.get('to'),
|
||||
'message_id': msg.get('message-id'),
|
||||
'references': msg.get('references') or msg.get('in-reply-to'),
|
||||
'res_id': res_id,
|
||||
'user_id': uid,
|
||||
'attachment_ids': [(6, 0, attach)]
|
||||
'name': msg.get('subject', 'No subject'),
|
||||
'date': msg.get('date'),
|
||||
'description': msg.get('body', msg.get('from')),
|
||||
'history': True,
|
||||
'res_model': model,
|
||||
'email_cc': msg.get('cc'),
|
||||
'email_from': msg.get('from'),
|
||||
'email_to': msg.get('to'),
|
||||
'message_id': msg.get('message-id'),
|
||||
'references': msg.get('references') or msg.get('in-reply-to'),
|
||||
'res_id': res_id,
|
||||
'user_id': uid,
|
||||
'attachment_ids': [(6, 0, attach)]
|
||||
}
|
||||
msg_pool.create(cr, uid, msg_data, context=context)
|
||||
return True
|
||||
|
|
|
@ -6,4 +6,3 @@
|
|||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
<!--group_marketing_user-->
|
||||
|
|
|
@ -109,7 +109,7 @@ Normal - the campaign runs normally and automatically sends all emails and repor
|
|||
'campaign_id', 'Activities'),
|
||||
'fixed_cost': fields.float('Fixed Cost', help="Fixed cost for the campaign (used for campaign analysis), see also variable cost on activities"),
|
||||
}
|
||||
|
||||
|
||||
_defaults = {
|
||||
'state': lambda *a: 'draft',
|
||||
'mode': lambda *a: 'test',
|
||||
|
@ -349,8 +349,6 @@ class marketing_campaign_activity(osv.osv):
|
|||
'from_ids': fields.one2many('marketing.campaign.transition',
|
||||
'activity_to_id',
|
||||
'Previous Activities'),
|
||||
#'subcampaign_id': fields.many2one('marketing.campaign', 'Sub-Campaign',
|
||||
# domain="[('object_id', '=', object_id)]"),
|
||||
'variable_cost': fields.float('Variable Cost'),
|
||||
'revenue': fields.float('Revenue'),
|
||||
'signal': fields.char('Signal', size=128,
|
||||
|
@ -382,14 +380,14 @@ class marketing_campaign_activity(osv.osv):
|
|||
service = netsvc.LocalService('report.%s'%activity.report_id.report_name)
|
||||
(report_data, format) = service.create(cr, uid, [], {}, {})
|
||||
attach_vals = {
|
||||
'name': '%s_%s_%s'%(activity.report_id.report_name,
|
||||
activity.name,workitem.partner_id.name),
|
||||
'datas_fname': '%s.%s'%(activity.report_id.report_name,
|
||||
activity.report_id.report_type),
|
||||
'parent_id': activity.report_directory_id.id,
|
||||
'datas': base64.encodestring(report_data),
|
||||
'file_type': format
|
||||
}
|
||||
'name': '%s_%s_%s'%(activity.report_id.report_name,
|
||||
activity.name,workitem.partner_id.name),
|
||||
'datas_fname': '%s.%s'%(activity.report_id.report_name,
|
||||
activity.report_id.report_type),
|
||||
'parent_id': activity.report_directory_id.id,
|
||||
'datas': base64.encodestring(report_data),
|
||||
'file_type': format
|
||||
}
|
||||
self.pool.get('ir.attachment').create(cr, uid, attach_vals)
|
||||
return True
|
||||
|
||||
|
@ -430,9 +428,10 @@ class marketing_campaign_transition(osv.osv):
|
|||
_name = "marketing.campaign.transition"
|
||||
_description = "Campaign Transition"
|
||||
|
||||
_interval_units = [('hours', 'Hour(s)'), ('days', 'Day(s)'),
|
||||
('months', 'Month(s)'), ('years','Year(s)')]
|
||||
|
||||
_interval_units = [
|
||||
('hours', 'Hour(s)'), ('days', 'Day(s)'),
|
||||
('months', 'Month(s)'), ('years','Year(s)')
|
||||
]
|
||||
|
||||
def _get_name(self, cr, uid, ids, fn, args, context=None):
|
||||
result = dict.fromkeys(ids, False)
|
||||
|
@ -597,7 +596,7 @@ class marketing_campaign_workitem(osv.osv):
|
|||
}
|
||||
wi_id = self.create(cr, uid, values, context=context)
|
||||
|
||||
# Now, depending of the trigger and the campaign mode
|
||||
# Now, depending of the trigger and the campaign mode
|
||||
# we know if must run the newly created workitem.
|
||||
#
|
||||
# rows = transition trigger \ colums = campaign mode
|
||||
|
@ -606,7 +605,7 @@ class marketing_campaign_workitem(osv.osv):
|
|||
# time Y N N N
|
||||
# cosmetic N N N N
|
||||
# auto Y Y Y Y
|
||||
#
|
||||
#
|
||||
|
||||
run = transition.trigger == 'auto' \
|
||||
or (transition.trigger == 'time' \
|
||||
|
@ -671,8 +670,10 @@ class marketing_campaign_workitem(osv.osv):
|
|||
}
|
||||
|
||||
elif wi_obj.activity_id.type == 'paper':
|
||||
datas = {'ids': [wi_obj.res_id],
|
||||
'model': wi_obj.object_id.model}
|
||||
datas = {
|
||||
'ids': [wi_obj.res_id],
|
||||
'model': wi_obj.object_id.model
|
||||
}
|
||||
res = {
|
||||
'type' : 'ir.actions.report.xml',
|
||||
'report_name': wi_obj.activity_id.report_id.report_name,
|
||||
|
@ -689,9 +690,9 @@ class email_template(osv.osv):
|
|||
_defaults = {
|
||||
'object_name': lambda obj, cr, uid, context: context.get('object_id',False),
|
||||
}
|
||||
|
||||
|
||||
# TODO: add constraint to prevent disabling / disapproving an email account used in a running campaign
|
||||
|
||||
|
||||
email_template()
|
||||
|
||||
class report_xml(osv.osv):
|
||||
|
|
|
@ -249,9 +249,6 @@
|
|||
<field name="report_directory_id" attrs="{'required':[('type','=','paper')]}" />
|
||||
</group>
|
||||
<field name="server_action_id" attrs="{'required':[('type','=','action')],'invisible':[('type','!=','action')]}" domain="[('model_id','=',object_id)]" />
|
||||
<!--
|
||||
<field name="subcampaign_id" attrs="{'required':[('type','=','subcampaign')], 'invisible':[('type','!=','subcampaign')]}" />
|
||||
-->
|
||||
</group>
|
||||
</group>
|
||||
<newline/>
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
import tools
|
||||
from osv import fields, osv
|
||||
|
||||
class campaign_analysis(osv.osv): #{{{
|
||||
class campaign_analysis(osv.osv):
|
||||
_name = "campaign.analysis"
|
||||
_description = "Campaign Analysis"
|
||||
_auto = False
|
||||
|
@ -43,22 +43,22 @@ class campaign_analysis(osv.osv): #{{{
|
|||
return result
|
||||
_columns = {
|
||||
'year': fields.char('Year', size=4, readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'),
|
||||
('03','March'), ('04','April'),('05','May'), ('06','June'),
|
||||
'month':fields.selection([('01','January'), ('02','February'),
|
||||
('03','March'), ('04','April'),('05','May'), ('06','June'),
|
||||
('07','July'), ('08','August'), ('09','September'),
|
||||
('10','October'), ('11','November'), ('12','December')],
|
||||
('10','October'), ('11','November'), ('12','December')],
|
||||
'Month', readonly=True),
|
||||
'date': fields.date('Date', readonly=True),
|
||||
'campaign_id': fields.many2one('marketing.campaign', 'Campaign',
|
||||
'campaign_id': fields.many2one('marketing.campaign', 'Campaign',
|
||||
readonly=True),
|
||||
'activity_id': fields.many2one('marketing.campaign.activity', 'Activity',
|
||||
readonly=True),
|
||||
'segment_id': fields.many2one('marketing.campaign.segment', 'Segment',
|
||||
'segment_id': fields.many2one('marketing.campaign.segment', 'Segment',
|
||||
readonly=True),
|
||||
'partner_id': fields.many2one('res.partner', 'Partner', readonly=True),
|
||||
'country_id': fields.related('partner_id','address', 'country_id',
|
||||
type='many2one', relation='res.country',string='Country'),
|
||||
'total_cost' : fields.function(_total_cost, string='Cost', method=True,
|
||||
'total_cost' : fields.function(_total_cost, string='Cost', method=True,
|
||||
type="float" ),
|
||||
'revenue': fields.float('Revenue',digits=(16,2),readonly=True),
|
||||
'count' : fields.integer('# of Actions', readonly=True),
|
||||
|
@ -89,4 +89,4 @@ class campaign_analysis(osv.osv): #{{{
|
|||
wi.date::date
|
||||
)
|
||||
""")
|
||||
campaign_analysis() #}}}
|
||||
campaign_analysis()
|
||||
|
|
|
@ -5,9 +5,6 @@
|
|||
<record id="base.res_groups_email_template_admin" model="res.groups">
|
||||
<field name="name">Marketing / User</field>
|
||||
</record>
|
||||
<!--record id="res_groups_marketing_campaign" model="res.groups">
|
||||
<field name="name">Marketing / Campaign</field>
|
||||
</record-->
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -29,22 +29,22 @@ mailchimp_url = 'http://%s.api.mailchimp.com/1.2'
|
|||
|
||||
class mailchimp_account(osv.osv):
|
||||
_name = "mailchimp.account"
|
||||
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Account Name', size=64),
|
||||
'username': fields.char('Username', size=64, required=True),
|
||||
'password': fields.char('Password', size=64, required=True),
|
||||
'apikey': fields.char('API Key', size=128),
|
||||
'data_center': fields.selection([('us1', 'US1'), ('us2', 'US2'),
|
||||
('uk1', 'UK1')], 'Data Center'),
|
||||
'state': fields.selection([('draft', 'Draft'), ('approved', 'Approved'),
|
||||
('cancelled', 'Cancelled')], 'State', readonly=True)
|
||||
}
|
||||
|
||||
'name': fields.char('Account Name', size=64),
|
||||
'username': fields.char('Username', size=64, required=True),
|
||||
'password': fields.char('Password', size=64, required=True),
|
||||
'apikey': fields.char('API Key', size=128),
|
||||
'data_center': fields.selection([('us1', 'US1'), ('us2', 'US2'),
|
||||
('uk1', 'UK1')], 'Data Center'),
|
||||
'state': fields.selection([('draft', 'Draft'), ('approved', 'Approved'),
|
||||
('cancelled', 'Cancelled')], 'State', readonly=True)
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'state': lambda *a: 'draft'
|
||||
}
|
||||
|
||||
'state': lambda *a: 'draft'
|
||||
}
|
||||
|
||||
def get_response(self, cr, uid, mailchimp_id, method, params={}):
|
||||
mailchimp_account = self.browse(cr, uid, mailchimp_id)
|
||||
params['output'] = 'json'
|
||||
|
@ -57,7 +57,7 @@ class mailchimp_account(osv.osv):
|
|||
params = urllib.urlencode(params, doseq=True)
|
||||
response = urllib2.urlopen(url, params)
|
||||
return json.loads(response.read())
|
||||
|
||||
|
||||
def button_approve(self, cr, uid, ids, context):
|
||||
acc_obj = self.browse(cr, uid, ids)[0]
|
||||
vals = {}
|
||||
|
@ -71,32 +71,34 @@ class mailchimp_account(osv.osv):
|
|||
vals['apikey'] = response
|
||||
vals['state'] = 'approved'
|
||||
self.write(cr, uid, ids, vals)
|
||||
else :
|
||||
else :
|
||||
raise osv.except_osv('Error!!!',
|
||||
"Can't approved accoutnt : %s"%response['error'])
|
||||
return True
|
||||
|
||||
|
||||
def button_cancel(self, cr, uid, ids, context):
|
||||
self.write(cr, uid, ids, {'state': 'cancelled'})
|
||||
return True
|
||||
|
||||
|
||||
def add_partner_list(self, cr, uid, account_id, list_id, partner_ids):
|
||||
vals = {} # just dictionary with partner_id and updated in list or not
|
||||
for partner in self.pool.get('res.partner').browse(cr, uid, partner_ids):
|
||||
params = {'id' : list_id,
|
||||
params = {
|
||||
'id' : list_id,
|
||||
'email_address' : partner.email,
|
||||
'email_type':'text',
|
||||
'merge_vars[FNAME]':partner.name ,
|
||||
'merge_vars[FNAME]':partner.name ,
|
||||
'merge_vars[date]' : time.strftime('%Y-%m-%d'),
|
||||
'merge_vars[phone]' : partner.phone,
|
||||
'merge_vars[website]' : partner.website,
|
||||
'merge_vars[address][country]' : partner.country.code,
|
||||
'merge_vars[address][city]' : partner.city,
|
||||
'double_optin':False}
|
||||
'double_optin':False
|
||||
}
|
||||
vals[partner.id] = self.get_response(cr, uid, account_id,
|
||||
'listSubscribe', params)
|
||||
return vals
|
||||
|
||||
|
||||
mailchimp_account()
|
||||
|
||||
class mailchimp_list(osv.osv_memory):
|
||||
|
@ -115,28 +117,28 @@ class marketing_campaign(osv.osv):
|
|||
_inherit = "marketing.campaign"
|
||||
|
||||
_columns = {
|
||||
'mailchimp_account_id': fields.many2one(
|
||||
'mailchimp.account', 'Account'),
|
||||
'mailchimp_campaign': fields.char('campaign', size=64),
|
||||
'mailchimp_account_id': fields.many2one(
|
||||
'mailchimp.account', 'Account'),
|
||||
'mailchimp_campaign': fields.char('campaign', size=64),
|
||||
}
|
||||
marketing_campaign()
|
||||
|
||||
|
||||
class marketing_campaign_activity(osv.osv):
|
||||
|
||||
class marketing_campaign_activity(osv.osv):
|
||||
_inherit = "marketing.campaign.activity"
|
||||
|
||||
_columns = {
|
||||
'mailchimp_account_id': fields.many2one(
|
||||
'mailchimp.account', 'Account'),
|
||||
'mailchimp_list': fields.char('List', size=64),
|
||||
'mailchimp_account_id': fields.many2one(
|
||||
'mailchimp.account', 'Account'),
|
||||
'mailchimp_list': fields.char('List', size=64),
|
||||
}
|
||||
|
||||
|
||||
def onchange_mailchimp(self, cr, uid, ids, mailchimp_account_id):
|
||||
if mailchimp_account_id:
|
||||
return {'value':{'mailchimp_list':''}}
|
||||
return {'value':{}}
|
||||
|
||||
def onchange_mailchimp_list(self, cr, uid, ids, mailchimp_account_id,
|
||||
|
||||
def onchange_mailchimp_list(self, cr, uid, ids, mailchimp_account_id,
|
||||
mailchimp_list):
|
||||
if mailchimp_account_id and mailchimp_list:
|
||||
lists = self.pool.get('mailchimp.account').get_response(cr,
|
||||
|
@ -154,7 +156,7 @@ class marketing_campaign_activity(osv.osv):
|
|||
mc_acc_obj = self.pool.get('mailchimp.account')
|
||||
lists = mc_acc_obj.get_response(cr, uid, mailchimp_account_id, 'lists')
|
||||
list_id = ''
|
||||
for l in lists :
|
||||
for l in lists :
|
||||
if l['name'] == list_name:
|
||||
list_id = l['id']
|
||||
break;
|
||||
|
@ -163,34 +165,38 @@ class marketing_campaign_activity(osv.osv):
|
|||
model_obj = self.pool.get(res_model).browse(cr, uid, res_id)
|
||||
params ={}
|
||||
if res_model == 'res.partner' :
|
||||
params.update({'email_address' : model_obj.email,
|
||||
'merge_vars[FNAME]':model_obj.name and model_obj.name or '',
|
||||
'merge_vars[website]' : model_obj.website,
|
||||
'merge_vars[address][country]' : model_obj.country.code,
|
||||
})
|
||||
params.update({
|
||||
'email_address' : model_obj.email,
|
||||
'merge_vars[FNAME]':model_obj.name and model_obj.name or '',
|
||||
'merge_vars[website]' : model_obj.website,
|
||||
'merge_vars[address][country]' : model_obj.country.code,
|
||||
})
|
||||
elif res_model == 'crm.lead' :
|
||||
params.update({'email_address' : model_obj.email_from,
|
||||
'merge_vars[FNAME]':model_obj.partner_name and \
|
||||
model_obj.partner_name or '',
|
||||
'merge_vars[address][country]' : model_obj.country_id and \
|
||||
model_obj.country_id.code or ''
|
||||
})
|
||||
params.update({
|
||||
'email_address' : model_obj.email_from,
|
||||
'merge_vars[FNAME]':model_obj.partner_name and \
|
||||
model_obj.partner_name or '',
|
||||
'merge_vars[address][country]' : model_obj.country_id and \
|
||||
model_obj.country_id.code or ''
|
||||
})
|
||||
if params['email_address'] :
|
||||
user = mc_acc_obj.get_response(cr, uid, mailchimp_account_id,
|
||||
'listMemberInfo',
|
||||
{'id' : list_id,
|
||||
'email_address': params['email_address']})
|
||||
# if there s no user with the specify email it will return error code
|
||||
'listMemberInfo', {
|
||||
'id' : list_id,
|
||||
'email_address': params['email_address']
|
||||
})
|
||||
# if there s no user with the specify email it will return error code
|
||||
# and thus we add that user otherwise user is alredy subscribe and there
|
||||
# is no need to subscribe user again
|
||||
if 'error' in user:
|
||||
params.update({'id' : list_id,
|
||||
params.update({
|
||||
'id' : list_id,
|
||||
'email_type':'text',
|
||||
'double_optin':False,
|
||||
'merge_vars[date]' : time.strftime('%Y-%m-%d'),
|
||||
'merge_vars[address][city]' : model_obj.city and model_obj.city or '',
|
||||
'merge_vars[phone]' : model_obj.phone and model_obj.phone or '',
|
||||
})
|
||||
})
|
||||
mc_acc_obj.get_response(cr, uid, mailchimp_account_id, 'listSubscribe', params)
|
||||
# TODO handle mailchimp error
|
||||
return True
|
||||
|
|
|
@ -8,4 +8,3 @@
|
|||
|
||||
</data>
|
||||
</openerp>
|
||||
<!--group_marketing_user-->
|
||||
|
|
|
@ -38,20 +38,17 @@ class create_list(osv.osv_memory):
|
|||
'Partner'),
|
||||
|
||||
}
|
||||
|
||||
|
||||
def onchange_mailchimp_account_id(self, cr, uid, ids, mailchimp_account_id,
|
||||
action):
|
||||
print mailchimp_account_id,action,
|
||||
return {'value':{}}
|
||||
|
||||
return {'value':{}}
|
||||
|
||||
def create_list(self, cr, uid, ids, context=None):
|
||||
create_list_obj = self.browse(cr, uid, ids[0])
|
||||
print create_list_obj.id
|
||||
mailchimp_account_obj = self.pool.get('mailchimp.account')
|
||||
account_id = create_list_obj.mailchimp_account_id
|
||||
lists = mailchimp_account_obj.get_response(cr, uid, account_id.id, 'lists')
|
||||
lists = dict([(l['name'],l['id']) for l in lists])
|
||||
print lists
|
||||
if create_list_obj.list_name not in lists.keys():
|
||||
raise osv.except_osv(_('UserError'),
|
||||
_('There is no list define in account %s') % (account_id.name))
|
||||
|
|
|
@ -11,9 +11,6 @@
|
|||
<newline/>
|
||||
<separator string="Partner" colspan="4"/>
|
||||
<field name="partner_ids" nolabel="1" colspan="4"/>
|
||||
<!--group ">
|
||||
<field name="mailchimp_list_id" />
|
||||
</group-->
|
||||
<group col="4" colspan="4">
|
||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||
<button name="create_list" string="Update" type="object" icon="gtk-ok"/>
|
||||
|
|
|
@ -164,18 +164,4 @@ result = price_unit * 0.10"" name="python_compute"/>
|
|||
<field name="account_id" ref="account.a_sale"/>
|
||||
</record>
|
||||
</data>
|
||||
<!--
|
||||
<data>
|
||||
<workflow action="invoice_open" model="account.invoice" ref="account_invoice_2"/>
|
||||
</data>
|
||||
|
||||
<data>
|
||||
<workflow action="invoice_open" model="account.invoice" ref="account_invoice_1"/>
|
||||
</data>
|
||||
|
||||
|
||||
<data>
|
||||
<workflow action="invoice_open" model="account.invoice" ref="account_invoice_0"/>
|
||||
</data>
|
||||
-->
|
||||
</openerp>
|
||||
|
|
|
@ -37,14 +37,14 @@ STATE = [
|
|||
]
|
||||
|
||||
STATE_PRIOR = {
|
||||
'none' : 0,
|
||||
'canceled' : 1,
|
||||
'old' : 2,
|
||||
'waiting' : 3,
|
||||
'invoiced' : 4,
|
||||
'free' : 6,
|
||||
'paid' : 7
|
||||
}
|
||||
'none' : 0,
|
||||
'canceled' : 1,
|
||||
'old' : 2,
|
||||
'waiting' : 3,
|
||||
'invoiced' : 4,
|
||||
'free' : 6,
|
||||
'paid' : 7
|
||||
}
|
||||
|
||||
class membership_line(osv.osv):
|
||||
'''Member line'''
|
||||
|
@ -81,7 +81,7 @@ class membership_line(osv.osv):
|
|||
@param ids: List of Membership Line IDs
|
||||
@param name: Field Name
|
||||
@param context: A standard dictionary for contextual values
|
||||
@param return: Dictionary of state Value
|
||||
@param return: Dictionary of state Value
|
||||
"""
|
||||
res = {}
|
||||
for line in self.browse(cr, uid, ids):
|
||||
|
@ -124,21 +124,21 @@ class membership_line(osv.osv):
|
|||
_description = __doc__
|
||||
_name = 'membership.membership_line'
|
||||
_columns = {
|
||||
'partner': fields.many2one('res.partner', 'Partner', ondelete='cascade', select=1),
|
||||
'membership_id': fields.many2one('product.product', string="Membership", required=True),
|
||||
'date_from': fields.date('From', readonly=True),
|
||||
'date_to': fields.date('To', readonly=True),
|
||||
'date_cancel' : fields.date('Cancel date'),
|
||||
'date': fields.date('Join Date'),
|
||||
'member_price':fields.float('Member Price', digits_compute= dp.get_precision('Sale Price'), required=True),
|
||||
'account_invoice_line': fields.many2one('account.invoice.line', 'Account Invoice line', readonly=True),
|
||||
'account_invoice_id': fields.related('account_invoice_line', 'invoice_id', type='many2one', relation='account.invoice', string='Invoice', readonly=True),
|
||||
'state': fields.function(_state, method=True, string='State', type='selection', selection=STATE),
|
||||
'partner': fields.many2one('res.partner', 'Partner', ondelete='cascade', select=1),
|
||||
'membership_id': fields.many2one('product.product', string="Membership", required=True),
|
||||
'date_from': fields.date('From', readonly=True),
|
||||
'date_to': fields.date('To', readonly=True),
|
||||
'date_cancel' : fields.date('Cancel date'),
|
||||
'date': fields.date('Join Date'),
|
||||
'member_price':fields.float('Member Price', digits_compute= dp.get_precision('Sale Price'), required=True),
|
||||
'account_invoice_line': fields.many2one('account.invoice.line', 'Account Invoice line', readonly=True),
|
||||
'account_invoice_id': fields.related('account_invoice_line', 'invoice_id', type='many2one', relation='account.invoice', string='Invoice', readonly=True),
|
||||
'state': fields.function(_state, method=True, string='State', type='selection', selection=STATE),
|
||||
}
|
||||
_rec_name = 'partner'
|
||||
_order = 'id desc'
|
||||
_constraints = [
|
||||
(_check_membership_date, 'Error, this membership product is out of date', [])
|
||||
(_check_membership_date, 'Error, this membership product is out of date', [])
|
||||
]
|
||||
|
||||
membership_line()
|
||||
|
@ -182,7 +182,7 @@ class Partner(osv.osv):
|
|||
@param ids: List of Partner IDs
|
||||
@param name: Field Name
|
||||
@param context: A standard dictionary for contextual values
|
||||
@param return: Dictionary of Membership state Value
|
||||
@param return: Dictionary of Membership state Value
|
||||
"""
|
||||
res = {}
|
||||
for id in ids:
|
||||
|
@ -239,28 +239,28 @@ class Partner(osv.osv):
|
|||
res_state = self._membership_state(cr, uid, [partner_data.associate_member.id], name, args, context)
|
||||
res[id] = res_state[partner_data.associate_member.id]
|
||||
return res
|
||||
|
||||
|
||||
def _membership_date(self, cr, uid, ids, name, args, context=None):
|
||||
|
||||
|
||||
"""Return date of membership"""
|
||||
|
||||
|
||||
name = name[0]
|
||||
res = {}
|
||||
member_line_obj = self.pool.get('membership.membership_line')
|
||||
|
||||
|
||||
for partner in self.browse(cr, uid, ids):
|
||||
|
||||
|
||||
if partner.associate_member:
|
||||
partner_id = partner.associate_member.id
|
||||
else:
|
||||
partner_id = partner.id
|
||||
|
||||
res[partner.id]={
|
||||
'membership_start': False,
|
||||
'membership_stop': False,
|
||||
'membership_cancel': False
|
||||
}
|
||||
|
||||
|
||||
res[partner.id] = {
|
||||
'membership_start': False,
|
||||
'membership_stop': False,
|
||||
'membership_cancel': False
|
||||
}
|
||||
|
||||
if name == 'membership_start':
|
||||
line_id = member_line_obj.search(cr, uid, [('partner', '=', partner_id)],
|
||||
limit=1, order='date_from')
|
||||
|
@ -268,13 +268,13 @@ class Partner(osv.osv):
|
|||
res[partner.id]['membership_start'] = member_line_obj.read(cr, uid, line_id[0],
|
||||
['date_from'])['date_from']
|
||||
|
||||
if name == 'membership_stop':
|
||||
if name == 'membership_stop':
|
||||
line_id1 = member_line_obj.search(cr, uid, [('partner', '=', partner_id)],
|
||||
limit=1, order='date_to desc')
|
||||
if line_id1:
|
||||
res[partner.id]['membership_stop'] = member_line_obj.read(cr, uid, line_id1[0],
|
||||
['date_to'])['date_to']
|
||||
if name == 'membership_cancel':
|
||||
if name == 'membership_cancel':
|
||||
if partner.membership_state == 'canceled':
|
||||
line_id2 = member_line_obj.search(cr, uid, [('partner', '=', partner.id)],limit=1, order='date_cancel')
|
||||
if line_id2:
|
||||
|
@ -366,7 +366,7 @@ class Partner(osv.osv):
|
|||
default = default.copy()
|
||||
default['member_lines'] = []
|
||||
return super(Partner, self).copy(cr, uid, id, default, context)
|
||||
|
||||
|
||||
def create_membership_invoice(self, cr, uid, ids, product_id=None, datas=None, context=None):
|
||||
""" Create Customer Invoice of Membership for partners.
|
||||
@param datas: datas has dictionary value which consist Id of Membership product and Cost Amount of Membership.
|
||||
|
@ -397,8 +397,8 @@ class Partner(osv.osv):
|
|||
line_value = {
|
||||
'product_id' : product_id,
|
||||
}
|
||||
|
||||
line_dict = invoice_line_obj.product_id_change(cr, uid, {},
|
||||
|
||||
line_dict = invoice_line_obj.product_id_change(cr, uid, {},
|
||||
product_id, False, quantity, '', 'out_invoice', partner.id, fpos_id, price_unit=amount, context=context)
|
||||
line_value.update(line_dict['value'])
|
||||
if line_value.get('invoice_line_tax_id', False):
|
||||
|
@ -427,7 +427,7 @@ Partner()
|
|||
class product_template(osv.osv):
|
||||
_inherit = 'product.template'
|
||||
_columns = {
|
||||
'member_price':fields.float('Member Price', digits_compute= dp.get_precision('Sale Price')),
|
||||
'member_price':fields.float('Member Price', digits_compute= dp.get_precision('Sale Price')),
|
||||
}
|
||||
product_template()
|
||||
|
||||
|
@ -435,7 +435,7 @@ class Product(osv.osv):
|
|||
|
||||
def fields_view_get(self, cr, user, view_id=None, view_type='form', context=None, toolbar=False, submenu=False):
|
||||
model_obj = self.pool.get('ir.model.data')
|
||||
|
||||
|
||||
if ('product' in context) and (context['product']=='membership_product'):
|
||||
model_data_ids_form = model_obj.search(cr,user,[('model','=','ir.ui.view'),('name','in',['membership_products_form','membership_products_tree'])])
|
||||
resource_id_form = model_obj.read(cr, user, model_data_ids_form, fields=['res_id','name'])
|
||||
|
@ -451,15 +451,14 @@ class Product(osv.osv):
|
|||
'''Product'''
|
||||
_inherit = 'product.product'
|
||||
_columns = {
|
||||
'membership': fields.boolean('Membership', help='Specify if this product is a membership product'),
|
||||
'membership_date_from': fields.date('Date from', help='Active Membership since this date'),
|
||||
'membership_date_to': fields.date('Date to', help='Expired date of Membership'),
|
||||
# 'member_price':fields.float('Member Price'),
|
||||
}
|
||||
'membership': fields.boolean('Membership', help='Specify if this product is a membership product'),
|
||||
'membership_date_from': fields.date('Date from', help='Active Membership since this date'),
|
||||
'membership_date_to': fields.date('Date to', help='Expired date of Membership'),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'membership': lambda *args: False
|
||||
}
|
||||
'membership': lambda *args: False
|
||||
}
|
||||
Product()
|
||||
|
||||
|
||||
|
@ -533,7 +532,7 @@ class account_invoice_line(osv.osv):
|
|||
line = self.browse(cr, uid, result)
|
||||
member_line_obj = self.pool.get('membership.membership_line')
|
||||
if line.invoice_id.type == 'out_invoice':
|
||||
|
||||
|
||||
ml_ids = member_line_obj.search(cr, uid, [('account_invoice_line','=',line.id)])
|
||||
if line.product_id and line.product_id.membership and not ml_ids:
|
||||
# Product line is a membership product
|
||||
|
@ -542,14 +541,14 @@ class account_invoice_line(osv.osv):
|
|||
if line.invoice_id.date_invoice > date_from and line.invoice_id.date_invoice < date_to:
|
||||
date_from = line.invoice_id.date_invoice
|
||||
line_id = member_line_obj.create(cr, uid, {
|
||||
'partner': line.invoice_id.partner_id and line.invoice_id.partner_id.id or False,
|
||||
'membership_id': line.product_id.id,
|
||||
'member_price': line.price_unit,
|
||||
'date': time.strftime('%Y-%m-%d'),
|
||||
'date_from': date_from,
|
||||
'date_to': date_to,
|
||||
'account_invoice_line': line.id,
|
||||
})
|
||||
'partner': line.invoice_id.partner_id and line.invoice_id.partner_id.id or False,
|
||||
'membership_id': line.product_id.id,
|
||||
'member_price': line.price_unit,
|
||||
'date': time.strftime('%Y-%m-%d'),
|
||||
'date_from': date_from,
|
||||
'date_to': date_to,
|
||||
'account_invoice_line': line.id,
|
||||
})
|
||||
return result
|
||||
|
||||
account_invoice_line()
|
||||
|
|
|
@ -28,14 +28,14 @@
|
|||
<field name="model">product.product</field>
|
||||
<field name="type">form</field>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Membership products">
|
||||
<form string="Membership products">
|
||||
<field name="name"/>
|
||||
<field name="default_code"/>
|
||||
<field name="type"/>
|
||||
<field name="categ_id"/>
|
||||
<field name="membership_date_from" required="1"/>
|
||||
<field name="membership_date_to" required="1"/>
|
||||
<field name="list_price" string="Membership Fee"/>
|
||||
<field name="list_price" string="Membership Fee"/>
|
||||
<separator colspan="4" string="Customer Taxes:"/>
|
||||
<field name="taxes_id" colspan="4" nolabel="1"/>
|
||||
</form>
|
||||
|
@ -84,9 +84,9 @@
|
|||
<menuitem name="Memberships" parent="menu_membership"
|
||||
id="menu_membership_products"
|
||||
action="action_membership_products" sequence="1"/>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
@ -167,16 +167,6 @@
|
|||
<menuitem name="Members" parent="menu_membership" id="menu_members" sequence="2" action="action_membership_members"/>
|
||||
|
||||
<!-- PARTNERS -->
|
||||
<!--
|
||||
<wizard
|
||||
string="Invoice Membership"
|
||||
model="res.partner"
|
||||
name="wizard_invoice_membership"
|
||||
id="wizard_invoice_membership"
|
||||
/>
|
||||
-->
|
||||
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_partner_tree">
|
||||
<field name="name">res.partner.tree.form.inherit</field>
|
||||
|
@ -203,13 +193,13 @@
|
|||
<button name="%(action_membership_invoice_view)d" type="action" string="Join Membership" icon="gtk-apply"/>
|
||||
<field colspan="4" name="associate_member" attrs="{'invisible':[('membership_state', '!=', 'none')], 'readonly':[('free_member','=',True)]}"/>
|
||||
<field colspan="4" name="membership_state"/>
|
||||
</group>
|
||||
</group>
|
||||
</group>
|
||||
<group colspan="2" col="2">
|
||||
<field name="membership_start"/>
|
||||
<field name="membership_stop"/>
|
||||
<field name="membership_cancel"/>
|
||||
</group>
|
||||
</group>
|
||||
<field name="member_lines" nolabel="1" colspan="4" readonly="1">
|
||||
<tree string="Memberships">
|
||||
<field name="date"/>
|
||||
|
@ -219,14 +209,14 @@
|
|||
<field name="state"/>
|
||||
</tree>
|
||||
<form string="Memberships">
|
||||
<field name="date"/>
|
||||
<field name="date"/>
|
||||
<field name="member_price"/>
|
||||
<field name="membership_id"/>
|
||||
<field name="account_invoice_id"/>
|
||||
<field name="state" colspan="4"/>
|
||||
</form>
|
||||
</field>
|
||||
|
||||
</field>
|
||||
|
||||
</page>
|
||||
</notebook>
|
||||
</field>
|
||||
|
@ -234,7 +224,7 @@
|
|||
|
||||
<!-- MEMBERSHIP/REPORTING -->
|
||||
<menuitem name="Reporting" id="base.menu_report_association" parent="base.menu_association" sequence="20"/>
|
||||
|
||||
|
||||
<!-- View for product.product object inherited from product module................ -->
|
||||
<record model="ir.ui.view" id="view_product_form_inherit1">
|
||||
<field name="name">product.normal.form</field>
|
||||
|
|
|
@ -70,7 +70,6 @@
|
|||
'wizard/mrp_price_view.xml',
|
||||
'wizard/mrp_workcenter_load_view.xml',
|
||||
'wizard/mrp_change_standard_price_view.xml',
|
||||
# 'wizard/mrp_track_prod_view.xml',
|
||||
'mrp_view.xml',
|
||||
'mrp_report.xml',
|
||||
'company_view.xml',
|
||||
|
@ -84,7 +83,10 @@
|
|||
|
||||
|
||||
],
|
||||
'demo_xml': ['mrp_demo.xml', 'board_manufacturing_demo.xml'],
|
||||
'demo_xml': [
|
||||
'mrp_demo.xml',
|
||||
'board_manufacturing_demo.xml'
|
||||
],
|
||||
'test': [
|
||||
'test/mrp_packs.yml',
|
||||
'test/mrp_phantom_bom.yml',
|
||||
|
|
|
@ -1,13 +1,6 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<!-- <record id="sc_manufacturing_dash" model="ir.ui.view_sc">
|
||||
<field name="name">Production dashboard</field>
|
||||
<field name="user_id" ref="base.user_root"/>
|
||||
<field name="resource">ir.ui.menu</field>
|
||||
<field name="sequence">4</field>
|
||||
<field name="res_id" ref="menu_board_manufacturing"/>
|
||||
</record> -->
|
||||
<record id="base.user_root" model="res.users">
|
||||
<field name="action_id" ref="open_board_manufacturing"/>
|
||||
</record>
|
||||
|
|
|
@ -7,7 +7,6 @@
|
|||
<menuitem id="menu_mrp_reordering" name="Automatic Procurements" parent="stock.menu_stock_root" sequence="5"/>
|
||||
<menuitem id="menu_mrp_manufacturing" name="Manufacturing" parent="base.menu_mrp_root" sequence="1"/>
|
||||
|
||||
<!-- <menuitem name="Control" id="menu_mrp_control" parent="base.menu_mrp_root" sequence="3" />-->
|
||||
<menuitem name="Master Data"
|
||||
id="menu_mrp_bom"
|
||||
parent="base.menu_mrp_root"
|
||||
|
@ -72,7 +71,7 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="view_mrp_property_search" model="ir.ui.view">
|
||||
<field name="name">mrp.property.search</field>
|
||||
<field name="model">mrp.property</field>
|
||||
|
@ -91,8 +90,8 @@
|
|||
</search>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
<record id="mrp_property_action" model="ir.actions.act_window">
|
||||
<field name="name">Properties</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
@ -175,7 +174,7 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Search Views -->
|
||||
|
||||
<record id="view_mrp_workcenter_search" model="ir.ui.view">
|
||||
|
@ -283,8 +282,6 @@
|
|||
<field name="view_id" ref="mrp_routing_tree_view"/>
|
||||
<field name="help">Routings define the assembly operations to be done in work centers for manufacturing a certain product. They are usually attached to bills of materials which will define the assembly of products required for manufacture or for finished products.</field>
|
||||
</record>
|
||||
<!-- <menuitem name="Routings" id="menu_mrp_routing_and_workcenters" parent="mrp.menu_mrp_bom" groups="base.group_extended"
|
||||
sequence="100" />-->
|
||||
<menuitem action="mrp_workcenter_action" id="menu_mrp_workcenter_action" parent="mrp.menu_mrp_property" groups="base.group_extended" sequence="40" />
|
||||
<menuitem action="mrp_routing_action" id="menu_mrp_routing_action" parent="mrp.menu_mrp_property" groups="base.group_extended" sequence="30"/>
|
||||
|
||||
|
@ -368,7 +365,7 @@
|
|||
<filter string='Type' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'type'}" />
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Date" icon="terp-go-month" domain="[]" context="{'group_by':'date_start'}"/>
|
||||
|
||||
|
||||
</group>
|
||||
</search>
|
||||
</field>
|
||||
|
@ -415,10 +412,6 @@
|
|||
|
||||
<!-- BOM menus -->
|
||||
|
||||
<!-- <menuitem name="Bill of Materials"
|
||||
id="menu_mrp_bom"
|
||||
parent="menu_mrp_bom"
|
||||
sequence="50" />-->
|
||||
<menuitem
|
||||
action="mrp_bom_form_action"
|
||||
id="menu_mrp_bom_form_action"
|
||||
|
@ -483,10 +476,7 @@
|
|||
|
||||
<menuitem action="procurement.procurement_action" id="menu_mrp_procurement_action"
|
||||
parent="mrp.menu_mrp_manufacturing" sequence="3" />
|
||||
<!-- <menuitem action="procurement.procurement_action5" id="menu_mrp_procurement_exception_action"-->
|
||||
<!-- parent="mrp.menu_mrp_control" sequence="1" />-->
|
||||
|
||||
<menuitem id="menu_mrp_scheduler" name="Schedulers" parent="base.menu_mrp_root" groups="base.group_system,mrp.group_mrp_user,mrp.group_mrp_manager" sequence="3"/>
|
||||
<menuitem id="menu_mrp_scheduler" name="Schedulers" parent="base.menu_mrp_root" groups="base.group_system,mrp.group_mrp_user,mrp.group_mrp_manager" sequence="3"/>
|
||||
<menuitem action="procurement.action_compute_schedulers" id="mrp_Sched_all" parent="mrp.menu_mrp_scheduler" sequence="90" groups="base.group_system,mrp.group_mrp_user,mrp.group_mrp_manager"/>
|
||||
|
||||
<!--
|
||||
|
@ -656,7 +646,7 @@
|
|||
<field name="product_qty" string="Qty"/>
|
||||
<field name="product_uom" string="UOM"/>
|
||||
<field name="location_id" string="Source Loc."/>
|
||||
<field name="state" invisible="1"/>
|
||||
<field name="state" invisible="1"/>
|
||||
<button name="%(stock.move_scrap)d"
|
||||
string="Scrap Products" type="action"
|
||||
icon="gtk-convert" context="{'scrap': True}"
|
||||
|
|
|
@ -30,7 +30,6 @@ import StringIO
|
|||
|
||||
|
||||
theme.use_color = 1
|
||||
#theme.scale = 2
|
||||
random.seed(0)
|
||||
|
||||
#
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,14 +15,13 @@
|
|||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import mrp_product_produce
|
||||
import mrp_price
|
||||
import mrp_workcenter_load
|
||||
#import mrp_track_prod
|
||||
import change_production_qty
|
||||
import mrp_change_standard_price
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -30,24 +30,24 @@ class mrp_price(osv.osv_memory):
|
|||
_defaults = {
|
||||
'number': 1,
|
||||
}
|
||||
|
||||
|
||||
def print_report(self, cr, uid, ids, context=None):
|
||||
""" To print the report of Product cost structure
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param context: A standard dictionary
|
||||
@param context: A standard dictionary
|
||||
@return : Report
|
||||
"""
|
||||
"""
|
||||
datas = {'ids' : context.get('active_ids',[])}
|
||||
res = self.read(cr, uid, ids, ['number'])
|
||||
res = res and res[0] or {}
|
||||
res = res and res[0] or {}
|
||||
datas['form'] = res
|
||||
|
||||
return {
|
||||
'type' : 'ir.actions.report.xml',
|
||||
'report_name':'product.price',
|
||||
'datas' : datas,
|
||||
|
||||
return {
|
||||
'type' : 'ir.actions.report.xml',
|
||||
'report_name':'product.price',
|
||||
'datas' : datas,
|
||||
}
|
||||
|
||||
mrp_price()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -24,10 +24,10 @@ from osv import fields, osv
|
|||
class mrp_product_produce(osv.osv_memory):
|
||||
_name = "mrp.product.produce"
|
||||
_description = "Product Produce"
|
||||
|
||||
|
||||
_columns = {
|
||||
'product_qty': fields.float('Quantity', required=True),
|
||||
'mode': fields.selection([('consume_produce', 'Consume & Produce'),
|
||||
'product_qty': fields.float('Quantity', required=True),
|
||||
'mode': fields.selection([('consume_produce', 'Consume & Produce'),
|
||||
('consume', 'Consume Only')], 'Mode', required=True,
|
||||
help="'Consume only' mode will only consume the products with the quantity selected.\n"
|
||||
"'Consume & Produce' mode will consume as well as produce the products with the quantity selected "
|
||||
|
@ -40,35 +40,35 @@ class mrp_product_produce(osv.osv_memory):
|
|||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param context: A standard dictionary
|
||||
@return: Quantity
|
||||
"""
|
||||
prod = self.pool.get('mrp.production').browse(cr, uid,
|
||||
@return: Quantity
|
||||
"""
|
||||
prod = self.pool.get('mrp.production').browse(cr, uid,
|
||||
context['active_id'], context=context)
|
||||
done = 0.0
|
||||
for move in prod.move_created_ids2:
|
||||
if not move.scraped:
|
||||
done += move.product_qty
|
||||
return (prod.product_qty - done) or prod.product_qty
|
||||
|
||||
|
||||
_defaults = {
|
||||
'product_qty': _get_product_qty,
|
||||
'mode': lambda *x: 'consume_produce'
|
||||
}
|
||||
'product_qty': _get_product_qty,
|
||||
'mode': lambda *x: 'consume_produce'
|
||||
}
|
||||
|
||||
def do_produce(self, cr, uid, ids, context={}):
|
||||
""" To check the product type
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param ids: the ID or list of IDs if we want more than one
|
||||
@param ids: the ID or list of IDs if we want more than one
|
||||
@param context: A standard dictionary
|
||||
@return:
|
||||
"""
|
||||
@return:
|
||||
"""
|
||||
prod_obj = self.pool.get('mrp.production')
|
||||
move_ids = context['active_ids']
|
||||
for data in self.read(cr, uid, ids):
|
||||
for move_id in move_ids:
|
||||
prod_obj.action_produce(cr, uid, move_id,
|
||||
prod_obj.action_produce(cr, uid, move_id,
|
||||
data['product_qty'], data['mode'], context=context)
|
||||
return {}
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -24,7 +24,7 @@ from osv import fields, osv
|
|||
class mrp_workcenter_load(osv.osv_memory):
|
||||
_name = 'mrp.workcenter.load'
|
||||
_description = 'Workcenter Load'
|
||||
|
||||
|
||||
_columns = {
|
||||
'time_unit': fields.selection([('day', 'Day by day'),('week', 'Per week'),('month', 'Per month')],'Type of period', required=True),
|
||||
'measure_unit': fields.selection([('hours', 'Amount in hours'),('cycles', 'Amount in cycles')],'Amount measuring unit', required=True),
|
||||
|
@ -35,18 +35,18 @@ class mrp_workcenter_load(osv.osv_memory):
|
|||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param context: A standard dictionary
|
||||
@param context: A standard dictionary
|
||||
@return : Report
|
||||
"""
|
||||
"""
|
||||
datas = {'ids' : context.get('active_ids',[])}
|
||||
res = self.read(cr, uid, ids, ['time_unit','measure_unit'])
|
||||
res = res and res[0] or {}
|
||||
res = res and res[0] or {}
|
||||
datas['form'] = res
|
||||
|
||||
return {
|
||||
'type' : 'ir.actions.report.xml',
|
||||
'report_name':'mrp.workcenter.load',
|
||||
'datas' : datas,
|
||||
|
||||
return {
|
||||
'type' : 'ir.actions.report.xml',
|
||||
'report_name':'mrp.workcenter.load',
|
||||
'datas' : datas,
|
||||
}
|
||||
|
||||
mrp_workcenter_load()
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
</record>
|
||||
|
||||
<record id="process_node_workorder0" model="process.node">
|
||||
<!-- <field name="menu_id" ref="menu_mrp_production_operation_action"/>-->
|
||||
<field name="model_id" ref="mrp.model_mrp_production_workcenter_line"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""Information from the routing definition."""" name="note"/>
|
||||
|
@ -39,7 +38,6 @@
|
|||
</record>
|
||||
|
||||
<record id="process_node_startoperation0" model="process.node">
|
||||
<!-- <field name="menu_id" ref="menu_mrp_production_operation_action"/>-->
|
||||
<field name="model_id" ref="mrp.model_mrp_production_workcenter_line"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""Start the operation."""" name="note"/>
|
||||
|
@ -50,7 +48,6 @@
|
|||
</record>
|
||||
|
||||
<record id="process_node_doneoperation0" model="process.node">
|
||||
<!-- <field name="menu_id" ref="menu_mrp_production_operation_action"/>-->
|
||||
<field name="model_id" ref="mrp.model_mrp_production_workcenter_line"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""Finish the operation."""" name="note"/>
|
||||
|
@ -61,7 +58,6 @@
|
|||
</record>
|
||||
|
||||
<record id="process_node_canceloperation0" model="process.node">
|
||||
<!-- <field name="menu_id" ref="menu_mrp_production_operation_action"/>-->
|
||||
<field name="model_id" ref="mrp.model_mrp_production_workcenter_line"/>
|
||||
<field eval=""""state"""" name="kind"/>
|
||||
<field eval=""""Cancel the operation."""" name="note"/>
|
||||
|
|
|
@ -41,7 +41,7 @@ class mrp_repair(osv.osv):
|
|||
@param field_name: Name of field.
|
||||
@param arg: Argument
|
||||
@param context: A standard dictionary for contextual values
|
||||
@return: Dictionary of values.
|
||||
@return: Dictionary of values.
|
||||
"""
|
||||
res = {}
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
|
@ -59,7 +59,7 @@ class mrp_repair(osv.osv):
|
|||
""" Calculates taxed amount.
|
||||
@param field_name: Name of field.
|
||||
@param arg: Argument
|
||||
@return: Dictionary of values.
|
||||
@return: Dictionary of values.
|
||||
"""
|
||||
res = {}
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
|
@ -82,7 +82,7 @@ class mrp_repair(osv.osv):
|
|||
""" Calculates total amount.
|
||||
@param field_name: Name of field.
|
||||
@param arg: Argument
|
||||
@return: Dictionary of values.
|
||||
@return: Dictionary of values.
|
||||
"""
|
||||
res = {}
|
||||
untax = self._amount_untaxed(cr, uid, ids, field_name, arg, context)
|
||||
|
@ -167,7 +167,7 @@ class mrp_repair(osv.osv):
|
|||
def onchange_product_id(self, cr, uid, ids, product_id=None):
|
||||
""" On change of product sets some values.
|
||||
@param product_id: Changed product
|
||||
@return: Dictionary of values.
|
||||
@return: Dictionary of values.
|
||||
"""
|
||||
return {'value': {
|
||||
'prodlot_id': False,
|
||||
|
@ -183,7 +183,7 @@ class mrp_repair(osv.osv):
|
|||
destination location, partner and partner address.
|
||||
@param prod_id: Id of product in current record.
|
||||
@param move_id: Changed move.
|
||||
@return: Dictionary of values.
|
||||
@return: Dictionary of values.
|
||||
"""
|
||||
data = {}
|
||||
data['value'] = {}
|
||||
|
@ -210,11 +210,11 @@ class mrp_repair(osv.osv):
|
|||
return True
|
||||
|
||||
def onchange_partner_id(self, cr, uid, ids, part, address_id):
|
||||
""" On change of partner sets the values of partner address,
|
||||
""" On change of partner sets the values of partner address,
|
||||
partner invoice address and pricelist.
|
||||
@param part: Changed id of partner.
|
||||
@param address_id: Address id from current record.
|
||||
@return: Dictionary of values.
|
||||
@return: Dictionary of values.
|
||||
"""
|
||||
part_obj = self.pool.get('res.partner')
|
||||
pricelist_obj = self.pool.get('product.pricelist')
|
||||
|
@ -240,7 +240,7 @@ class mrp_repair(osv.osv):
|
|||
destination location, move and guarantee limit.
|
||||
@param lot: Changed id of production lot.
|
||||
@param product_id: Product id from current record.
|
||||
@return: Dictionary of values.
|
||||
@return: Dictionary of values.
|
||||
"""
|
||||
prodlot_obj = self.pool.get('stock.production.lot')
|
||||
move_obj = self.pool.get('stock.move')
|
||||
|
@ -275,7 +275,7 @@ class mrp_repair(osv.osv):
|
|||
def action_cancel_draft(self, cr, uid, ids, *args):
|
||||
""" Cancels repair order when it is in 'Draft' state.
|
||||
@param *arg: Arguments
|
||||
@return: True
|
||||
@return: True
|
||||
"""
|
||||
if not len(ids):
|
||||
return False
|
||||
|
@ -292,7 +292,7 @@ class mrp_repair(osv.osv):
|
|||
""" Repair order state is set to 'To be invoiced' when invoice method
|
||||
is 'Before repair' else state becomes 'Confirmed'.
|
||||
@param *arg: Arguments
|
||||
@return: True
|
||||
@return: True
|
||||
"""
|
||||
mrp_line_obj = self.pool.get('mrp.repair.line')
|
||||
for o in self.browse(cr, uid, ids):
|
||||
|
@ -305,7 +305,7 @@ class mrp_repair(osv.osv):
|
|||
|
||||
def action_cancel(self, cr, uid, ids, context=None):
|
||||
""" Cancels repair order.
|
||||
@return: True
|
||||
@return: True
|
||||
"""
|
||||
ok=True
|
||||
mrp_line_obj = self.pool.get('mrp.repair.line')
|
||||
|
@ -320,7 +320,7 @@ class mrp_repair(osv.osv):
|
|||
def action_invoice_create(self, cr, uid, ids, group=False, context=None):
|
||||
""" Creates invoice(s) for repair order.
|
||||
@param group: It is set to true when group invoice is to be generated.
|
||||
@return: Invoice Ids.
|
||||
@return: Invoice Ids.
|
||||
"""
|
||||
res = {}
|
||||
invoices_group = {}
|
||||
|
@ -328,7 +328,7 @@ class mrp_repair(osv.osv):
|
|||
inv_obj = self.pool.get('account.invoice')
|
||||
repair_line_obj = self.pool.get('mrp.repair.line')
|
||||
repair_fee_obj = self.pool.get('mrp.repair.fee')
|
||||
for repair in self.browse(cr, uid, ids, context=context):
|
||||
for repair in self.browse(cr, uid, ids, context=context):
|
||||
res[repair.id] = False
|
||||
if repair.state in ('draft','cancel') or repair.invoice_id:
|
||||
continue
|
||||
|
@ -382,14 +382,14 @@ class mrp_repair(osv.osv):
|
|||
'invoice_id': inv_id,
|
||||
'name': name,
|
||||
'origin': repair.name,
|
||||
'account_id': account_id,
|
||||
'account_id': account_id,
|
||||
'quantity': operation.product_uom_qty,
|
||||
'invoice_line_tax_id': [(6,0,[x.id for x in operation.tax_id])],
|
||||
'uos_id': operation.product_uom.id,
|
||||
'price_unit': operation.price_unit,
|
||||
'price_subtotal': operation.product_uom_qty*operation.price_unit,
|
||||
'product_id': operation.product_id and operation.product_id.id or False
|
||||
})
|
||||
})
|
||||
repair_line_obj.write(cr, uid, [operation.id], {'invoiced': True, 'invoice_line_id': invoice_line_id})
|
||||
for fee in repair.fees_lines:
|
||||
if fee.to_invoice == True:
|
||||
|
@ -408,35 +408,35 @@ class mrp_repair(osv.osv):
|
|||
'product_id': fee.product_id and fee.product_id.id or False,
|
||||
'price_unit': fee.price_unit,
|
||||
'price_subtotal': fee.product_uom_qty*fee.price_unit
|
||||
})
|
||||
})
|
||||
repair_fee_obj.write(cr, uid, [fee.id], {'invoiced': True, 'invoice_line_id': invoice_fee_id})
|
||||
res[repair.id] = inv_id
|
||||
return res
|
||||
|
||||
def action_repair_ready(self, cr, uid, ids, context=None):
|
||||
""" Writes repair order state to 'Ready'
|
||||
@return: True
|
||||
@return: True
|
||||
"""
|
||||
self.write(cr, uid, ids, {'state': 'ready'})
|
||||
return True
|
||||
|
||||
def action_invoice_cancel(self, cr, uid, ids, context=None):
|
||||
""" Writes repair order state to 'Exception in invoice'
|
||||
@return: True
|
||||
@return: True
|
||||
"""
|
||||
self.write(cr, uid, ids, {'state': 'invoice_except'})
|
||||
return True
|
||||
|
||||
def action_repair_start(self, cr, uid, ids, context=None):
|
||||
""" Writes repair order state to 'Under Repair'
|
||||
@return: True
|
||||
@return: True
|
||||
"""
|
||||
self.write(cr, uid, ids, {'state': 'under_repair'})
|
||||
return True
|
||||
|
||||
def action_invoice_end(self, cr, uid, ids, context=None):
|
||||
""" Writes repair order state to 'Ready' if invoice method is Before repair.
|
||||
@return: True
|
||||
@return: True
|
||||
"""
|
||||
for order in self.browse(cr, uid, ids):
|
||||
val = {}
|
||||
|
@ -448,9 +448,9 @@ class mrp_repair(osv.osv):
|
|||
return True
|
||||
|
||||
def action_repair_end(self, cr, uid, ids, context=None):
|
||||
""" Writes repair order state to 'To be invoiced' if invoice method is
|
||||
""" Writes repair order state to 'To be invoiced' if invoice method is
|
||||
After repair else state is set to 'Ready'.
|
||||
@return: True
|
||||
@return: True
|
||||
"""
|
||||
for order in self.browse(cr, uid, ids):
|
||||
val = {}
|
||||
|
@ -470,7 +470,7 @@ class mrp_repair(osv.osv):
|
|||
|
||||
def action_repair_done(self, cr, uid, ids, context=None):
|
||||
""" Creates stock move and picking for repair order.
|
||||
@return: Picking ids.
|
||||
@return: Picking ids.
|
||||
"""
|
||||
res = {}
|
||||
move_obj = self.pool.get('stock.move')
|
||||
|
@ -516,7 +516,7 @@ class mrp_repair(osv.osv):
|
|||
'location_id': repair.location_id.id,
|
||||
'location_dest_id': repair.location_dest_id.id,
|
||||
'tracking_id': False,
|
||||
'state': 'assigned',
|
||||
'state': 'assigned',
|
||||
})
|
||||
wf_service.trg_validate(uid, 'stock.picking', picking, 'button_confirm', cr)
|
||||
self.write(cr, uid, [repair.id], {'state': 'done', 'picking_id': picking})
|
||||
|
@ -530,7 +530,7 @@ mrp_repair()
|
|||
|
||||
|
||||
class ProductChangeMixin(object):
|
||||
def product_id_change(self, cr, uid, ids, pricelist, product, uom=False,
|
||||
def product_id_change(self, cr, uid, ids, pricelist, product, uom=False,
|
||||
product_uom_qty=0, partner_id=False, guarantee_limit=False):
|
||||
""" On change of product it sets product quantity, tax account, name,
|
||||
uom of product, unit price and price subtotal.
|
||||
|
@ -574,7 +574,7 @@ class ProductChangeMixin(object):
|
|||
'message':
|
||||
"Couldn't find a pricelist line matching this product and quantity.\n"
|
||||
"You have to change either the product, the quantity or the pricelist."
|
||||
}
|
||||
}
|
||||
else:
|
||||
result.update({'price_unit': price, 'price_subtotal': price*product_uom_qty})
|
||||
|
||||
|
@ -594,7 +594,7 @@ class mrp_repair_line(osv.osv, ProductChangeMixin):
|
|||
""" Calculates amount.
|
||||
@param field_name: Name of field.
|
||||
@param arg: Argument
|
||||
@return: Dictionary of values.
|
||||
@return: Dictionary of values.
|
||||
"""
|
||||
res = {}
|
||||
cur_obj=self.pool.get('res.currency')
|
||||
|
@ -672,17 +672,17 @@ mrp_repair_line()
|
|||
class mrp_repair_fee(osv.osv, ProductChangeMixin):
|
||||
_name = 'mrp.repair.fee'
|
||||
_description = 'Repair Fees Line'
|
||||
|
||||
|
||||
def copy_data(self, cr, uid, id, default=None, context=None):
|
||||
if not default: default = {}
|
||||
default.update({'invoice_line_id': False, 'invoiced': False})
|
||||
return super(mrp_repair_fee, self).copy_data(cr, uid, id, default, context)
|
||||
|
||||
|
||||
def _amount_line(self, cr, uid, ids, field_name, arg, context):
|
||||
""" Calculates amount.
|
||||
@param field_name: Name of field.
|
||||
@param arg: Argument
|
||||
@return: Dictionary of values.
|
||||
@return: Dictionary of values.
|
||||
"""
|
||||
res = {}
|
||||
cur_obj = self.pool.get('res.currency')
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
<field name="osv">mrp.repair</field>
|
||||
<field name="on_create">True</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Activity -->
|
||||
<record id="act_draft" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_repair"/>
|
||||
|
@ -32,7 +32,7 @@
|
|||
<record id="act_repair_ready" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_repair"/>
|
||||
<field name="name">Ready Repair</field>
|
||||
<field name="kind">function</field>
|
||||
<field name="kind">function</field>
|
||||
<field name="action">action_repair_ready()</field>
|
||||
</record>
|
||||
<record id="act_cancel3" model="workflow.activity">
|
||||
|
@ -50,19 +50,12 @@
|
|||
<field name="action">wkf_repair_done()</field>
|
||||
<field name="join_mode">XOR</field>
|
||||
</record>
|
||||
<!-- <record id="act_invoice" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_repair"/>
|
||||
<field name="name">invoice</field>
|
||||
<field name="kind">subflow</field>
|
||||
<field name="subflow_id" search="[('name','=','account.invoice.basic')]"/>
|
||||
<field name="action">action_invoice_create()</field>
|
||||
</record> -->
|
||||
<record id="act_repair_start" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_repair"/>
|
||||
<field name="name">Start Repair</field>
|
||||
<field name="kind">function</field>
|
||||
<field name="kind">function</field>
|
||||
<field name="action">action_repair_start()</field>
|
||||
</record>
|
||||
</record>
|
||||
<record id="act_invoice_end" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_repair"/>
|
||||
<field name="name">invoice_end</field>
|
||||
|
@ -75,21 +68,6 @@
|
|||
<field name="kind">function</field>
|
||||
<field name="action">action_repair_end()</field>
|
||||
</record>
|
||||
|
||||
<!-- <record id="act_invoice_cancel" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_repair"/>
|
||||
<field name="name">invoice_cancel</field>
|
||||
<field name="flow_stop">True</field>
|
||||
<field name="kind">stopall</field>
|
||||
<field name="action">action_cancel()</field>
|
||||
</record>
|
||||
<record id="act_invoice_except" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_repair"/>
|
||||
<field name="name">invoice_except</field>
|
||||
<field name="kind">function</field>
|
||||
<field name="action">action_invoice_cancel()</field>
|
||||
</record> -->
|
||||
|
||||
<record id="act_cancel" model="workflow.activity">
|
||||
<field name="wkf_id" ref="wkf_repair"/>
|
||||
<field name="name">cancel</field>
|
||||
|
@ -106,25 +84,25 @@
|
|||
</record>
|
||||
|
||||
|
||||
<!-- Transistion -->
|
||||
|
||||
|
||||
<!-- Transistion -->
|
||||
|
||||
|
||||
<record id="trans_draft_confirm" model="workflow.transition">
|
||||
<field name="act_from" ref="act_draft"/>
|
||||
<field name="act_to" ref="act_confirm"/>
|
||||
<field name="signal">repair_confirm</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="trans_draft_cancel" model="workflow.transition">
|
||||
<field name="act_from" ref="act_draft"/>
|
||||
<field name="act_to" ref="act_cancel"/>
|
||||
<field name="signal">cancel</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="trans_confirm_wait_invoice" model="workflow.transition">
|
||||
<field name="act_from" ref="act_confirm"/>
|
||||
<field name="act_to" ref="act_wait_invoice"/>
|
||||
<field name="condition">invoice_method=='b4repair'</field>
|
||||
<field name="condition">invoice_method=='b4repair'</field>
|
||||
</record>
|
||||
|
||||
<record id="trans_confirm_wait_ship" model="workflow.transition">
|
||||
|
@ -133,17 +111,11 @@
|
|||
<field name="condition">(invoice_method=='after_repair' or invoice_method=='none')</field>
|
||||
</record>
|
||||
|
||||
<!-- <record id="trans_confirm_wait_invoice_shipping" model="workflow.transition">
|
||||
<field name="act_from" ref="act_wait_invoice"/>
|
||||
<field name="act_to" ref="act_invoice_end"/>
|
||||
<field name="condition">(invoice_method=='none')</field>
|
||||
</record> -->
|
||||
|
||||
<record id="trans_wait_invoice_invoice" model="workflow.transition">
|
||||
<field name="act_from" ref="act_wait_invoice"/>
|
||||
<field name="act_to" ref="act_invoice_end"/>
|
||||
<field name="signal">action_invoice_create</field>
|
||||
</record>
|
||||
</record>
|
||||
|
||||
<record id="trans_invoice_start_repair" model="workflow.transition">
|
||||
<field name="act_from" ref="act_invoice_end"/>
|
||||
|
@ -177,8 +149,8 @@
|
|||
|
||||
<record id="trans_repair_repair_end" model="workflow.transition">
|
||||
<field name="act_from" ref="act_repair_start"/>
|
||||
<field name="act_to" ref="act_repair_end"/>
|
||||
<field name="signal">action_repair_end</field>
|
||||
<field name="act_to" ref="act_repair_end"/>
|
||||
<field name="signal">action_repair_end</field>
|
||||
</record>
|
||||
|
||||
<record id="trans_reapir_end_done" model="workflow.transition">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,19 +15,19 @@
|
|||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import netsvc
|
||||
from osv import osv, fields
|
||||
from osv import osv, fields
|
||||
|
||||
class make_invoice(osv.osv_memory):
|
||||
_name = 'mrp.repair.make_invoice'
|
||||
_description = 'Make Invoice'
|
||||
|
||||
|
||||
_columns = {
|
||||
'group': fields.boolean('Group by partner invoice address'),
|
||||
'group': fields.boolean('Group by partner invoice address'),
|
||||
}
|
||||
|
||||
def make_invoices(self, cr, uid, ids, context):
|
||||
|
@ -35,15 +35,15 @@ class make_invoice(osv.osv_memory):
|
|||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param ids: List of IDs selected
|
||||
@param context: A standard dictionary
|
||||
@param ids: List of IDs selected
|
||||
@param context: A standard dictionary
|
||||
@return: Loads the view of new invoice(s).
|
||||
"""
|
||||
inv = self.browse(cr, uid, ids[0])
|
||||
order_obj = self.pool.get('mrp.repair')
|
||||
newinv = order_obj.action_invoice_create(cr, uid, context['active_ids'],
|
||||
group=inv.group,context=context)
|
||||
|
||||
order_obj = self.pool.get('mrp.repair')
|
||||
newinv = order_obj.action_invoice_create(cr, uid, context['active_ids'],
|
||||
group=inv.group,context=context)
|
||||
|
||||
return {
|
||||
'domain': [('id','in', newinv.values())],
|
||||
'name': 'Invoices',
|
||||
|
|
|
@ -36,7 +36,10 @@ With this module:
|
|||
'website': 'http://www.openerp.com',
|
||||
'depends': ['base', 'mrp'],
|
||||
'init_xml': [],
|
||||
'update_xml': ['security/ir.model.access.csv', 'mrp_subproduct_view.xml'],
|
||||
'update_xml': [
|
||||
'security/ir.model.access.csv',
|
||||
'mrp_subproduct_view.xml'
|
||||
],
|
||||
'demo_xml': [],
|
||||
'test': ['test/mrp_subproduct.yml'],
|
||||
'installable': True,
|
||||
|
|
|
@ -38,7 +38,6 @@
|
|||
'init_xml': [],
|
||||
'update_xml': [
|
||||
'res_company_view.xml'
|
||||
#'security/ir.model.access.csv',
|
||||
],
|
||||
'demo_xml': [
|
||||
'multi_company_demo.xml'
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data noupdate="1">
|
||||
<!-- Partner -->
|
||||
<!-- Partner -->
|
||||
<record id="base.main_partner" model="res.partner">
|
||||
<field name="name">OpenERP Corp.</field>
|
||||
</record>
|
||||
|
@ -20,8 +20,8 @@
|
|||
<record id="res_partner_odoo" model="res.partner">
|
||||
<field name="name">Odoo</field>
|
||||
</record>
|
||||
|
||||
<!-- Company -->
|
||||
|
||||
<!-- Company -->
|
||||
<record id="base.main_company" model="res.company">
|
||||
<field name="name">OpenERP Corp.</field>
|
||||
<field name="currency_id" ref="base.EUR"/>
|
||||
|
@ -56,7 +56,7 @@
|
|||
<field name="currency_id" ref="base.EUR"/>
|
||||
<field name="name">Odoo</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- User -->
|
||||
|
||||
<record id="res_users_editor_demo" model="res.users">
|
||||
|
@ -104,7 +104,7 @@
|
|||
<!--
|
||||
Resource: product.product
|
||||
-->
|
||||
|
||||
|
||||
<record id="product.product_product_0" model="product.product">
|
||||
<field name="company_id" ref="res_company_oerp_editor"/>
|
||||
</record>
|
||||
|
@ -312,11 +312,11 @@
|
|||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
<!--
|
||||
Resource: res.partner
|
||||
-->
|
||||
|
||||
|
||||
<record id="base.res_partner_asus" model="res.partner">
|
||||
<field name="company_id" ref="res_company_oerp_us"/>
|
||||
</record>
|
||||
|
@ -379,90 +379,7 @@
|
|||
</record>
|
||||
<record id="base.res_partner_accent" model="res.partner">
|
||||
<field name="company_id" ref="res_company_oerp_be"/>
|
||||
</record>
|
||||
|
||||
<!-- CRM -->
|
||||
<!--
|
||||
<record id="crm.crm_case_claim01" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_be"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_claim02" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_us"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_claim03" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_be"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_claim04" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_in"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_claim05" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_be"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_claim06" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_us"/>
|
||||
</record>
|
||||
|
||||
<record id="crm.crm_case_construstazunits0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_be"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_rdroundfundingunits0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_be"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_mediapoleunits0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_us"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_abcfuelcounits0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_in"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_dirtminingltdunits0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_us"/>
|
||||
</record>
|
||||
-->
|
||||
<!--For Bug Tracking-->
|
||||
<!--
|
||||
<record id="crm.crm_case_buginaccountsmodule0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_be"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_programnotgivingproperoutput0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_us"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_outputincorrect0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_us"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_problemloadingpage0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_be"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_pagenotfound0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_in"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_programmingerror0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_be"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_logicalerrorinprogram0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_be"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_constrainterror0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_us"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_errorinprogram0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_be"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_newfeaturestobeadded0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_be"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_addmenustothemodule0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_be"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_includeattendancesheetinproject0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_be"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_createnewobject0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_be"/>
|
||||
</record>
|
||||
<record id="crm.crm_case_improvereportsinhrms0" model="crm.case">
|
||||
<field name="company_id" ref="res_company_oerp_in"/>
|
||||
</record>
|
||||
-->
|
||||
</data>
|
||||
<data noupdate="1">
|
||||
<record id="multi_company_default_productopenerpus0" model="multi_company.default">
|
||||
|
|
|
@ -46,8 +46,7 @@
|
|||
"data/olap_security.xml",
|
||||
'security/ir.model.access.csv'
|
||||
],
|
||||
"demo_xml" : ["data/olap_demo.xml"
|
||||
],
|
||||
"demo_xml" : ["data/olap_demo.xml"],
|
||||
"active": False,
|
||||
"installable": True
|
||||
}
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<data>
|
||||
|
||||
<!-- Wizard view for the load data -->
|
||||
|
||||
|
||||
<record id="bi_load_db_form" model="ir.ui.view">
|
||||
<field name="name">bi.load.db.form</field>
|
||||
<field name="model">bi.load.db.wizard</field>
|
||||
|
@ -22,7 +22,7 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="act_bi_load_db_wizard" model="ir.actions.act_window">
|
||||
<field name="name">Load database Structure</field>
|
||||
<field name="res_model">bi.load.db.wizard</field>
|
||||
|
@ -33,10 +33,10 @@
|
|||
<field name="auto_refresh" eval="1"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Wizard For Olap Warehouse -->
|
||||
|
||||
|
||||
<record id="view_warehouse_bi" model="ir.ui.view">
|
||||
<field name="name">Olap Warehouse</field>
|
||||
<field name="model">olap.warehouse.wizard</field>
|
||||
|
@ -51,7 +51,7 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_olap_warehouse" model="ir.actions.act_window">
|
||||
<field name="name">Olap Warehouse</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
@ -60,7 +60,7 @@
|
|||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Olap Warehouse"
|
||||
action="action_olap_warehouse"
|
||||
|
@ -68,9 +68,9 @@
|
|||
sequence="51"
|
||||
parent="base.next_id_50"
|
||||
/>
|
||||
|
||||
|
||||
<!-- Wizard View for the parameters wizard -->
|
||||
|
||||
|
||||
<record id="view_config_bi" model="ir.ui.view">
|
||||
<field name="name">Parameters Configuration</field>
|
||||
<field name="model">olap.parameters.config.wizard</field>
|
||||
|
@ -83,7 +83,6 @@
|
|||
<newline/>
|
||||
<label align="0.0" string="This wizard will automatically configure the web client for Business Intelligence." width="200" colspan="2"/>
|
||||
</group>
|
||||
<!--separator string="" orientation="vertical" colspan="1" rowspan="12"/-->
|
||||
<group colspan="4">
|
||||
<separator string=" Business Intelligence Web Client" colspan="4"/>
|
||||
<field name="host_name" colspan="4"/>
|
||||
|
@ -99,21 +98,9 @@
|
|||
</group>
|
||||
</group>
|
||||
</form>
|
||||
<!--form string="Parameters Configure">
|
||||
<separator string="BI Web Client." colspan="4"/>
|
||||
<label string="This wizard will automatically configure the web client for BI." align="0.0" colspan="4"/>
|
||||
<field name="host_name" colspan="4"/>
|
||||
<field name="host_port" colspan="4"/>
|
||||
<separator string="" colspan="4"/>
|
||||
<label string="" colspan="2"/>
|
||||
<group col="4" colspan="2">
|
||||
<button special="cancel" string="Cancel" name="action_cancel" type="object" icon='gtk-cancel'/>
|
||||
<button name="action_config" string="Configure" icon='gtk-ok' type="object"/>
|
||||
</group>
|
||||
</form-->
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_config_bi_parameters" model="ir.actions.act_window">
|
||||
<field name="name">Parameters Configuration</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
|
@ -122,7 +109,7 @@
|
|||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Server Parameters"
|
||||
action="action_config_bi_parameters"
|
||||
|
@ -130,16 +117,16 @@
|
|||
sequence="50"
|
||||
parent="base.next_id_50"
|
||||
/>
|
||||
|
||||
|
||||
<record model="ir.actions.todo" id="config_auto_directory">
|
||||
<field name="name">Server Parameters Configuration</field>
|
||||
<field name="note">This wizard will configure the URL of the web client</field>
|
||||
<field name="action_id" ref="action_config_bi_parameters"/>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
<!-- Wizard view for the Auto Configuring the data -->
|
||||
|
||||
|
||||
<record id="bi_auto_configure_form" model="ir.ui.view">
|
||||
<field name="name">bi.auto.configure.form</field>
|
||||
<field name="model">bi.auto.configure.wizard</field>
|
||||
|
@ -154,7 +141,7 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="act_bi_auto_configure" model="ir.actions.act_window">
|
||||
<field name="name">Auto Configuration</field>
|
||||
<field name="res_model">bi.auto.configure.wizard</field>
|
||||
|
@ -165,13 +152,13 @@
|
|||
<field name="auto_refresh" eval="1"/>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Olap Schema
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_schema_tree">
|
||||
<field name="name">olap.schema.tree</field>
|
||||
<field name="model">olap.schema</field>
|
||||
|
@ -183,7 +170,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_schema_form">
|
||||
<field name="name">olap.schema.form</field>
|
||||
<field name="model">olap.schema</field>
|
||||
|
@ -218,19 +205,19 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_schema_form">
|
||||
<field name="name">Olap Schemas</field>
|
||||
<field name="res_model">olap.schema</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Olap Schema"
|
||||
action="action_olap_schema_form"
|
||||
id="menu_action_olap_schema_form"
|
||||
parent="menu_bi_conf_cubes"/>
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Olap Cubes Table
|
||||
# ------------------------------------------------------------------
|
||||
|
@ -268,23 +255,23 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_cube_table_form">
|
||||
<field name="name">Olap Cube Tables</field>
|
||||
<field name="res_model">olap.cube.table</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Olap Cubes Table"
|
||||
parent = "menu_bi_conf_cubes"
|
||||
action="action_olap_cube_table_form"
|
||||
id="menu_action_olap_cube_table_form"/>
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Olap Cubes
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_cube_tree">
|
||||
<field name="name">olap.cube.tree</field>
|
||||
<field name="model">olap.cube</field>
|
||||
|
@ -296,7 +283,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_cube_form">
|
||||
<field name="name">olap.cube.form</field>
|
||||
<field name="model">olap.cube</field>
|
||||
|
@ -310,24 +297,24 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_cube_form">
|
||||
<field name="name">Olap Cubes</field>
|
||||
<field name="res_model">olap.cube</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Olap Cubes"
|
||||
parent ="menu_bi_conf_cubes"
|
||||
action="action_olap_cube_form"
|
||||
id="menu_action_olap_cube_form"/>
|
||||
|
||||
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Olap Dimensions
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_dimension_tree">
|
||||
<field name="name">olap.dimension.tree</field>
|
||||
<field name="model">olap.dimension</field>
|
||||
|
@ -339,7 +326,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_dimension_form">
|
||||
<field name="name">olap.dimension.form</field>
|
||||
<field name="model">olap.dimension</field>
|
||||
|
@ -351,23 +338,23 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_dimension_form">
|
||||
<field name="name">Olap Dimensions</field>
|
||||
<field name="res_model">olap.dimension</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Olap Dimension"
|
||||
parent = "menu_bi_conf_cubes"
|
||||
action="action_olap_dimension_form"
|
||||
id="menu_action_olap_dimension_form"/>
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Olap Hierarchies
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_hierarchy_tree">
|
||||
<field name="name">olap.hierarchy.tree</field>
|
||||
<field name="model">olap.hierarchy</field>
|
||||
|
@ -379,7 +366,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_hierarchy_form">
|
||||
<field name="name">olap.hierarchy.form</field>
|
||||
<field name="model">olap.hierarchy</field>
|
||||
|
@ -389,32 +376,28 @@
|
|||
<field name="name" select="1" colspan="2"/>
|
||||
<field name="sequence" colspan="2"/>
|
||||
<field name="dimension_id" select="1" attrs="{'readonly':[('dimension_id','!=','')]}" colspan="4"/>
|
||||
<!-- <field name="field_name" select="2"/>-->
|
||||
|
||||
<field name="table_id" select="2" colspan="4" context="{'d_id':dimension_id}"/>
|
||||
<!-- <separator string="Levels" colspan="4"/>
|
||||
<field name="level_ids" colspan="4" nolabel="1"/>-->
|
||||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_hierarchy_form">
|
||||
<field name="name">Olap Hierarchies</field>
|
||||
<field name="res_model">olap.hierarchy</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Olap Hierarchy"
|
||||
parent = "menu_bi_conf_cubes"
|
||||
action="action_olap_hierarchy_form"
|
||||
id="menu_action_olap_hierarchy_form"/>
|
||||
|
||||
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Olap Levels
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_level_tree">
|
||||
<field name="name">olap.level.tree</field>
|
||||
<field name="model">olap.level</field>
|
||||
|
@ -431,7 +414,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_level_form">
|
||||
<field name="name">olap.level.form</field>
|
||||
<field name="model">olap.level</field>
|
||||
|
@ -450,24 +433,24 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_level_form">
|
||||
<field name="name">Olap Level</field>
|
||||
<field name="res_model">olap.level</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Olap Level"
|
||||
parent = "menu_bi_conf_cubes"
|
||||
action="action_olap_level_form"
|
||||
id="menu_action_olap_level_form"/>
|
||||
|
||||
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Olap Measure
|
||||
# ------------------------------------------------------------------
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_measure_tree">
|
||||
<field name="name">olap.measure.tree</field>
|
||||
<field name="model">olap.measure</field>
|
||||
|
@ -479,7 +462,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_measure_form">
|
||||
<field name="name">olap.measure.form</field>
|
||||
<field name="model">olap.measure</field>
|
||||
|
@ -507,19 +490,19 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_measure_form">
|
||||
<field name="name">Olap Measures</field>
|
||||
<field name="res_model">olap.measure</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Olap Measures"
|
||||
parent = "menu_bi_conf_cubes"
|
||||
action="action_olap_measure_form"
|
||||
id="menu_action_olap_measure_form"/>
|
||||
|
||||
|
||||
# ------------------------------------------------------------------
|
||||
# Olap Saved Query
|
||||
# ------------------------------------------------------------------
|
||||
|
@ -538,7 +521,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_saved_query_form_mdx">
|
||||
<field name="name">olap.saved.query.mdx</field>
|
||||
<field name="model">olap.saved.query</field>
|
||||
|
@ -554,7 +537,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_saved_query_form">
|
||||
<field name="name">olap.saved.query.form</field>
|
||||
<field name="model">olap.saved.query</field>
|
||||
|
@ -576,22 +559,22 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_saved_query_form">
|
||||
<field name="name">Olap Saved Query</field>
|
||||
<field name="res_model">olap.saved.query</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form,mdx</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="Olap Saved Query"
|
||||
parent = "menu_bi_conf_tools"
|
||||
action="action_olap_saved_query_form"
|
||||
id="menu_action_olap_saved_query_form"/>
|
||||
|
||||
|
||||
<!-- All Logs -->
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_query_logs_tree">
|
||||
<field name="name">olap.query.logs</field>
|
||||
<field name="model">olap.query.logs</field>
|
||||
|
@ -605,7 +588,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_query_logs_form">
|
||||
<field name="name">olap.query.logs.form</field>
|
||||
<field name="model">olap.query.logs</field>
|
||||
|
@ -622,21 +605,21 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_query_logs_form">
|
||||
<field name="name">All Logs</field>
|
||||
<field name="res_model">olap.query.logs</field>
|
||||
<field name="view_type">form</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="All Logs"
|
||||
action="action_olap_query_logs_form"
|
||||
id="menu_action_olap_query_logs_form"
|
||||
parent="menu_bi_conf_tools"/>
|
||||
|
||||
|
||||
<!-- All Logs / My logs -->
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_query_logs_my_tree">
|
||||
<field name="name">olap.query.logs</field>
|
||||
<field name="model">olap.query.logs</field>
|
||||
|
@ -649,7 +632,7 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_query_logs_my_tree">
|
||||
<field name="name">olap.query.logs</field>
|
||||
<field name="model">olap.query.logs</field>
|
||||
|
@ -662,9 +645,9 @@
|
|||
</tree>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Query Logs -->
|
||||
|
||||
|
||||
<record model="ir.ui.view" id="view_olap_query_logs_my_form">
|
||||
<field name="name">olap.query.logs.form</field>
|
||||
<field name="model">olap.query.logs</field>
|
||||
|
@ -680,7 +663,7 @@
|
|||
</form>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="ir.actions.act_window" id="action_olap_query_logs_my_form">
|
||||
<field name="name">My Logs</field>
|
||||
<field name="res_model">olap.query.logs</field>
|
||||
|
@ -688,12 +671,12 @@
|
|||
<field name="view_mode">tree,form,mdx</field>
|
||||
<field name="domain">[('user_id','=',uid)]</field>
|
||||
</record>
|
||||
|
||||
|
||||
<menuitem
|
||||
name="My Logs"
|
||||
action="action_olap_query_logs_my_form"
|
||||
id="menu_action_olap_query_logs_my_form"
|
||||
parent="menu_action_olap_query_logs_form"/>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -6,52 +6,42 @@
|
|||
<field name="osv">olap.schema</field>
|
||||
<field name="on_create">True</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="workflow.activity" id="act_none">
|
||||
<field name="wkf_id" ref="wkf_schema"/>
|
||||
<field name="flow_start">True</field>
|
||||
<field name="name">none</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="workflow.activity" id="act_dbconnect">
|
||||
<field name="wkf_id" ref="wkf_schema"/>
|
||||
<field name="name">dbconnect</field>
|
||||
<field name="kind">function</field>
|
||||
<field name="action">action_dbconnect()</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="workflow.activity" id="act_dbload">
|
||||
<field name="wkf_id" ref="wkf_schema"/>
|
||||
<field name="name">dbload</field>
|
||||
<field name="kind">function</field>
|
||||
<field name="action">action_dbload()</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="workflow.activity" id="act_dbconfigure">
|
||||
<field name="wkf_id" ref="wkf_schema"/>
|
||||
<field name="name">dbconfigure</field>
|
||||
<field name="kind">function</field>
|
||||
<field name="action">action_dbconfigure()</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="workflow.activity" id="act_dbready">
|
||||
<field name="wkf_id" ref="wkf_schema"/>
|
||||
<field name="flow_stop">True</field>
|
||||
<field name="name">dbready</field>
|
||||
<field name="kind">function</field>
|
||||
<field name="action">action_dbready()</field>
|
||||
<field name="action">action_dbready()</field>
|
||||
</record>
|
||||
<!--
|
||||
<record model="workflow.activity" id="act_dbdone">
|
||||
<field name="wkf_id" ref="wkf_schema"/>
|
||||
<field name="flow_stop">True</field>
|
||||
<field name="name">db_done</field>
|
||||
<field name="kind">function</field>
|
||||
<field name="action">action_done()</field>
|
||||
</record>
|
||||
-->
|
||||
|
||||
|
||||
<record model="workflow.transition" id="trans_none_dbconnect">
|
||||
<field name="act_from" ref="act_none"/>
|
||||
<field name="act_to" ref="act_dbconnect"/>
|
||||
|
@ -69,19 +59,12 @@
|
|||
<field name="act_to" ref="act_dbconfigure"/>
|
||||
<field name="signal">dbconfigure</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="workflow.transition" id="trans_dbconfigure_dbready">
|
||||
<field name="act_from" ref="act_dbconfigure"/>
|
||||
<field name="act_to" ref="act_dbready"/>
|
||||
<field name="signal">dbready</field>
|
||||
</record>
|
||||
<!--
|
||||
<record model="workflow.transition" id="trans_dbready_done">
|
||||
<field name="act_from" ref="act_dbready"/>
|
||||
<field name="act_to" ref="act_dbdone"/>
|
||||
<field name="signal">dbdone</field>
|
||||
</record>
|
||||
-->
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -77,8 +77,6 @@
|
|||
<field name="fact_database_id" select="2"/>
|
||||
<field name="active"/>
|
||||
<field name="hide"/>
|
||||
<!-- <button name="show_col_view" string="Columns" type="object"/>-->
|
||||
|
||||
<button name="hide_col" string="Hide" type="object"/>
|
||||
<button name="show_col" string="Show" type="object"/>
|
||||
</tree>
|
||||
|
|
|
@ -3,53 +3,42 @@
|
|||
<data>
|
||||
|
||||
<wizard
|
||||
string="Query Builder"
|
||||
model="olap.schema"
|
||||
name="olap.query_builder"
|
||||
menu= "False"
|
||||
multi="True"
|
||||
id="bi_conf_cube_query_builder"/>
|
||||
string="Query Builder"
|
||||
model="olap.schema"
|
||||
name="olap.query_builder"
|
||||
menu= "False"
|
||||
multi="True"
|
||||
id="bi_conf_cube_query_builder"/>
|
||||
|
||||
<wizard
|
||||
string="Load Tables"
|
||||
model="olap.schema"
|
||||
name="olap.load.table"
|
||||
menu= "False"
|
||||
multi="True"
|
||||
id="bi_menu_olap_load_table"/>
|
||||
|
||||
<!-- <wizard
|
||||
string="Load Tables"
|
||||
model="olap.schema"
|
||||
name="olap.load.table"
|
||||
menu= "False"
|
||||
multi="True"
|
||||
id="bi_menu_olap_load_table"/>-->
|
||||
<wizard
|
||||
string="Open Configuration"
|
||||
model="olap.schema"
|
||||
name="olap.load.configuration.table"
|
||||
menu= "False"
|
||||
multi="True"
|
||||
id="bi_load_configuration_table"/>
|
||||
|
||||
<wizard
|
||||
string="Configure from Application"
|
||||
model="olap.schema"
|
||||
name="olap.application.configuration"
|
||||
multi="True"
|
||||
id="bi_application_configuration"/>
|
||||
|
||||
<wizard
|
||||
string="Load Tables"
|
||||
model="olap.schema"
|
||||
name="olap.load.table"
|
||||
menu= "False"
|
||||
multi="True"
|
||||
id="bi_menu_olap_load_table"/>
|
||||
|
||||
<wizard
|
||||
string="Open Configuration"
|
||||
model="olap.schema"
|
||||
name="olap.load.configuration.table"
|
||||
menu= "False"
|
||||
multi="True"
|
||||
id="bi_load_configuration_table"/>
|
||||
|
||||
<wizard
|
||||
string="Configure from Application"
|
||||
model="olap.schema"
|
||||
name="olap.application.configuration"
|
||||
multi="True"
|
||||
id="bi_application_configuration"/>
|
||||
|
||||
<wizard
|
||||
string="Test Connection"
|
||||
model="olap.fact.database"
|
||||
name="olap.fact.database.test_connection"
|
||||
menu="False"
|
||||
id="bi_test_connection"/>
|
||||
|
||||
<wizard
|
||||
string="Test Connection"
|
||||
model="olap.fact.database"
|
||||
name="olap.fact.database.test_connection"
|
||||
menu="False"
|
||||
id="bi_test_connection"/>
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -203,7 +203,7 @@ class olap_schema(osv.osv ):
|
|||
'state': lambda * a: 'none',
|
||||
'configure': lambda * a: False,
|
||||
'ready': lambda * a: False
|
||||
}
|
||||
}
|
||||
|
||||
def action_dbconnect(self, cr, uid, ids, context = {}):
|
||||
""" Connect DB with postgres ,Or MySql,Or Orcale
|
||||
|
@ -497,7 +497,7 @@ class olap_database_columns(osv.osv):
|
|||
'text': 'Text',
|
||||
'date': 'Date',
|
||||
'time': 'TimeStamp without Time Zone',
|
||||
'number': 'NUMBER',
|
||||
'number': 'NUMBER',
|
||||
}
|
||||
|
||||
def _datatypes_get(self, *args, **argv):
|
||||
|
@ -718,9 +718,9 @@ class olap_database_columns(osv.osv):
|
|||
if context['parent_id']:
|
||||
parent_id = context['parent_id']
|
||||
val = {
|
||||
'cube_table_id': parent_id,
|
||||
'table_id': table_id,
|
||||
'field_id': ids[0]
|
||||
'cube_table_id': parent_id,
|
||||
'table_id': table_id,
|
||||
'field_id': ids[0]
|
||||
}
|
||||
id = self.pool.get('olap.cube.table.line').create(cr, uid, val, context)
|
||||
|
||||
|
@ -993,7 +993,7 @@ class olap_cube_table(osv.osv):
|
|||
relation = 'olap.database.columns',
|
||||
string = 'Available Tables',
|
||||
type = "many2many"
|
||||
),
|
||||
),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
|
@ -1070,8 +1070,8 @@ class olap_cube(osv.osv):
|
|||
}
|
||||
|
||||
_defaults = {
|
||||
'schema_id': _set_schema
|
||||
}
|
||||
'schema_id': _set_schema
|
||||
}
|
||||
olap_cube()
|
||||
|
||||
|
||||
|
@ -1091,8 +1091,8 @@ class olap_query_logs(osv.osv):
|
|||
}
|
||||
|
||||
_defaults = {
|
||||
'count':lambda * args: 0
|
||||
}
|
||||
'count':lambda * args: 0
|
||||
}
|
||||
olap_query_logs()
|
||||
|
||||
|
||||
|
@ -1120,7 +1120,7 @@ class olap_dimension(osv.osv):
|
|||
'hierarchy_ids': fields.one2many('olap.hierarchy', 'dimension_id', 'Hierarchies'),
|
||||
}
|
||||
_defaults = {
|
||||
'cube_id': _set_cube,
|
||||
'cube_id': _set_cube,
|
||||
}
|
||||
|
||||
olap_dimension()
|
||||
|
@ -1414,15 +1414,15 @@ class olap_saved_query(osv.osv):
|
|||
_decription = "Olap Saved Query"
|
||||
|
||||
_columns = {
|
||||
'name': fields.text('Query Name', size = 64),
|
||||
'user_id': fields.many2one('res.users', 'User'),
|
||||
'query': fields.text('Query', required = True),
|
||||
'cube_id': fields.many2one('olap.cube', 'Cube', required = True),
|
||||
'mdx_id': fields.char('Module', size=64),
|
||||
'schema_id': fields.many2one('olap.schema', 'Schema', required = True),
|
||||
'time': fields.datetime('Time', required = True),
|
||||
'axis_keys': fields.text('Axis Keys'),
|
||||
}
|
||||
'name': fields.text('Query Name', size = 64),
|
||||
'user_id': fields.many2one('res.users', 'User'),
|
||||
'query': fields.text('Query', required = True),
|
||||
'cube_id': fields.many2one('olap.cube', 'Cube', required = True),
|
||||
'mdx_id': fields.char('Module', size=64),
|
||||
'schema_id': fields.many2one('olap.schema', 'Schema', required = True),
|
||||
'time': fields.datetime('Time', required = True),
|
||||
'axis_keys': fields.text('Axis Keys'),
|
||||
}
|
||||
|
||||
olap_saved_query()
|
||||
# Wizard for the Load Data Structure
|
||||
|
@ -1865,11 +1865,11 @@ class bi_auto_configure_wizard(osv.osv_memory):
|
|||
|
||||
_columns = {
|
||||
'name': fields.char('Fact Name' , size = 64, readonly = True),
|
||||
}
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'name': _get_name,
|
||||
}
|
||||
'name': _get_name,
|
||||
}
|
||||
|
||||
def action_load(self, cr, uid, ids, context = None):
|
||||
"""
|
||||
|
@ -2078,12 +2078,12 @@ class olap_warehouse_wizard(osv.osv_memory):
|
|||
return {'type': 'ir.actions.act_window_close' }
|
||||
|
||||
_columns = {
|
||||
'query': fields.text('Query', readonly=True),
|
||||
}
|
||||
'query': fields.text('Query', readonly=True),
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'query': _get_queries,
|
||||
}
|
||||
}
|
||||
|
||||
olap_warehouse_wizard()
|
||||
|
||||
|
@ -2152,14 +2152,14 @@ class olap_parameters_config_wizard(osv.osv_memory):
|
|||
its not clear.", required = True),
|
||||
'config_logo': fields.binary('Image', readonly=True),
|
||||
'progress': fields.float('Configuration Progress', readonly=True),
|
||||
}
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'host_name': _get_host,
|
||||
'host_port': _get_port,
|
||||
'progress': _progress,
|
||||
'config_logo': _get_image,
|
||||
}
|
||||
}
|
||||
|
||||
def action_cancel(self, cr, uid, ids, conect = None):
|
||||
"""
|
||||
|
@ -2171,11 +2171,11 @@ class olap_parameters_config_wizard(osv.osv_memory):
|
|||
"""
|
||||
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.actions.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.actions.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
|
||||
def action_config(self, cr, uid, ids, context = None):
|
||||
|
@ -2203,11 +2203,11 @@ class olap_parameters_config_wizard(osv.osv_memory):
|
|||
':' + (conf.host_port or '8080') + '/designer'})
|
||||
|
||||
return {
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.actions.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
'view_type': 'form',
|
||||
"view_mode": 'form',
|
||||
'res_model': 'ir.actions.configuration.wizard',
|
||||
'type': 'ir.actions.act_window',
|
||||
'target':'new',
|
||||
}
|
||||
|
||||
olap_parameters_config_wizard()
|
||||
|
|
|
@ -26,7 +26,7 @@ class olap_query_logs_clear(osv.osv_memory):
|
|||
_description = "Olap Query Logs Clear"
|
||||
|
||||
_columns = {
|
||||
'user_name':fields.char('User', size=64, required=True, readonly=True),
|
||||
'user_name':fields.char('User', size=64, required=True, readonly=True),
|
||||
}
|
||||
|
||||
def _getdata(self, cr, uid, context={}):
|
||||
|
@ -35,7 +35,7 @@ class olap_query_logs_clear(osv.osv_memory):
|
|||
|
||||
_defaults = {
|
||||
'user_name': _getdata
|
||||
}
|
||||
}
|
||||
|
||||
def clear_logs(self, cr, uid, part, context={}):
|
||||
"""
|
||||
|
@ -52,11 +52,11 @@ class olap_query_logs_clear(osv.osv_memory):
|
|||
if id2:
|
||||
id2 = data_obj.browse(cr, uid, id2, context=context).res_id
|
||||
value = {
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'olap.query.logs.clear.msg',
|
||||
'views': [(id2, 'form'), (False, 'tree'), (False, 'calendar'), (False, 'graph')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'olap.query.logs.clear.msg',
|
||||
'views': [(id2, 'form'), (False, 'tree'), (False, 'calendar'), (False, 'graph')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'target': 'new'
|
||||
}
|
||||
return value
|
||||
|
|
|
@ -33,20 +33,14 @@ import netsvc
|
|||
class wizard_load_configured_table(wizard.interface):
|
||||
def _get_table_data(self, cr, uid, data, context={}):
|
||||
pool_obj = pooler.get_pool(cr.dbname)
|
||||
|
||||
# vals={}
|
||||
# vals['configure']=True
|
||||
# vals['state']='dbconfigure'
|
||||
# pooler.get_pool(cr.dbname).get('olap.schema').write(cr,uid,data['id'],vals)
|
||||
|
||||
wf_service = netsvc.LocalService('workflow')
|
||||
wf_service.trg_validate(uid, 'olap.schema', data['id'], 'dbconfigure', cr)
|
||||
|
||||
|
||||
lines=pool_obj.get('olap.schema').read(cr, uid, data['id'],context={})
|
||||
fact_ids=pool_obj.get('olap.database.tables').search(cr, uid, ([('fact_database_id','=',lines['database_id'][0])]),context={})
|
||||
model_data_ids = pool_obj.get('ir.model.data').search(cr,uid,[('model','=','ir.ui.view'),('name','=','view_olap_database_tables_form')],context={})
|
||||
resource_id = pool_obj.get('ir.model.data').read(cr,uid,model_data_ids,fields=['res_id'])[0]['res_id']
|
||||
|
||||
|
||||
return {
|
||||
'domain': "[('id','in', ["+','.join(map(str,fact_ids))+"])]",
|
||||
'name': 'Database Tables',
|
||||
|
@ -56,7 +50,7 @@ class wizard_load_configured_table(wizard.interface):
|
|||
'views': [(False,'tree'),(resource_id,'form')],
|
||||
'type': 'ir.actions.act_window'
|
||||
}
|
||||
|
||||
|
||||
states = {
|
||||
'init' : {
|
||||
'actions' : [],
|
||||
|
|
|
@ -101,7 +101,7 @@ def olap_db_connect(self,cr,uid,part,context={}):
|
|||
WHERE table_schema = 'public'""")
|
||||
|
||||
for col in cr_db.fetchall():
|
||||
val={
|
||||
val = {
|
||||
'table_id': tables[col[0]],
|
||||
'column_db_name': col[1],
|
||||
'type': col[2],
|
||||
|
@ -126,7 +126,7 @@ def olap_db_connect(self,cr,uid,part,context={}):
|
|||
constraint_type = 'PRIMARY KEY')""")
|
||||
print "Updating the Primary Key Constraint"
|
||||
for constraint in cr_db.fetchall():
|
||||
val={
|
||||
val = {
|
||||
'primary_key':True
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ def olap_db_connect(self,cr,uid,part,context={}):
|
|||
constraint_type = 'FOREIGN KEY')""")
|
||||
|
||||
for constraint in cr_db.fetchall():
|
||||
val={
|
||||
val = {
|
||||
'related_to':tables[for_key[constraint[2]]]
|
||||
}
|
||||
id_to_write=filter(lambda x:(int(cols[x][1])==int(tables[constraint[0]])and (constraint[1]==cols[x][0])),cols)
|
||||
|
@ -209,7 +209,7 @@ def olap_db_connect(self,cr,uid,part,context={}):
|
|||
|
||||
for col in cr_db.fetchall():
|
||||
|
||||
val={
|
||||
val = {
|
||||
'table_id': tables[col[0]],
|
||||
'column_db_name': col[1],
|
||||
'type': col[2],
|
||||
|
@ -237,14 +237,14 @@ def olap_db_connect(self,cr,uid,part,context={}):
|
|||
for constraint in cr_db.fetchall():
|
||||
|
||||
if constraint[0]:
|
||||
val={
|
||||
'related_to':tables[constraint[1]]
|
||||
}
|
||||
val = {
|
||||
'related_to':tables[constraint[1]]
|
||||
}
|
||||
else:
|
||||
|
||||
val={
|
||||
'primary_key':True
|
||||
}
|
||||
val = {
|
||||
'primary_key':True
|
||||
}
|
||||
id_to_write=filter(lambda x:(int(cols[x][1])==int(tables[constraint[3]])and(constraint[2]==cols[x][0])),cols)
|
||||
col_id=tcol.write(cr,uid,int(id_to_write[0]),val,context)
|
||||
|
||||
|
@ -304,7 +304,7 @@ def olap_db_connect(self,cr,uid,part,context={}):
|
|||
type_col='varchar'
|
||||
else:
|
||||
type_col=col[2]
|
||||
val={
|
||||
val = {
|
||||
'table_id': tables[col[0]],
|
||||
'column_db_name': col[1],
|
||||
'type': type_col,
|
||||
|
@ -331,7 +331,7 @@ def olap_db_connect(self,cr,uid,part,context={}):
|
|||
temp = cr_db.fetchall()
|
||||
pk_table = {}
|
||||
for constraint in temp:
|
||||
val={
|
||||
val = {
|
||||
'primary_key' : True
|
||||
}
|
||||
pk_table[constraint[2]] = constraint[0]
|
||||
|
@ -364,7 +364,7 @@ def olap_db_connect(self,cr,uid,part,context={}):
|
|||
for constraint in temp:
|
||||
rel_constraint_name=constraints_map[constraint[2]]
|
||||
req_table = pk_table[rel_constraint_name]
|
||||
val={
|
||||
val = {
|
||||
'related_to' : tables[req_table]
|
||||
}
|
||||
id_to_write=filter(lambda x:(int(cols[x][1])==int(tables[constraint[0]])and (constraint[1]==cols[x][0])),cols)
|
||||
|
|
|
@ -136,15 +136,13 @@ query_builder_form = """<?xml version="1.0"?>
|
|||
<field name="mdx_query_output" colspan="4" height="100" width="800"/>
|
||||
</form>"""
|
||||
query_builder_fields={
|
||||
|
||||
|
||||
'dimension':{'string':'Dimension','type':'text'},
|
||||
'hierarchy':{'string':'Hiearchy','type':'text'},
|
||||
'level':{'string':'Level','type':'text'},
|
||||
'measure':{'string':'Measure','type':'text'},
|
||||
'mdx_query':{'string':'MDX Query','type':'text'},
|
||||
'mdx_query_output':{'string':'MDX Query Output','type':'text'},
|
||||
}
|
||||
'dimension':{'string':'Dimension','type':'text'},
|
||||
'hierarchy':{'string':'Hiearchy','type':'text'},
|
||||
'level':{'string':'Level','type':'text'},
|
||||
'measure':{'string':'Measure','type':'text'},
|
||||
'mdx_query':{'string':'MDX Query','type':'text'},
|
||||
'mdx_query_output':{'string':'MDX Query Output','type':'text'},
|
||||
}
|
||||
|
||||
query_builder_fetch_form = """<?xml version="1.0"?>
|
||||
<form string="Cube Fetcher">
|
||||
|
@ -185,10 +183,8 @@ def _execute_mdx(self, cr, uid, data, context):
|
|||
ok = True
|
||||
if not ok:
|
||||
continue
|
||||
#print ' '*COLSPAN,
|
||||
output =' '*COLSPAN
|
||||
log.add(output)
|
||||
# print (('%-'+str(ROWSPAN)+'s ' ) * len(axis[1])) % tuple(map(lambda x: str(len(x[0])==i and x[1] or ''),axis[1]))
|
||||
output=(('%-'+str(ROWSPAN)+'s ' ) * len(axis[1])) % tuple(map(lambda x: str(len(x[0])==i and x[1] or ''),axis[1]))
|
||||
log.add(output)
|
||||
|
||||
|
@ -197,23 +193,18 @@ def _execute_mdx(self, cr, uid, data, context):
|
|||
print "--------------------------------------",x
|
||||
temp=(axis[0].pop(0)[1])
|
||||
print "--------------------------------------",temp
|
||||
# print ('%-'+str(COLSPAN)+'s')% (' '*(len(axis[0][0][0])-1)*2 + (temp),),
|
||||
output =('%-'+str(COLSPAN)+'s')% (str(x)+str(temp))
|
||||
log.add("\n")
|
||||
log.add(output)
|
||||
#output=(temp)
|
||||
|
||||
for row in col:
|
||||
if row==[False]:
|
||||
# print ('%-'+str(ROWSPAN)+'s')%('',),
|
||||
output=('%-'+str(ROWSPAN)+'s')%('')
|
||||
log.add(output)
|
||||
|
||||
else:
|
||||
# print ('%-'+str(ROWSPAN)+'s')%(row,),
|
||||
output=('%-'+str(ROWSPAN)+'s')%(row)
|
||||
log.add(output)
|
||||
#print
|
||||
log.add("\n")
|
||||
return {'mdx_query_output':log()}
|
||||
|
||||
|
|
|
@ -68,10 +68,10 @@ cube table and cube table line
|
|||
<field name="fact_database_id" ref="fact_databases_BI"/>
|
||||
<field name="active">True</field>
|
||||
</record>
|
||||
|
||||
|
||||
<!-- Olap Database Columns -->
|
||||
|
||||
|
||||
|
||||
<record model="olap.database.columns" id="crm_case_id">
|
||||
<field name="name">id</field>
|
||||
<field name="column_db_name">id</field>
|
||||
|
@ -95,7 +95,7 @@ cube table and cube table line
|
|||
<field name="active">True</field>
|
||||
<field name="related_to" ref="table_res_partner"/>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="olap.database.columns" id="crm_case_planned_cost">
|
||||
<field name="name">id</field>
|
||||
<field name="column_db_name">id</field>
|
||||
|
@ -144,7 +144,7 @@ cube table and cube table line
|
|||
<field name="type">int4</field>
|
||||
<field name="table_id" ref="table_crm_case"/>
|
||||
<field name="related_to" ref="table_res_partner"/>
|
||||
</record>
|
||||
</record>
|
||||
|
||||
<record model="olap.database.columns" id="crm_case_canal_id">
|
||||
<field name="name">canal_id</field>
|
||||
|
@ -265,7 +265,7 @@ cube table and cube table line
|
|||
DIMENSION Sections
|
||||
|
||||
-->
|
||||
|
||||
|
||||
<record model="olap.dimension" id="dimension_crm_section">
|
||||
<field name="name">Sections</field>
|
||||
<field name="cube_id" ref="cube_crm"/>
|
||||
|
@ -378,7 +378,7 @@ Category
|
|||
</record>
|
||||
|
||||
|
||||
|
||||
|
||||
<record model="olap.dimension" id="dimension_crm_channel">
|
||||
<field name="name">Channels</field>
|
||||
<field name="cube_id" ref="cube_crm"/>
|
||||
|
@ -428,7 +428,7 @@ Measures
|
|||
<field name="value_sql">avg(crm_case.planned_cost)</field>
|
||||
<field name="formatstring">cr_postfix_comma</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="olap.measure" id="measure_planned_revenue">
|
||||
<field name="name">Planned Revenue</field>
|
||||
<field name="cube_id" ref="cube_crm"/>
|
||||
|
@ -438,7 +438,7 @@ Measures
|
|||
<field name="agregator">sum</field>
|
||||
<field name="formatstring">cr_postfix_comma</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="olap.measure" id="measure_planned_revenue">
|
||||
<field name="name">Planned Revenue</field>
|
||||
<field name="cube_id" ref="cube_crm"/>
|
||||
|
@ -447,7 +447,7 @@ Measures
|
|||
<field name="table_name">crm_case</field>
|
||||
<field name="agregator">sum</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record model="olap.measure" id="measure_probability">
|
||||
<field name="name">Probability</field>
|
||||
<field name="cube_id" ref="cube_crm"/>
|
||||
|
@ -456,7 +456,7 @@ Measures
|
|||
<field name="table_name">crm_case</field>
|
||||
<field name="agregator">sum</field>
|
||||
</record>
|
||||
d
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- encoding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -39,15 +39,15 @@ field1 = {
|
|||
|
||||
|
||||
class wizard_olap_extract(wizard.interface):
|
||||
|
||||
|
||||
def zipper(self,zipname,filename,mode="a"):
|
||||
z = zipfile.ZipFile(zipname+".zip", mode)
|
||||
z.write(filename)
|
||||
print "\n",z.printdir()
|
||||
|
||||
|
||||
|
||||
|
||||
def write_csv(self,filename,content=[]):
|
||||
fid = open(filename, 'w')
|
||||
fid = open(filename, 'w')
|
||||
if fid == -1:
|
||||
print 'File: temp.csv not found or could not be opened'
|
||||
return False
|
||||
|
@ -55,20 +55,20 @@ class wizard_olap_extract(wizard.interface):
|
|||
writer=csv.writer(fid, 'TINY',delimiter=',')
|
||||
for row in content:
|
||||
writer.writerow(row)
|
||||
fid.close
|
||||
fid.close
|
||||
return True
|
||||
|
||||
|
||||
def table_depth(self,cr,uid,list=[],context={}):
|
||||
|
||||
res={}
|
||||
templeft={}
|
||||
tempright={}
|
||||
for table_id in list:
|
||||
lines=pooler.get_pool(cr.dbname).get('olap.cube.table').browse(cr, uid,table_id,context)
|
||||
lines=pooler.get_pool(cr.dbname).get('olap.cube.table').browse(cr, uid,table_id,context)
|
||||
res[str(lines.id)] = ["cubetable_"+str(lines.id),lines.name and lines.name or '',lines.table_alias and lines.table_alias or '',lines.key_left and lines.key_left or '',lines.key_right and lines.key_right or '',lines.table_left_id.id and "cubetable_"+str(lines.table_left_id.id) or '',lines.table_right_id.id and "cubetable_"+str(lines.table_right_id.id) or '']
|
||||
if(lines.table_left_id.id):
|
||||
templeft = self.table_depth(cr,uid,[lines.table_left_id.id],context)
|
||||
|
||||
|
||||
if templeft:
|
||||
for temp in templeft:
|
||||
if not res.has_key(temp):
|
||||
|
@ -76,24 +76,24 @@ class wizard_olap_extract(wizard.interface):
|
|||
|
||||
|
||||
if(lines.table_right_id.id):
|
||||
tempright = self.table_depth(cr,uid,[lines.table_right_id.id],context)
|
||||
|
||||
tempright = self.table_depth(cr,uid,[lines.table_right_id.id],context)
|
||||
|
||||
if tempright:
|
||||
for temp in tempright:
|
||||
if not res.has_key(temp):
|
||||
res[temp]= tempright[temp]
|
||||
return res
|
||||
|
||||
|
||||
|
||||
|
||||
def _extract_schema(self, cr, uid, data, context={}):
|
||||
|
||||
_name = data['form']['module_name']
|
||||
_modulename = "olap_"+_name
|
||||
|
||||
|
||||
dirname = _modulename
|
||||
if not os.path.isdir("./addons/" + dirname + "/"):
|
||||
os.mkdir("./addons/" + dirname + "/")
|
||||
|
||||
os.mkdir("./addons/" + dirname + "/")
|
||||
|
||||
os.chdir("./addons/"+dirname)
|
||||
|
||||
_init = "import %s" % _modulename
|
||||
|
@ -101,17 +101,17 @@ class wizard_olap_extract(wizard.interface):
|
|||
f.write(_init)
|
||||
f.close()
|
||||
self.zipper(_modulename, "__init__.py","w")
|
||||
|
||||
|
||||
_init_files = {
|
||||
"1":"olap.fact.database.csv",
|
||||
"2":"olap.schema.csv",
|
||||
"5":"olap.cube.table.csv",
|
||||
"6":"olap.cube.csv",
|
||||
"7":"olap.dimension.csv",
|
||||
"8":"olap.hierarchy.csv",
|
||||
"9":"olap.level.csv",
|
||||
"10":"olap.measure.csv"
|
||||
}
|
||||
"1":"olap.fact.database.csv",
|
||||
"2":"olap.schema.csv",
|
||||
"5":"olap.cube.table.csv",
|
||||
"6":"olap.cube.csv",
|
||||
"7":"olap.dimension.csv",
|
||||
"8":"olap.hierarchy.csv",
|
||||
"9":"olap.level.csv",
|
||||
"10":"olap.measure.csv"
|
||||
}
|
||||
_init_xml = """"%(1)s",
|
||||
"%(2)s",
|
||||
"%(5)s",
|
||||
|
@ -121,7 +121,7 @@ class wizard_olap_extract(wizard.interface):
|
|||
"%(9)s",
|
||||
"%(10)s",
|
||||
""" % _init_files
|
||||
|
||||
|
||||
data['modulename'] = _modulename
|
||||
data['init_xml'] = _init_xml
|
||||
|
||||
|
@ -144,36 +144,36 @@ class wizard_olap_extract(wizard.interface):
|
|||
|
||||
f = open("__terp__.py","w")
|
||||
f.write(_terp)
|
||||
f.close()
|
||||
self.zipper(_modulename, "__terp__.py")
|
||||
|
||||
f.close()
|
||||
self.zipper(_modulename, "__terp__.py")
|
||||
|
||||
|
||||
schema_id = data['id']
|
||||
|
||||
lines=pooler.get_pool(cr.dbname).get('olap.schema').browse(cr, uid, schema_id,context)
|
||||
|
||||
|
||||
_extract=[]
|
||||
_extract.append(['id','name','db_name','db_login','db_password'])
|
||||
_extract.append(["db_"+str(lines.database_id.id),lines.database_id.name,lines.database_id.db_name,lines.database_id.db_login,lines.database_id.db_password])
|
||||
self.write_csv('olap.fact.database.csv',_extract)
|
||||
self.zipper(_modulename, "olap.fact.database.csv")
|
||||
|
||||
|
||||
_extract=[]
|
||||
_extract.append(['id','name','database_id:id','loaded','configure','ready','state','note'])
|
||||
_extract.append(["schema_"+str(lines.id),lines.name,"db_"+str(lines.database_id.id),lines.loaded and lines.loaded or '',lines.configure and lines.configure or '', lines.ready and lines.ready or '',lines.state,lines.note and lines.note or ''])
|
||||
self.write_csv('olap.schema.csv',_extract)
|
||||
self.zipper(_modulename, "olap.schema.csv")
|
||||
|
||||
self.zipper(_modulename, "olap.schema.csv")
|
||||
|
||||
cube_ids = lines.cube_ids
|
||||
_extractcubes=[]
|
||||
_extractcubes.append(['id','name','table_id:id','schema_id:id'])
|
||||
|
||||
|
||||
_extractmeasures=[]
|
||||
_extractmeasures.append(['id','name','cube_id:id','value_column','value_sql','agregator','datatype','formatstring'])
|
||||
|
||||
_extractmeasures.append(['id','name','cube_id:id','value_column','value_sql','agregator','datatype','formatstring'])
|
||||
|
||||
_extractdimension=[]
|
||||
_extractdimension.append(['id','name','foreign_key','foreign_key_table','cube_id:id'])
|
||||
|
||||
|
||||
_extracthiers=[]
|
||||
_extracthiers.append(['id','name','primary_key','primary_key_table','field_name','member_all','member_default','sequence','type','dimension_id:id','table_id:id'])
|
||||
|
||||
|
@ -182,26 +182,26 @@ class wizard_olap_extract(wizard.interface):
|
|||
|
||||
_cube_table_ids = []
|
||||
for cube in cube_ids:
|
||||
_extractcubes.append(["cube_"+str(cube.id),cube.name,"cubetable_"+str(cube.table_id.id),"schema_"+str(cube.schema_id.id)])
|
||||
_cube_table_ids.append(cube.table_id.id)
|
||||
|
||||
_extractcubes.append(["cube_"+str(cube.id),cube.name,"cubetable_"+str(cube.table_id.id),"schema_"+str(cube.schema_id.id)])
|
||||
_cube_table_ids.append(cube.table_id.id)
|
||||
|
||||
measure_ids = cube.measure_ids
|
||||
for measure in measure_ids:
|
||||
_extractmeasures.append(["msr_"+str(measure.id),measure.name,"cube_"+str(measure.cube_id.id),measure.value_column and measure.value_column or '',measure.value_sql and measure.value_sql or '',measure.agregator,measure.datatype and measure.datatype or '',measure.formatstring])
|
||||
|
||||
_extractmeasures.append(["msr_"+str(measure.id),measure.name,"cube_"+str(measure.cube_id.id),measure.value_column and measure.value_column or '',measure.value_sql and measure.value_sql or '',measure.agregator,measure.datatype and measure.datatype or '',measure.formatstring])
|
||||
|
||||
dimension_ids = cube.dimension_ids
|
||||
for dimension in dimension_ids:
|
||||
_extractdimension.append(["dim_"+str(dimension.id),dimension.name,dimension.foreign_key and dimension.foreign_key or '',dimension.foreign_key_table and dimension.foreign_key_table or '',"cube_"+str(dimension.cube_id.id)])
|
||||
|
||||
|
||||
hiers_ids = dimension.hierarchy_ids
|
||||
for hier in hiers_ids:
|
||||
_extracthiers.append(["hier_"+str(hier.id),hier.name,hier.primary_key,hier.primary_key_table and hier.primary_key_table or '',hier.field_name,hier.member_all,hier.member_default,hier.sequence,hier.type,"dim_"+str(hier.dimension_id.id),"cubetable_"+str(hier.table_id.id)])
|
||||
_cube_table_ids.append(hier.table_id.id)
|
||||
|
||||
|
||||
level_ids = hier.level_ids
|
||||
for level in level_ids:
|
||||
_extractlevels.append(["lvl_"+str(level.id),level.name,level.column_name,level.column_id_name,level.type,level.table_name,level.sequence,"hier_"+str(level.hierarchy_id.id)])
|
||||
|
||||
|
||||
res={}
|
||||
_extract=[]
|
||||
_extract.append(['id','name','table_alias','key_left','key_right','table_left_id:id','table_right_id:id'])
|
||||
|
@ -209,37 +209,37 @@ class wizard_olap_extract(wizard.interface):
|
|||
key = res.keys()
|
||||
key = map(lambda x: int(x),key)
|
||||
key.sort()
|
||||
|
||||
|
||||
for k in key:
|
||||
_extract.append(res[str(k)])
|
||||
|
||||
|
||||
self.write_csv('olap.cube.csv',_extractcubes)
|
||||
self.zipper(_modulename, "olap.cube.csv")
|
||||
|
||||
|
||||
self.write_csv('olap.measure.csv',_extractmeasures)
|
||||
self.zipper(_modulename, "olap.measure.csv")
|
||||
|
||||
self.zipper(_modulename, "olap.measure.csv")
|
||||
|
||||
self.write_csv('olap.dimension.csv',_extractdimension)
|
||||
self.zipper(_modulename, "olap.dimension.csv")
|
||||
|
||||
|
||||
self.write_csv('olap.hierarchy.csv',_extracthiers)
|
||||
self.zipper(_modulename, "olap.hierarchy.csv")
|
||||
|
||||
self.zipper(_modulename, "olap.hierarchy.csv")
|
||||
|
||||
self.write_csv('olap.level.csv',_extractlevels)
|
||||
self.zipper(_modulename, "olap.level.csv")
|
||||
self.zipper(_modulename, "olap.level.csv")
|
||||
|
||||
self.write_csv('olap.cube.table.csv',_extract)
|
||||
self.zipper(_modulename, "olap.cube.table.csv")
|
||||
self.zipper(_modulename, "olap.cube.table.csv")
|
||||
|
||||
return {}
|
||||
|
||||
|
||||
states = {
|
||||
|
||||
|
||||
'init': {
|
||||
'actions': [],
|
||||
'result': {'type':'form','arch':form1, 'fields':field1, 'state':[('end','Cancel'),('ok','OK')]}
|
||||
},
|
||||
|
||||
},
|
||||
|
||||
'ok' : {
|
||||
'actions' : [],
|
||||
'result' : {'type' : 'action' ,'action':_extract_schema,'state':'end'}
|
||||
|
|
|
@ -65,7 +65,7 @@ cube table and cube table line
|
|||
<field name="table_db_name">res_partner_address</field>
|
||||
<field name="fact_database_id" ref="fact_databases_BI"/>
|
||||
<field name="active">True</field>
|
||||
</record>
|
||||
</record>
|
||||
|
||||
<record model="olap.database.tables" id="table_res_country">
|
||||
<field name="name">res_country</field>
|
||||
|
@ -87,7 +87,7 @@ cube table and cube table line
|
|||
<field name="fact_database_id" ref="fact_databases_BI"/>
|
||||
<field name="active">True</field>
|
||||
|
||||
</record>
|
||||
</record>
|
||||
<record model="olap.database.columns" id="columns_product_id_sale_order_line">
|
||||
<field name="name">product_id</field>
|
||||
<field name="column_db_name">product_id</field>
|
||||
|
@ -105,15 +105,7 @@ cube table and cube table line
|
|||
<field name="primary_key">True</field>
|
||||
<field name="active">True</field>
|
||||
</record>
|
||||
<!-- <record model="olap.database.columns" id="columns_sale_order_line_product_id">
|
||||
<field name="name">product_id</field>
|
||||
<field name="column_db_name">id</field>
|
||||
<field name="type">int4</field>
|
||||
<field name="table_id" ref="table_sale_order_line"/>
|
||||
<field name="active">True</field>
|
||||
<field name="related_to" ref="table_product_product"/>
|
||||
</record>
|
||||
-->
|
||||
|
||||
<record model="olap.database.columns" id="columns_product_template_id">
|
||||
<field name="name">id</field>
|
||||
<field name="column_db_name">id</field>
|
||||
|
@ -265,16 +257,6 @@ cube table and cube table line
|
|||
<field name="active">True</field>
|
||||
</record>
|
||||
|
||||
<!-- <record model="olap.database.columns" id="columns_sale_order_line_product_id">
|
||||
<field name="name">product_id</field>
|
||||
<field name="column_db_name">product_id</field>
|
||||
<field name="type">int4</field>
|
||||
<field name="table_id" ref="table_sale_order_line"/>
|
||||
<field name="related_to" ref="table_product_product"/>
|
||||
<field name="active">True</field>
|
||||
|
||||
</record>
|
||||
-->
|
||||
<record model="olap.database.columns" id="columns_sale_order_line_order_id">
|
||||
<field name="name">order_id</field>
|
||||
<field name="column_db_name">order_id</field>
|
||||
|
@ -360,7 +342,7 @@ cube table and cube table line
|
|||
<field name="type">varchar</field>
|
||||
<field name="table_id" ref="table_res_country"/>
|
||||
<field name="active">True</field>
|
||||
</record>
|
||||
</record>
|
||||
|
||||
<record model="olap.database.columns" id="columns_res_partner_address_country_id">
|
||||
<field name="name">country_id</field>
|
||||
|
@ -369,7 +351,7 @@ cube table and cube table line
|
|||
<field name="table_id" ref="table_res_partner_address"/>
|
||||
<field name="related_to" ref="table_res_country"/>
|
||||
<field name="active">True</field>
|
||||
</record>
|
||||
</record>
|
||||
|
||||
<record model="olap.database.columns" id="columns_res_partner_address_city">
|
||||
<field name="name">city</field>
|
||||
|
@ -388,16 +370,6 @@ cube table and cube table line
|
|||
<field name="active">True</field>
|
||||
</record>
|
||||
|
||||
<!-- <record model="olap.database.columns" id="columns_sale_order_line_product_id">
|
||||
<field name="name">product_id</field>
|
||||
<field name="column_db_name">product_id</field>
|
||||
<field name="type">int4</field>
|
||||
<field name="table_id" ref="table_sale_order_line"/>
|
||||
<field name="related_to" ref="table_product_product"/>
|
||||
<field name="active">True</field>
|
||||
|
||||
</record>
|
||||
-->
|
||||
<record model="olap.database.columns" id="columns_sale_order_line_product_uom_qty">
|
||||
<field name="name">product_uom_qty</field>
|
||||
<field name="column_db_name">product_uom_qty</field>
|
||||
|
@ -425,7 +397,7 @@ cube table and cube table line
|
|||
|
||||
|
||||
<!--
|
||||
Making of the olap.cube.table and olap.cube.table.lines
|
||||
Making of the olap.cube.table and olap.cube.table.lines
|
||||
|
||||
-->
|
||||
<record model="olap.cube.table" id="cube_table_sale_order_line">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -33,7 +33,7 @@ based on geolocalization.
|
|||
'data': [
|
||||
'res_partner_view.xml',
|
||||
'crm_lead_view.xml',
|
||||
],
|
||||
],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
'certificate': False,
|
||||
|
|
|
@ -41,29 +41,28 @@ Main features :
|
|||
'update_xml': [
|
||||
'security/point_of_sale_security.xml',
|
||||
'security/ir.model.access.csv',
|
||||
'wizard/pos_details.xml',
|
||||
'wizard/pos_details.xml',
|
||||
'wizard/pos_add_product.xml',
|
||||
'wizard/pos_confirm.xml',
|
||||
'wizard/pos_discount.xml',
|
||||
'wizard/pos_get_sale.xml',
|
||||
'wizard/pos_open_statement.xml',
|
||||
'wizard/pos_close_statement.xml',
|
||||
'wizard/pos_close_statement.xml',
|
||||
'wizard/pos_box_entries.xml',
|
||||
'wizard/pos_payment_report_user_view.xml',
|
||||
'wizard/pos_payment_report_date_view.xml',
|
||||
'wizard/pos_box_out.xml',
|
||||
'wizard/pos_box_out.xml',
|
||||
'wizard/pos_sales_user.xml',
|
||||
'wizard/all_closed_cashbox_of_the_day.xml',
|
||||
'wizard/all_closed_cashbox_of_the_day.xml',
|
||||
'wizard/pos_sales_user_current_user.xml',
|
||||
'wizard/pos_sale_user_today.xml',
|
||||
'wizard/pos_receipt_view.xml',
|
||||
'wizard/pos_payment_report_user.xml',
|
||||
'wizard/pos_sale_user_today.xml',
|
||||
'wizard/pos_receipt_view.xml',
|
||||
'wizard/pos_payment_report_user.xml',
|
||||
'wizard/pos_payment_report.xml',
|
||||
'wizard/pos_payment.xml',
|
||||
'wizard/pos_scan_product_view.xml',
|
||||
'wizard/pos_return_view.xml',
|
||||
'pos_report.xml',
|
||||
# 'pos_wizard.xml',
|
||||
'pos_view.xml',
|
||||
'report/report_pos_order_view.xml',
|
||||
'report/report_cash_register_view.xml',
|
||||
|
@ -76,7 +75,6 @@ Main features :
|
|||
'statement_data.xml',
|
||||
],
|
||||
'demo_xml': ['pos_demo.xml','singer_statement_demo.xml','multi_company_stock_data.xml'],
|
||||
# 'test':['test/pos_test.yml',],
|
||||
'installable': True,
|
||||
}
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -310,7 +310,6 @@ class pos_order(osv.osv):
|
|||
'pickings': fields.one2many('stock.picking', 'pos_order', 'Picking', readonly=True),
|
||||
'picking_id': fields.many2one('stock.picking', 'Last Output Picking', readonly=True),
|
||||
'first_name': fields.char('First Name', size=64),
|
||||
# 'state_2': fields.function(_get_v,type='selection',selection=[('to_verify', 'To Verify'), ('accepted', 'Accepted'),('refused', 'Refused')], string='State', readonly=True, method=True, store=True),
|
||||
'note': fields.text('Internal Notes'),
|
||||
'nb_print': fields.integer('Number of Print', readonly=True),
|
||||
'sale_journal': fields.many2one('account.journal', 'Journal', required=True, states={'draft': [('readonly', False)]}, readonly=True, ),
|
||||
|
@ -353,7 +352,6 @@ class pos_order(osv.osv):
|
|||
'sale_manager': lambda self, cr, uid, context: uid,
|
||||
'state': lambda *a: 'draft',
|
||||
'price_type': lambda *a: 'tax_excluded',
|
||||
# 'state_2': lambda *a: 'to_verify',
|
||||
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'pos.order'),
|
||||
'date_order': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
|
||||
'date_validity': lambda *a: (DateTime.now() + DateTime.RelativeDateTime(months=+6)).strftime('%Y-%m-%d'),
|
||||
|
@ -479,7 +477,7 @@ class pos_order(osv.osv):
|
|||
'invoice_state': 'none',
|
||||
'auto_picking': True,
|
||||
'pos_order': order.id,
|
||||
})
|
||||
})
|
||||
self.write(cr, uid, [order.id], {'picking_id': picking_id})
|
||||
else:
|
||||
picking_id = order.picking_id.id
|
||||
|
@ -501,7 +499,6 @@ class pos_order(osv.osv):
|
|||
cr.execute("select s.id from stock_location s, stock_warehouse w where w.lot_stock_id=s.id and w.id= %d "%(order.shop_id.warehouse_id.id))
|
||||
res=cr.fetchone()
|
||||
location_id=res and res[0] or None
|
||||
# location_id = order and order.shop_id and order.shop_id.warehouse_id and order.shop_id.warehouse_id.lot_stock_id.id or None
|
||||
stock_dest_id = val.id
|
||||
if line.qty < 0:
|
||||
location_id, stock_dest_id = stock_dest_id, location_id
|
||||
|
@ -556,28 +553,6 @@ class pos_order(osv.osv):
|
|||
raise osv.except_osv(_('Error'), _('You don\'t have enough access to validate this sale!'))
|
||||
return True
|
||||
|
||||
# def button_validate(self, cr, uid, ids, *args):
|
||||
#
|
||||
# """ Check the access for the sale order and update the date_validation
|
||||
# @return: True
|
||||
# """
|
||||
# res_obj = self.pool.get('res.company')
|
||||
# try:
|
||||
# part_company=res_obj.browse(cr,uid,uid) and res_obj.browse(cr,uid,uid).parent_id and res_obj.browse######(cr,uid,uid).parent_id.id or None
|
||||
# except Exception, e:
|
||||
# raise osv.except_osv(_('Error'), _('You don\'t have enough access to validate this sale!'))
|
||||
# if part_company:
|
||||
# raise osv.except_osv(_('Error'), _('You don\'t have enough access to validate this sale!'))
|
||||
# for order in self.browse(cr, uid, ids):
|
||||
# if not order.date_validation:
|
||||
# cr.execute("select max(date) from account_bank_statement_line where pos_statement_id=%d"%(order.id))
|
||||
# val=cr.fetchone()
|
||||
# val=val and val[0] or None
|
||||
# if val:
|
||||
# cr.execute("Update pos_order set date_validation='%s', state_2 ='%s' where id = %d"%(val, 'accepted', order.id))
|
||||
# return True
|
||||
|
||||
|
||||
def cancel_order(self, cr, uid, ids, context=None):
|
||||
|
||||
""" Changes order state to cancel
|
||||
|
@ -601,11 +576,9 @@ class pos_order(osv.osv):
|
|||
if not order.num_sale and data['num_sale']:
|
||||
self.write(cr,uid,order_id,{'num_sale': data['num_sale']})
|
||||
ids_new=[]
|
||||
# if order.invoice_wanted and not order.partner_id:
|
||||
# raise osv.except_osv(_('Error'), _('Cannot create invoice without a partner.'))
|
||||
args = {
|
||||
'amount': data['amount'],
|
||||
}
|
||||
}
|
||||
if 'payment_date' in data.keys():
|
||||
args['date'] = data['payment_date']
|
||||
if 'payment_name' in data.keys():
|
||||
|
@ -660,7 +633,7 @@ class pos_order(osv.osv):
|
|||
'product_id': product_id,
|
||||
'qty': qty,
|
||||
'price_unit': price,
|
||||
})
|
||||
})
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_write(uid, 'pos.order', order_id, cr)
|
||||
|
||||
|
@ -954,13 +927,15 @@ class pos_order(osv.osv):
|
|||
for st in stat_l.move_ids:
|
||||
for s in st.line_id:
|
||||
if s.credit:
|
||||
account_move_line_obj.copy(cr, uid, s.id, { 'debit': s.credit,
|
||||
'statement_id': False,
|
||||
'credit': s.debit})
|
||||
account_move_line_obj.copy(cr, uid, s.id, {
|
||||
'statement_id': False,
|
||||
'account_id':order_account
|
||||
})
|
||||
'debit': s.credit,
|
||||
'statement_id': False,
|
||||
'credit': s.debit
|
||||
})
|
||||
account_move_line_obj.copy(cr, uid, s.id, {
|
||||
'statement_id': False,
|
||||
'account_id':order_account
|
||||
})
|
||||
|
||||
self.write(cr,uid,order.id,{'state':'done'})
|
||||
return True
|
||||
|
@ -1019,7 +994,7 @@ pos_order()
|
|||
|
||||
class account_bank_statement(osv.osv):
|
||||
_inherit = 'account.bank.statement'
|
||||
_columns={
|
||||
_columns= {
|
||||
'user_id': fields.many2one('res.users',ondelete='cascade',string='User', readonly=True),
|
||||
}
|
||||
_defaults = {
|
||||
|
@ -1034,7 +1009,7 @@ class account_bank_statement_line(osv.osv):
|
|||
for line in self.browse(cr, uid, ids):
|
||||
res[line.id] = line.statement_id and line.statement_id.journal_id and line.statement_id.journal_id.name or None
|
||||
return res
|
||||
_columns={
|
||||
_columns= {
|
||||
'journal_id': fields.function(_get_statement_journal, method=True,store=True, string='Journal', type='char', size=64),
|
||||
'am_out':fields.boolean("To count"),
|
||||
'is_acc':fields.boolean("Is accompte"),
|
||||
|
@ -1123,7 +1098,7 @@ class pos_order_line(osv.osv):
|
|||
def onchange_dis(self, cr, uid,ids, qty, price_subtotal_incl, discount,*a):
|
||||
price_sub = price_subtotal_incl
|
||||
sub_total_discount = price_sub-(price_subtotal_incl*(discount*0.01))
|
||||
return {'value': {'price_subtotal_incl':sub_total_discount}}
|
||||
return {'value': {'price_subtotal_incl':sub_total_discount}}
|
||||
|
||||
def onchange_ded(self, cr, uid,ids, val_ded,price_u,*a):
|
||||
pos_order = self.pool.get('pos.order.line')
|
||||
|
@ -1169,7 +1144,7 @@ class pos_order_line(osv.osv):
|
|||
'discount': fields.float('Discount (%)', digits=(16, 2)),
|
||||
'order_id': fields.many2one('pos.order', 'Order Ref', ondelete='cascade'),
|
||||
'create_date': fields.datetime('Creation Date', readonly=True),
|
||||
}
|
||||
}
|
||||
|
||||
_defaults = {
|
||||
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'pos.order.line'),
|
||||
|
@ -1180,17 +1155,6 @@ class pos_order_line(osv.osv):
|
|||
'company_id': lambda self,cr,uid,c: self.pool.get('res.users').browse(cr, uid, uid, c).company_id.id,
|
||||
}
|
||||
|
||||
# def _check_qty(self, cr, uid, ids):
|
||||
# lines = self.browse(cr, uid, ids)
|
||||
# for line in lines:
|
||||
# if line.qty <= 0:
|
||||
# return False
|
||||
# return True
|
||||
|
||||
# _constraints = [
|
||||
# (_check_qty, 'Order quantity cannot be negative or zero !', ['qty']),
|
||||
# ]
|
||||
|
||||
def create(self, cr, user, vals, context={}):
|
||||
if vals.get('product_id'):
|
||||
return super(pos_order_line, self).create(cr, user, vals, context)
|
||||
|
@ -1230,7 +1194,7 @@ class pos_order_line(osv.osv):
|
|||
'qty': qty,
|
||||
'name': product_name,
|
||||
'order_id': order,
|
||||
}
|
||||
}
|
||||
line_id = self.create(cr, uid, vals)
|
||||
if not line_id:
|
||||
raise osv.except_osv(_('Error'), _('Create line failed !'))
|
||||
|
@ -1245,7 +1209,13 @@ class pos_order_line(osv.osv):
|
|||
line_id = order_line_id
|
||||
|
||||
price_line = float(qty)*float(price)
|
||||
return {'name': product_name, 'product_id': product_id[0], 'price': price, 'price_line': price_line ,'qty': qty }
|
||||
return {
|
||||
'name': product_name,
|
||||
'product_id': product_id[0],
|
||||
'price': price,
|
||||
'price_line': price_line ,
|
||||
'qty': qty
|
||||
}
|
||||
|
||||
pos_order_line()
|
||||
|
||||
|
@ -1346,10 +1316,10 @@ class product_product(osv.osv):
|
|||
'expense_pdt': fields.boolean('Product for expenses'),
|
||||
'am_out': fields.boolean('Controle for Outgoing Operations'),
|
||||
'disc_controle': fields.boolean('Discount Controle '),
|
||||
}
|
||||
}
|
||||
_defaults = {
|
||||
'disc_controle': lambda *a: True,
|
||||
}
|
||||
}
|
||||
product_product()
|
||||
|
||||
class stock_picking(osv.osv):
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
<field name="arch" type="xml">
|
||||
<form string="Sales Order POS">
|
||||
<group col="6" colspan="4">
|
||||
<!--field name="user_salesman_id" />
|
||||
<field name="partner_id" on_change="onchange_partner_pricelist(partner_id)"/>
|
||||
<field name="contract_number" groups="base.group_extended"/> -->
|
||||
|
||||
|
@ -23,13 +22,10 @@
|
|||
<tree string="Order lines" editable="bottom">
|
||||
<field name="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)" width="275" />
|
||||
<field name="qty"/>
|
||||
<!--<field name="qty" on_change="onchange_qty(qty,price_unit)"/>-->
|
||||
<!--field name="qty_rfd" groups="base.group_extended"/-->
|
||||
<field name="price_ded" on_change="onchange_ded(price_ded, price_subtotal_incl,price_unit)" invisible="1"/>
|
||||
<field name="price_unit" readonly="1"/>
|
||||
<field name="discount" on_change="onchange_discount(discount,price_unit)" />
|
||||
<field name="notice" on_change="onchange_dis(qty,price_subtotal_incl,discount)"/>
|
||||
<!--field name="serial_number"/-->
|
||||
<field name="price_subtotal" />
|
||||
<field name="price_subtotal_incl" sum="Subtotal"/>
|
||||
</tree>
|
||||
|
@ -48,21 +44,8 @@
|
|||
<group colspan="4" col="7">
|
||||
<field name="amount_tax"/>
|
||||
<field name="amount_total"/>
|
||||
<!--button name="%(action_pos_discount)d" string="D_iscount" type="action" states="draft"/>
|
||||
<button name="dummy_button" string="Compute" type="object" /-->
|
||||
</group>
|
||||
|
||||
<!-- <group colspan="4" col="9" groups="base.group_extended">-->
|
||||
<!-- <separator colspan="4" string="Validation of the Sale"/>-->
|
||||
<!-- <newline/>-->
|
||||
<!-- <field name="state_2" />-->
|
||||
<!-- <button name="button_validate"-->
|
||||
<!-- string="Accept"-->
|
||||
<!-- type="object"-->
|
||||
<!-- icon="gtk-ok"-->
|
||||
<!-- states="paid, draft"-->
|
||||
<!-- attrs="{'invisible':[('state_2','=','accepted')]}"/>-->
|
||||
<!-- </group>-->
|
||||
<separator colspan="4" string="Actions"/>
|
||||
<group colspan="4" col="6">
|
||||
<field name="state" />
|
||||
|
@ -83,24 +66,17 @@
|
|||
<field name="company_id" groups="base.group_multi_company"/>
|
||||
<field name="price_type" />
|
||||
<field name="user_id" string="Salesman" groups="base.group_extended"/>
|
||||
<!--field name="sale_manager" /-->
|
||||
</group>
|
||||
<group colspan="2" col="2" name="Type">
|
||||
<separator string="Dates" colspan="4"/>
|
||||
<field name="date_order"/>
|
||||
<field name="date_validation" />
|
||||
<field name="date_payment" groups="base.group_extended"/>
|
||||
<!-- <field name="type_rec" colspan="4"/>-->
|
||||
</group>
|
||||
<group colspan="4">
|
||||
<!-- <separator string="Invoicing" colspan="4"/>-->
|
||||
<field name="partner_id" on_change="onchange_partner_pricelist(partner_id)" invisible="1"/>
|
||||
<field name="sale_journal" domain="[('type','=','sale')]" widget="selection" invisible="1"/>
|
||||
<field name="pricelist_id" domain="[('type','=','sale')]" widget="selection" invisible="1"/>
|
||||
<!-- <field name="invoice_id"/>-->
|
||||
<!-- <group colspan="2" col="4">-->
|
||||
<!-- <button name="invoice" icon="gtk-execute" string="Create _Invoice" states="paid"/>-->
|
||||
<!-- </group>-->
|
||||
</group>
|
||||
|
||||
<field name="statement_ids" colspan="4" nolabel="1">
|
||||
|
@ -800,8 +776,6 @@
|
|||
id="products_for_output_operations"
|
||||
groups="base.group_system"/>
|
||||
|
||||
<!-- <menuitem name="Register Management" parent="menu_point_root"-->
|
||||
<!-- id="menu_point_config" sequence="4"/>-->
|
||||
<menuitem
|
||||
name="Input Operations" parent="menu_point_of_sale"
|
||||
string="Refloat"
|
||||
|
@ -866,40 +840,6 @@
|
|||
|
||||
<!-- Miscelleanous Operations/Reporting -->
|
||||
<menuitem name="Reporting" parent="menu_point_root" id="menu_point_rep" sequence="20" groups="group_pos_manager,base.group_system"/>
|
||||
<!-- <menuitem name="Registers" parent="menu_point_rep" id="menu_point_report_register" sequence="0" />
|
||||
<menuitem name="Sales" parent="menu_point_rep" id="menu_point_report_sale" sequence="1" />
|
||||
|
||||
<menuitem name="Details Of Operations" parent="menu_point_report_sale" id="menu_details_of_oper" sequence="1" groups="base.group_extended,group_pos_manager,base.group_system"/>
|
||||
<menuitem name="All Sales" parent="menu_details_of_oper"
|
||||
id="menu_action_all_sales_tree3" action="action_pos_order_tree3" sequence="1" groups="base.group_extended,base.group_system,group_pos_manager"/>
|
||||
<menuitem name="Sales of the day" parent="menu_action_all_sales_tree3"
|
||||
id="menu_action_sale_of_day_tree2" action="action_trans_pos_tree_today"/>
|
||||
<menuitem name="Accepted Sales" parent="menu_action_all_sales_tree3"
|
||||
id="menu_action_sale_of_day_accept" action="action_pos_order_accepted"/>
|
||||
|
||||
<menuitem name="Sales Reports" parent="menu_point_report_sale" id="menu_sales_report" sequence="2"/>
|
||||
|
||||
<menuitem name="Sales of the day" parent="menu_sales_report"
|
||||
action="action_trans_pos_tree_today" id="menu_trans_pos_tree_today"/>
|
||||
|
||||
<menuitem name="Sales of the month" parent="menu_sales_report"
|
||||
action="action_trans_pos_tree_month" id="menu_trans_pos_tree_month"/>
|
||||
|
||||
<menuitem name="All the sales" parent="menu_sales_report"
|
||||
action="action_trans_pos_tree" id="menu_trans_pos_tree"/>
|
||||
|
||||
<menuitem name="Sales by User" parent="menu_sales_report"
|
||||
action="action_report_sales_by_user_pos_today" id="menu_report_sales_by_user_pos_tree"/>
|
||||
|
||||
<menuitem name="Sales by User Monthly" parent="menu_sales_report"
|
||||
action="action_report_sales_by_user_pos_month" id="menu_report_sales_by_user_pos_month_tree"/>
|
||||
|
||||
<menuitem name="Sales by User Daily Margin" parent="menu_sales_report"
|
||||
action="action_report_sales_by_margin_pos_today" id="menu_report_sales_by_user_margin_daily_pos_tree"/>
|
||||
|
||||
<menuitem name="Sales by User Monthly Margin" parent="menu_sales_report"
|
||||
action="action_report_sales_by_margin_pos_month" id="menu_report_sales_by_user_pos_month_margin_tree"/>
|
||||
-->
|
||||
<!-- Invoice -->
|
||||
|
||||
<record model="ir.actions.act_window" id="action_pos_invoice">
|
||||
|
@ -910,41 +850,9 @@
|
|||
<field name="view_mode">tree,form</field>
|
||||
<field name="domain">[('origin','like','POS')]</field>
|
||||
</record>
|
||||
<!-- <menuitem name="All Invoices" parent="menu_details_of_oper"
|
||||
action="action_pos_invoice" id="menu_pos_invoice_tree"/>
|
||||
|
||||
<menuitem name="Payments and Sales" parent="menu_point_report_sale"
|
||||
id="menu_cashboxes_closing_tree" sequence="1"/>
|
||||
<menuitem name="Today" parent="menu_cashboxes_closing_tree"
|
||||
id="menu_cashboxes_by_day" sequence="1"/>
|
||||
|
||||
<menuitem name="All Sales Lines" parent="menu_details_of_oper"
|
||||
id="menu_action_pos_order_line" action="action_pos_order_line" sequence="2"/>
|
||||
|
||||
<menuitem name="Sales Lines of the day" parent="menu_action_pos_order_line"
|
||||
id="menu_action_pos_order_line_day" action="action_pos_order_line_day"/>
|
||||
|
||||
|
||||
<menuitem icon="STOCK_PRINT" action="action_report_pos_sale_user"
|
||||
id="menu_pos_sales_user" parent="menu_trans_pos_tree" sequence="3" groups="base.group_extended" />
|
||||
-->
|
||||
|
||||
<menuitem icon="STOCK_PRINT" action="action_report_pos_payment_repport_date"
|
||||
id="menu_pos_payment_report_date" parent="menu_point_rep" sequence="8" groups="base.group_extended"/>
|
||||
<!--
|
||||
<menuitem icon="STOCK_PRINT" action="action_report_pos_payment_report_user"
|
||||
id="menu_pos_payment_report_user" parent="menu_trans_pos_tree_today" sequence="6" groups="base.group_extended"/>
|
||||
<menuitem icon="STOCK_PRINT" action="action_pos_sales_user_today"
|
||||
id="menu_pos_sales_user_today" parent="menu_trans_pos_tree_today" sequence="2" groups="base.group_extended"/>
|
||||
|
||||
<menuitem icon="STOCK_PRINT" action="action_report_pos_payment_repport_date"
|
||||
id="menu_pos_payment_report_date" parent="menu_trans_pos_tree" sequence="5" groups="base.group_extended"/>
|
||||
|
||||
<menuitem icon="STOCK_PRINT" action="action_report_pos_payment_report_user"
|
||||
id="menu_pos_payment_report_user" parent="menu_trans_pos_tree_today" sequence="6" groups="base.group_extended"/>
|
||||
<menuitem icon="STOCK_PRINT" action="action_report_pos_sales_user_today_current_user"
|
||||
id="menu_pos_sales_user_today_current_user" parent="menu_cashboxes_by_day" sequence="7"/>
|
||||
-->
|
||||
<menuitem icon="STOCK_PRINT" action="action_report_pos_details"
|
||||
id="menu_pos_details" parent="menu_point_rep" sequence="6" />
|
||||
|
||||
|
|
|
@ -219,7 +219,6 @@
|
|||
<field name="act_from" ref="act_paid"/>
|
||||
<field name="act_to" ref="act_done"/>
|
||||
<field name="signal">done</field>
|
||||
<!-- <field name="role_id" ref="role_pos"/-->
|
||||
</record>
|
||||
|
||||
<record model="workflow.transition" id="trans_paid_invoice">
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -29,9 +29,9 @@ class account_statement(report_sxw.rml_parse):
|
|||
super(account_statement, self).__init__(cr, uid, name, context)
|
||||
self.total = 0.0
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'get_total':self._get_total,
|
||||
})
|
||||
'time': time,
|
||||
'get_total':self._get_total,
|
||||
})
|
||||
def _get_total(self, statement_line_ids):
|
||||
total = 0.0
|
||||
for line in statement_line_ids:
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -37,7 +37,7 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse):
|
|||
'get_user':self._get_user,
|
||||
'get_sub_total':self._get_sub_total,
|
||||
'get_net_total_starting':self._get_net_total_starting,
|
||||
})
|
||||
})
|
||||
def _get_user(self,line_ids):
|
||||
sql = "select name from res_users where id = %d"%(line_ids['create_uid'])
|
||||
self.cr.execute(sql)
|
||||
|
@ -109,7 +109,7 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse):
|
|||
total_starting_bal = 0.0
|
||||
sql = """ SELECT abs.id,abs.balance_end_real as net_total FROM account_bank_statement as abs
|
||||
WHERE to_char(date_trunc('day',abs.date),'YYYY-MM-DD')::date = current_date
|
||||
and abs.state IN ('confirm','open')
|
||||
and abs.state IN ('confirm','open')
|
||||
and abs.user_id = %d"""%(user.id)
|
||||
self.cr.execute(sql)
|
||||
res = self.cr.dictfetchall()
|
||||
|
|
|
@ -148,10 +148,8 @@ class report_sales_by_margin_pos(osv.osv):
|
|||
_description = "Sales by margin"
|
||||
_auto = False
|
||||
_columns = {
|
||||
# 'pos_name': fields.char('POS Order', size=64, readonly=True),
|
||||
'product_name':fields.char('Product Name', size=64, readonly=True),
|
||||
'date_order': fields.date('Order Date',required=True, select=True),
|
||||
# 'amount': fields.float('Total', readonly=True, select=True),
|
||||
'user_id': fields.many2one('res.users', 'User', readonly=True, select=True),
|
||||
'qty': fields.float('Qty', readonly=True, select=True),
|
||||
'net_margin_per_qty':fields.float('Net margin per Qty', readonly=True, select=True),
|
||||
|
@ -197,14 +195,12 @@ class report_sales_by_margin_pos_month(osv.osv):
|
|||
_description = "Sales by margin monthly"
|
||||
_auto = False
|
||||
_columns = {
|
||||
|
||||
'product_name':fields.char('Product Name', size=64, readonly=True),
|
||||
'date_order': fields.date('Order Date',required=True, select=True),
|
||||
'user_id': fields.many2one('res.users', 'User', readonly=True, select=True),
|
||||
'qty': fields.float('Qty', readonly=True, select=True),
|
||||
'net_margin_per_qty':fields.float('Net margin per Qty', readonly=True, select=True),
|
||||
'total':fields.float('Margin', readonly=True, select=True),
|
||||
|
||||
}
|
||||
|
||||
def init(self, cr):
|
||||
|
|
|
@ -96,17 +96,6 @@ class pos_details(report_sxw.rml_parse):
|
|||
self.total_paid=res3[0]
|
||||
return res3[0] or False
|
||||
|
||||
# def _get_qty_total(self, objects):
|
||||
# #code for the sum of qty_total
|
||||
# return reduce(lambda acc, object:
|
||||
# acc + reduce(
|
||||
# lambda sum_qty, line:
|
||||
# sum_qty + line.qty,
|
||||
# object.lines,
|
||||
# 0),
|
||||
# objects,
|
||||
# 0)
|
||||
|
||||
def _get_sum_discount(self, objects):
|
||||
#code for the sum of discount value
|
||||
return reduce(lambda acc, object:
|
||||
|
@ -119,18 +108,6 @@ class pos_details(report_sxw.rml_parse):
|
|||
0.0)
|
||||
|
||||
def _get_payments(self, form,user, ignore_gift=False):
|
||||
# gift_journal_id = None
|
||||
# if ignore_gift:
|
||||
# config_journal_ids = self.pool.get("pos.config.journal").search(self.cr, self.uid, [('code', '=', 'GIFT')])
|
||||
# if len(config_journal_ids):
|
||||
# config_journal = self.pool.get("pos.config.journal").browse(self.cr, self.uid, config_journal_ids, {})[0]
|
||||
# gift_journal_id = config_journal.journal_id.id
|
||||
#
|
||||
# result = {}
|
||||
# for obj in objects:
|
||||
# for payment in obj.statement_ids:
|
||||
# result[payment.journal_id] = result.get(payment.journal_id, 0.0) + payment.amount
|
||||
# return result
|
||||
statement_line_obj = self.pool.get("account.bank.statement.line")
|
||||
gift_journal_id = None
|
||||
if ignore_gift:
|
||||
|
@ -200,13 +177,6 @@ class pos_details(report_sxw.rml_parse):
|
|||
temp.update({'amount':temp2})
|
||||
return [temp] or False
|
||||
|
||||
# def _get_period(self, form):
|
||||
# min_date = form['date_start']
|
||||
# max_date = form['date_end']
|
||||
# if min_date == max_date:
|
||||
# return '%s' % min_date
|
||||
# else:
|
||||
# return '%s - %s' % (min_date, max_date)
|
||||
def _get_period(self, form):
|
||||
return form['date_start']
|
||||
|
||||
|
|
|
@ -29,9 +29,9 @@ class pos_lines(report_sxw.rml_parse):
|
|||
super(pos_lines, self).__init__(cr, uid, name, context)
|
||||
self.total = 0.0
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'total_quantity': self.__total_quantity__,
|
||||
'taxes':self.__taxes__,
|
||||
'time': time,
|
||||
'total_quantity': self.__total_quantity__,
|
||||
'taxes':self.__taxes__,
|
||||
|
||||
})
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
import time
|
||||
|
@ -28,10 +28,10 @@ class pos_payment_report(report_sxw.rml_parse):
|
|||
super(pos_payment_report, self).__init__(cr, uid, name, context)
|
||||
self.total = 0.0
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'pos_payment': self._pos_payment,
|
||||
'pos_payment_total':self._pos_payment_total,
|
||||
})
|
||||
'time': time,
|
||||
'pos_payment': self._pos_payment,
|
||||
'pos_payment_total':self._pos_payment_total,
|
||||
})
|
||||
|
||||
def _pos_payment(self,obj):
|
||||
data={}
|
||||
|
@ -51,19 +51,13 @@ class pos_payment_report(report_sxw.rml_parse):
|
|||
"where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
|
||||
"and po.state IN ('paid','invoiced') and to_char(date_trunc('day',po.date_order),'YYYY-MM-DD')::date = current_date")
|
||||
data=self.cr.dictfetchall()
|
||||
|
||||
|
||||
for d in data:
|
||||
self.total += d['price_unit'] * d['qty']
|
||||
return data
|
||||
|
||||
|
||||
def _pos_payment_total(self,o):
|
||||
# res=[]
|
||||
# self.cr.execute ("select sum(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) " \
|
||||
# "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt " \
|
||||
# "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
|
||||
# "and po.state='paid' and po.date_order = current_date and po.id=%d"%(o.id))
|
||||
# res=self.cr.fetchone()[0]
|
||||
return self.total
|
||||
|
||||
|
||||
|
|
|
@ -28,10 +28,10 @@ class pos_payment_report_date(report_sxw.rml_parse):
|
|||
super(pos_payment_report_date, self).__init__(cr, uid, name, context)
|
||||
self.total = 0.0
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'pos_payment_date': self.__pos_payment_date__,
|
||||
'pos_payment_date_total':self.__pos_payment_date__total__,
|
||||
})
|
||||
'time': time,
|
||||
'pos_payment_date': self.__pos_payment_date__,
|
||||
'pos_payment_date_total':self.__pos_payment_date__total__,
|
||||
})
|
||||
|
||||
def __pos_payment_date__(self,form):
|
||||
dt1 = form['date_start'] + ' 00:00:00'
|
||||
|
|
|
@ -27,10 +27,10 @@ class pos_payment_report_user(report_sxw.rml_parse):
|
|||
super(pos_payment_report_user, self).__init__(cr, uid, name, context)
|
||||
self.total = 0.0
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'pos_payment_user': self.__pos_payment_user__,
|
||||
'pos_payment_user_total':self.__pos_payment_user__total__,
|
||||
})
|
||||
'time': time,
|
||||
'pos_payment_user': self.__pos_payment_user__,
|
||||
'pos_payment_user_total':self.__pos_payment_user__total__,
|
||||
})
|
||||
|
||||
def __pos_payment_user__(self,form):
|
||||
data={}
|
||||
|
|
|
@ -28,10 +28,10 @@ class pos_sales_user(report_sxw.rml_parse):
|
|||
super(pos_sales_user, self).__init__(cr, uid, name, context)
|
||||
self.total = 0.0
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'get_data':self._get_data,
|
||||
'time': time,
|
||||
'get_data':self._get_data,
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
def _get_data(self,form):
|
||||
dt1 = form['date_start'] + ' 00:00:00'
|
||||
|
|
|
@ -28,10 +28,10 @@ class pos_sales_user_today(report_sxw.rml_parse):
|
|||
super(pos_sales_user_today, self).__init__(cr, uid, name, context)
|
||||
self.total = 0.0
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'get_data':self._get_data,
|
||||
'time': time,
|
||||
'get_data':self._get_data,
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
def _get_data(self,form):
|
||||
data={}
|
||||
|
|
|
@ -29,12 +29,12 @@ class pos_sales_user_today_current_user(report_sxw.rml_parse):
|
|||
self.total = 0.0
|
||||
self.qty = 0.0
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'get_user':self._get_user,
|
||||
'get_data_current_user':self._get_data_current_user,
|
||||
'get_data_current_user_tot':self._get_data_current_user_tot,
|
||||
'get_data_current_user_qty':self._get_data_current_user_qty,
|
||||
})
|
||||
'time': time,
|
||||
'get_user':self._get_user,
|
||||
'get_data_current_user':self._get_data_current_user,
|
||||
'get_data_current_user_tot':self._get_data_current_user_tot,
|
||||
'get_data_current_user_qty':self._get_data_current_user_qty,
|
||||
})
|
||||
|
||||
def _get_user(self, user):
|
||||
pos_user={}
|
||||
|
@ -58,15 +58,6 @@ class pos_sales_user_today_current_user(report_sxw.rml_parse):
|
|||
return data
|
||||
|
||||
def _get_data_current_user_tot(self, user):
|
||||
# res={}
|
||||
# self.cr.execute("select sum(pol.price_unit * pol.qty * (1 - (pol.discount) / 100.0)) " \
|
||||
# "from pos_order as po,pos_order_line as pol,product_product as pp,product_template as pt ,res_users as ru,res_company as rc " \
|
||||
# "where pt.id=pp.product_tmpl_id and pp.id=pol.product_id and po.id = pol.order_id " \
|
||||
# "and po.date_order = current_date and po.user_id = ru.id and rc.id = %s and ru.id = %s " \
|
||||
# ,(str(self.uid),str(user.company_id.id)))
|
||||
#
|
||||
# res=self.cr.dictfetchone()
|
||||
# return res['sum']
|
||||
return self.total
|
||||
|
||||
def _get_data_current_user_qty(self, user):
|
||||
|
|
|
@ -28,12 +28,12 @@ class pos_user_product(report_sxw.rml_parse):
|
|||
super(pos_user_product, self).__init__(cr, uid, name, context)
|
||||
self.total = 0.0
|
||||
self.localcontext.update({
|
||||
'time': time,
|
||||
'get_data':self._get_data,
|
||||
'get_user':self._get_user,
|
||||
'get_total':self._get_total,
|
||||
'time': time,
|
||||
'get_data':self._get_data,
|
||||
'get_user':self._get_user,
|
||||
'get_total':self._get_total,
|
||||
|
||||
})
|
||||
})
|
||||
def _get_data(self,o):
|
||||
data={}
|
||||
sql1=""" SELECT distinct(o.id) from account_bank_statement s, account_bank_statement_line l,pos_order o,pos_order_line i where i.order_id=o.id and o.state='paid' and l.statement_id=s.id and l.pos_statement_id=o.id and s.id=%d"""%(o.id)
|
||||
|
|
|
@ -25,15 +25,15 @@ class report_cash_register(osv.osv):
|
|||
_name = "report.cash.register"
|
||||
_description = "Point of Sale Cash Register Analysis"
|
||||
_auto = False
|
||||
_columns ={
|
||||
_columns = {
|
||||
'date': fields.date('Create Date', readonly=True),
|
||||
'year': fields.char('Year', size=4),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
||||
('05','May'), ('06','June'), ('07','July'), ('08','August'), ('09','September'),
|
||||
('10','October'), ('11','November'), ('12','December')], 'Month',readonly=True),
|
||||
'day': fields.char('Day', size=128, readonly=True),
|
||||
'user_id':fields.many2one('res.users', 'User', readonly=True),
|
||||
'state':fields.selection([('draft', 'Draft'),('confirm', 'Confirmed')],'State'),
|
||||
'user_id':fields.many2one('res.users', 'User', readonly=True),
|
||||
'state':fields.selection([('draft', 'Draft'),('confirm', 'Confirmed')],'State'),
|
||||
'journal_id': fields.many2one('account.journal', 'Journal'),
|
||||
'balance_start': fields.float('Opening Balance'),
|
||||
'balance_end_real': fields.float('Closing Balance'),
|
||||
|
@ -43,9 +43,9 @@ class report_cash_register(osv.osv):
|
|||
tools.drop_view_if_exists(cr, 'report_cash_register')
|
||||
cr.execute("""
|
||||
create or replace view report_cash_register as (
|
||||
select
|
||||
select
|
||||
min(s.id) as id,
|
||||
to_date(to_char(s.create_date, 'dd-MM-YYYY'),'dd-MM-YYYY') as date,
|
||||
to_date(to_char(s.create_date, 'dd-MM-YYYY'),'dd-MM-YYYY') as date,
|
||||
s.user_id as user_id,
|
||||
s.journal_id as journal_id,
|
||||
s.state as state,
|
||||
|
@ -54,8 +54,8 @@ class report_cash_register(osv.osv):
|
|||
to_char(s.create_date, 'YYYY') as year,
|
||||
to_char(s.create_date, 'MM') as month,
|
||||
to_char(s.create_date, 'YYYY-MM-DD') as day
|
||||
from account_bank_statement as s where s.user_id=1
|
||||
group by
|
||||
from account_bank_statement as s where s.user_id=1
|
||||
group by
|
||||
s.user_id,s.journal_id, s.balance_start, s.balance_end_real,s.state,to_char(s.create_date, 'dd-MM-YYYY'),
|
||||
to_char(s.create_date, 'YYYY'),
|
||||
to_char(s.create_date, 'MM'),
|
||||
|
|
|
@ -26,7 +26,7 @@ class report_pos_order(osv.osv):
|
|||
_name = "report.pos.order"
|
||||
_description = "Point of Sale Orders Statistics"
|
||||
_auto = False
|
||||
_columns ={
|
||||
_columns = {
|
||||
'date': fields.date('Date Order', readonly=True),
|
||||
'year': fields.char('Year', size=4, readonly=True),
|
||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
||||
|
@ -39,8 +39,6 @@ class report_pos_order(osv.osv):
|
|||
('advance','Advance'),
|
||||
('paid', 'Paid'), ('done', 'Done'), ('invoiced', 'Invoiced'), ('cancel', 'Cancel')],
|
||||
'State'),
|
||||
# 'state_2': fields.function([('to_verify', 'To Verify'), ('accepted', 'Accepted'),
|
||||
# ('refused', 'Refused')], string='State'),
|
||||
'user_id':fields.many2one('res.users', 'Salesman', readonly=True),
|
||||
'price_total':fields.float('Total Price', readonly=True),
|
||||
'total_discount':fields.float('Total Discount', readonly=True),
|
||||
|
|
|
@ -78,9 +78,7 @@
|
|||
<filter string="Customer" icon="terp-personal" context="{'group_by':'partner_id'}"/>
|
||||
<separator orientation="vertical"/>
|
||||
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
|
||||
<!--<filter string="Journal" icon="terp-folder-orange" context="{'group_by':'journal_id'}"/>-->
|
||||
<separator orientation="vertical"/>
|
||||
<!--<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>-->
|
||||
<filter string="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
|
||||
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
|
||||
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
|
||||
|
|
|
@ -1,21 +1,6 @@
|
|||
<openerp>
|
||||
<data>
|
||||
|
||||
<!-- <wizard
|
||||
id="close_statement"
|
||||
model="account.bank.statement"
|
||||
menu="True"
|
||||
name="statement.close"
|
||||
string="Close Statements"/>
|
||||
<menuitem
|
||||
name="Close Register" parent="point_of_sale.menu_point_config"
|
||||
string="Close Register"
|
||||
action="close_statement"
|
||||
type="wizard"
|
||||
id="menu_close_statement" sequence="4" />
|
||||
|
||||
-->
|
||||
|
||||
<menuitem icon="STOCK_PRINT"
|
||||
action="action_report_all_closed_cashbox_of_the_day"
|
||||
id="menu_all_closed_cashbox_of_the_day"
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -30,28 +30,28 @@ class all_closed_cashbox_of_the_day(osv.osv_memory):
|
|||
_description = 'All closed cashbox of the day'
|
||||
|
||||
_columns = {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
def print_report(self, cr, uid, ids, context=None):
|
||||
|
||||
"""
|
||||
To get the date and print the report
|
||||
|
||||
"""
|
||||
To get the date and print the report
|
||||
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param context: A standard dictionary
|
||||
@param context: A standard dictionary
|
||||
@return : retrun report
|
||||
"""
|
||||
"""
|
||||
datas = {'ids' : context.get('active_ids',[])}
|
||||
res = {}
|
||||
res = {}
|
||||
datas['form'] = res
|
||||
|
||||
return {
|
||||
'type' : 'ir.actions.report.xml',
|
||||
'report_name':'all.closed.cashbox.of.the.day',
|
||||
'datas' : datas,
|
||||
|
||||
return {
|
||||
'type' : 'ir.actions.report.xml',
|
||||
'report_name':'all.closed.cashbox.of.the.day',
|
||||
'datas' : datas,
|
||||
}
|
||||
|
||||
all_closed_cashbox_of_the_day()
|
||||
|
|
|
@ -71,16 +71,16 @@ class pos_box_entries(osv.osv_memory):
|
|||
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Description', size=32, required=True),
|
||||
'journal_id': fields.selection(get_journal, "Register", required=True),
|
||||
'product_id': fields.selection(_get_income_product, "Operation", required=True),
|
||||
'amount': fields.float('Amount', digits=(16, 2)),
|
||||
'ref': fields.char('Ref', size=32),
|
||||
'name': fields.char('Description', size=32, required=True),
|
||||
'journal_id': fields.selection(get_journal, "Register", required=True),
|
||||
'product_id': fields.selection(_get_income_product, "Operation", required=True),
|
||||
'amount': fields.float('Amount', digits=(16, 2)),
|
||||
'ref': fields.char('Ref', size=32),
|
||||
}
|
||||
_defaults = {
|
||||
'journal_id': lambda *a: 1,
|
||||
'product_id': lambda *a: 1,
|
||||
}
|
||||
'journal_id': lambda *a: 1,
|
||||
'product_id': lambda *a: 1,
|
||||
}
|
||||
|
||||
def get_in(self, cr, uid, ids, context):
|
||||
"""
|
||||
|
@ -109,11 +109,12 @@ class pos_box_entries(osv.osv_memory):
|
|||
if statement_id:
|
||||
statement_id = statement_id[0]
|
||||
if not statement_id:
|
||||
statement_id = statement_obj.create(cr, uid, {'date': time.strftime('%Y-%m-%d 00:00:00'),
|
||||
'journal_id': data['journal_id'],
|
||||
'company_id': curr_company,
|
||||
'user_id': uid,
|
||||
})
|
||||
statement_id = statement_obj.create(cr, uid, {
|
||||
'date': time.strftime('%Y-%m-%d 00:00:00'),
|
||||
'journal_id': data['journal_id'],
|
||||
'company_id': curr_company,
|
||||
'user_id': uid,
|
||||
})
|
||||
|
||||
args['statement_id'] = statement_id
|
||||
args['journal_id'] = data['journal_id']
|
||||
|
|
|
@ -49,16 +49,16 @@ class pos_box_out(osv.osv_memory):
|
|||
return res
|
||||
|
||||
_columns = {
|
||||
'name': fields.char('Description', size=32, required=True),
|
||||
'journal_id': fields.selection(pos_box_entries.get_journal, "Register", required=True),
|
||||
'product_id': fields.selection(_get_expense_product, "Operation", required=True),
|
||||
'amount': fields.float('Amount', digits=(16, 2)),
|
||||
'ref': fields.char('Ref', size=32),
|
||||
'name': fields.char('Description', size=32, required=True),
|
||||
'journal_id': fields.selection(pos_box_entries.get_journal, "Register", required=True),
|
||||
'product_id': fields.selection(_get_expense_product, "Operation", required=True),
|
||||
'amount': fields.float('Amount', digits=(16, 2)),
|
||||
'ref': fields.char('Ref', size=32),
|
||||
}
|
||||
_defaults = {
|
||||
'journal_id': lambda *a: 1,
|
||||
'product_id': lambda *a: 1,
|
||||
}
|
||||
'journal_id': lambda *a: 1,
|
||||
'product_id': lambda *a: 1,
|
||||
}
|
||||
def get_out(self, cr, uid, ids, context):
|
||||
|
||||
"""
|
||||
|
@ -102,11 +102,12 @@ class pos_box_out(osv.osv_memory):
|
|||
if statement_id:
|
||||
statement_id = statement_id[0]
|
||||
if not statement_id:
|
||||
statement_id = statement_obj.create(cr, uid, {'date': time.strftime('%Y-%m-%d 00:00:00'),
|
||||
'journal_id': data['journal_id'],
|
||||
'company_id': curr_company,
|
||||
'user_id': uid,
|
||||
})
|
||||
statement_id = statement_obj.create(cr, uid, {
|
||||
'date': time.strftime('%Y-%m-%d 00:00:00'),
|
||||
'journal_id': data['journal_id'],
|
||||
'company_id': curr_company,
|
||||
'user_id': uid,
|
||||
})
|
||||
args['statement_id'] = statement_id
|
||||
args['journal_id'] = data['journal_id']
|
||||
if acc_id:
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
<field name="journal_id"/>
|
||||
<field name="product_id"/>
|
||||
<field name="amount"/>
|
||||
<!-- <field name="ref"/>-->
|
||||
<group colspan="4" col="2">
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="Close" />
|
||||
|
|
|
@ -61,13 +61,14 @@ class pos_close_statement(osv.osv_memory):
|
|||
if id3:
|
||||
id3 = data_obj.browse(cr, uid, id3, context=context).res_id
|
||||
return {
|
||||
'domain': "[('id','in'," + str(list_statement) + ")]",
|
||||
'name': 'Close Statements',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'account.bank.statement',
|
||||
'views': [(id2, 'tree'),(id3, 'form')],
|
||||
'type': 'ir.actions.act_window'}
|
||||
'domain': "[('id','in'," + str(list_statement) + ")]",
|
||||
'name': 'Close Statements',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'account.bank.statement',
|
||||
'views': [(id2, 'tree'),(id3, 'form')],
|
||||
'type': 'ir.actions.act_window'
|
||||
}
|
||||
|
||||
pos_close_statement()
|
||||
|
||||
|
|
|
@ -35,18 +35,18 @@ class pos_discount(osv.osv_memory):
|
|||
'discount': lambda *a: 5,
|
||||
}
|
||||
|
||||
|
||||
|
||||
def view_init(self, cr, uid, fields_list, context=None):
|
||||
"""
|
||||
"""
|
||||
Creates view dynamically and adding fields at runtime.
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param context: A standard dictionary
|
||||
@param context: A standard dictionary
|
||||
@return: New arch of view with new columns.
|
||||
"""
|
||||
"""
|
||||
res = super(pos_discount, self).view_init(cr, uid, fields_list, context=context)
|
||||
record_id = context and context.get('active_id', False) or False
|
||||
record_id = context and context.get('active_id', False) or False
|
||||
order = self.pool.get('pos.order').browse(cr, uid, record_id)
|
||||
if not order.lines:
|
||||
raise osv.except_osv('Error!','No Order Lines ')
|
||||
|
@ -68,7 +68,7 @@ class pos_discount(osv.osv_memory):
|
|||
|
||||
order_ref = self.pool.get('pos.order')
|
||||
order_line_ref = self.pool.get('pos.order.line')
|
||||
|
||||
|
||||
for order in order_ref.browse(cr, uid, record_id, context=context):
|
||||
|
||||
for line in order.lines:
|
||||
|
@ -101,29 +101,6 @@ class pos_discount(osv.osv_memory):
|
|||
order_line_ref.write(cr, uid, [line.id], res_new, context=context)
|
||||
return {}
|
||||
|
||||
# def check_discount(self, cr, uid, record_id, discount, context):
|
||||
# """
|
||||
# Check the discount of define by company .
|
||||
# @param self: The object pointer.
|
||||
# @param cr: A database cursor
|
||||
# @param uid: ID of the user currently logged in
|
||||
# @param record_id:Current Order id
|
||||
# @param discount:Select Discount
|
||||
# @param context: A standard dictionary
|
||||
# @return : retrun to apply and used the company discount base on condition
|
||||
# """
|
||||
|
||||
# order_ref = self.pool.get('pos.order')
|
||||
#
|
||||
# for order in order_ref.browse(cr, uid, record_id, context=context):
|
||||
# company_disc = order.company_id.company_discount
|
||||
# for line in order.lines :
|
||||
# prod_disc = discount
|
||||
# if prod_disc <= company_disc :
|
||||
# return 'apply_discount'
|
||||
# else :
|
||||
# return 'disc_discount'
|
||||
|
||||
pos_discount()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -60,9 +60,9 @@ class pos_get_sale(osv.osv_memory):
|
|||
})
|
||||
|
||||
order = proxy_pick.write(cr, uid, [this.picking_id.id], {
|
||||
'invoice_state': 'none',
|
||||
'pos_order': record_id
|
||||
})
|
||||
'invoice_state': 'none',
|
||||
'pos_order': record_id
|
||||
})
|
||||
|
||||
for line in pick.move_lines:
|
||||
proxy_order_line.create(cr, uid, {
|
||||
|
|
|
@ -50,12 +50,12 @@ class pos_open_statement(osv.osv_memory):
|
|||
ids = statement_obj.search(cr, uid, [('state', '!=', 'confirm'), ('user_id', '=', uid), ('journal_id', '=', journal.id)])
|
||||
if len(ids):
|
||||
raise osv.except_osv(_('Message'), _('You can not open a Cashbox for "%s". \n Please close the cashbox related to. ' %(journal.name)))
|
||||
|
||||
|
||||
statement_ids = sorted(statement_obj.search(cr, uid, [('state', '=', 'confirm'), ('user_id', '=', uid), ('journal_id', '=', journal.id)]))
|
||||
if statement_ids:
|
||||
res = []
|
||||
statement_ids.reverse()
|
||||
statement = statement_obj.browse(cr, uid, statement_ids[0])
|
||||
statement = statement_obj.browse(cr, uid, statement_ids[0])
|
||||
for end_bal in statement.ending_details_ids:
|
||||
dct = {
|
||||
'pieces': end_bal.pieces,
|
||||
|
@ -71,8 +71,8 @@ class pos_open_statement(osv.osv_memory):
|
|||
number = sequence_obj.get_id(cr, uid, journal.sequence_id.id)
|
||||
else:
|
||||
number = sequence_obj.get(cr, uid, 'account.bank.statement')
|
||||
|
||||
data.update({'journal_id': journal.id,
|
||||
|
||||
data.update({'journal_id': journal.id,
|
||||
'company_id': company_id,
|
||||
'user_id': uid,
|
||||
'state': 'open',
|
||||
|
@ -96,7 +96,7 @@ class pos_open_statement(osv.osv_memory):
|
|||
'res_model': 'account.bank.statement',
|
||||
'views': [(id2, 'tree'),(id3, 'form')],
|
||||
'type': 'ir.actions.act_window'
|
||||
}
|
||||
}
|
||||
pos_open_statement()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -137,15 +137,10 @@ class pos_make_payment(osv.osv_memory):
|
|||
invoice_wanted = data['invoice_wanted']
|
||||
# Todo need to check ...
|
||||
|
||||
# if amount <= 0.0:
|
||||
# context.update({'flag':True})
|
||||
# order_obj.action_paid(cr, uid, [active_id], context)
|
||||
# return self.print_report(cr, uid, ids, context)
|
||||
|
||||
if amount != 0.0:
|
||||
if amount != 0.0:
|
||||
order_obj.write(cr, uid, [active_id], {'invoice_wanted': invoice_wanted, 'partner_id': data['partner_id']})
|
||||
order_obj.add_payment(cr, uid, active_id, data, context=context)
|
||||
|
||||
|
||||
if order_obj.test_paid(cr, uid, [active_id]):
|
||||
if data['partner_id'] and invoice_wanted:
|
||||
order_obj.action_invoice(cr, uid, [active_id], context)
|
||||
|
@ -162,7 +157,7 @@ class pos_make_payment(osv.osv_memory):
|
|||
else:
|
||||
order_obj.write(cr, uid, [active_id],{'state':'paid'})
|
||||
return self.print_report(cr, uid, ids, context)
|
||||
|
||||
|
||||
if order.amount_paid > 0.0:
|
||||
context.update({'flag': True})
|
||||
# Todo need to check
|
||||
|
@ -180,9 +175,9 @@ class pos_make_payment(osv.osv_memory):
|
|||
datas = {'ids': active_ids}
|
||||
datas['form'] = {}
|
||||
return {
|
||||
'type' : 'ir.actions.report.xml',
|
||||
'report_name':'pos.invoice',
|
||||
'datas' : datas,
|
||||
'type' : 'ir.actions.report.xml',
|
||||
'report_name':'pos.invoice',
|
||||
'datas' : datas,
|
||||
}
|
||||
|
||||
def print_report(self, cr, uid, ids, context=None):
|
||||
|
|
|
@ -43,19 +43,19 @@ class pos_payment_report_date(osv.osv_memory):
|
|||
datas['form'] = res
|
||||
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'pos.payment.report.date',
|
||||
'datas': datas,
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'pos.payment.report.date',
|
||||
'datas': datas,
|
||||
}
|
||||
|
||||
_columns = {
|
||||
'date_start': fields.date('Start Date', required=True),
|
||||
'date_end': fields.date('End Date', required=True),
|
||||
'user_id': fields.many2many('res.users', 'res_user_sale', 'user_id', 'sale_id', 'Salesman')
|
||||
'date_start': fields.date('Start Date', required=True),
|
||||
'date_end': fields.date('End Date', required=True),
|
||||
'user_id': fields.many2many('res.users', 'res_user_sale', 'user_id', 'sale_id', 'Salesman')
|
||||
}
|
||||
_defaults = {
|
||||
'date_start': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'date_end': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'date_start': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
'date_end': lambda *a: time.strftime('%Y-%m-%d'),
|
||||
}
|
||||
|
||||
pos_payment_report_date()
|
||||
|
|
|
@ -42,13 +42,13 @@ class pos_payment_report_user(osv.osv_memory):
|
|||
datas['form'] = res
|
||||
|
||||
return {
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'pos.payment.report.user',
|
||||
'datas': datas,
|
||||
'type': 'ir.actions.report.xml',
|
||||
'report_name': 'pos.payment.report.user',
|
||||
'datas': datas,
|
||||
}
|
||||
|
||||
_columns = {
|
||||
'user_id': fields.many2many('res.users', 'res_user_sale', 'user_id', 'sale_id', 'Salesman')
|
||||
'user_id': fields.many2many('res.users', 'res_user_sale', 'user_id', 'sale_id', 'Salesman')
|
||||
}
|
||||
|
||||
pos_payment_report_user()
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<data>
|
||||
<!-- pos.details -->
|
||||
|
||||
|
||||
<record id="view_pos_payment_report" model="ir.ui.view">
|
||||
<field name="name">Pyament Report</field>
|
||||
<field name="model">pos.payment.report</field>
|
||||
|
@ -28,13 +28,6 @@
|
|||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
<!-- <act_window name="POS Details"
|
||||
res_model="pos.details"
|
||||
src_model="pos.order"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_report_pos_details"/> -->
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
|
@ -31,19 +31,15 @@ class pos_receipt(osv.osv_memory):
|
|||
}
|
||||
|
||||
def view_init(self, cr, uid, fields_list, context=None):
|
||||
"""
|
||||
"""
|
||||
Creates view dynamically and adding fields at runtime.
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param context: A standard dictionary
|
||||
@param context: A standard dictionary
|
||||
@return: New arch of view with new columns.
|
||||
"""
|
||||
"""
|
||||
order_lst = self. pool.get('pos.order').browse(cr, uid, context['active_id'])
|
||||
# for order in order_lst:
|
||||
# if order.state_2 in ('to_verify'):
|
||||
# raise osv.except_osv(_('Error!', 'Can not print the receipt because of discount and/or payment '))
|
||||
# True
|
||||
|
||||
def print_report(self, cr, uid, ids, context=None):
|
||||
|
||||
|
|
|
@ -33,18 +33,18 @@ class pos_return(osv.osv_memory):
|
|||
_description = 'Point of sale return'
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
"""
|
||||
"""
|
||||
To get default values for the object.
|
||||
|
||||
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param fields: List of fields for which we want default values
|
||||
@param context: A standard dictionary
|
||||
|
||||
@return: A dictionary which of fields with values.
|
||||
|
||||
"""
|
||||
@param fields: List of fields for which we want default values
|
||||
@param context: A standard dictionary
|
||||
|
||||
@return: A dictionary which of fields with values.
|
||||
|
||||
"""
|
||||
|
||||
res = super(pos_return, self).default_get(cr, uid, fields, context=context)
|
||||
order_obj = self.pool.get('pos.order')
|
||||
|
@ -54,44 +54,44 @@ class pos_return(osv.osv_memory):
|
|||
for order in order_obj.browse(cr, uid, active_ids):
|
||||
for line in order.lines:
|
||||
if 'return%s'%(line.id) in fields:
|
||||
res['return%s'%(line.id)] = line.qty
|
||||
res['return%s'%(line.id)] = line.qty
|
||||
return res
|
||||
|
||||
|
||||
def view_init(self, cr, uid, fields_list, context=None):
|
||||
"""
|
||||
"""
|
||||
Creates view dynamically and adding fields at runtime.
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param context: A standard dictionary
|
||||
@param context: A standard dictionary
|
||||
@return: New arch of view with new columns.
|
||||
"""
|
||||
"""
|
||||
res = super(pos_return, self).view_init(cr, uid, fields_list, context=context)
|
||||
order_obj=self.pool.get('pos.order')
|
||||
order_obj=self.pool.get('pos.order')
|
||||
if not context:
|
||||
context={}
|
||||
|
||||
active_ids=context.get('active_ids')
|
||||
for order in order_obj.browse(cr, uid, active_ids):
|
||||
for line in order.lines:
|
||||
context={}
|
||||
|
||||
active_ids=context.get('active_ids')
|
||||
for order in order_obj.browse(cr, uid, active_ids):
|
||||
for line in order.lines:
|
||||
if 'return%s'%(line.id) not in self._columns:
|
||||
self._columns['return%s'%(line.id)] = fields.float("Quantity")
|
||||
|
||||
return res
|
||||
|
||||
return res
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False,submenu=False):
|
||||
|
||||
"""
|
||||
"""
|
||||
Changes the view dynamically
|
||||
|
||||
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param context: A standard dictionary
|
||||
|
||||
@param context: A standard dictionary
|
||||
|
||||
@return: New arch of view.
|
||||
|
||||
"""
|
||||
|
||||
"""
|
||||
result = super(pos_return, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar,submenu)
|
||||
if not context:
|
||||
context={}
|
||||
|
@ -104,25 +104,25 @@ class pos_return(osv.osv_memory):
|
|||
_moves_arch_lst="""<?xml version="1.0"?>
|
||||
<form string="Return lines">
|
||||
<label string="Quantities you enter, match to products that will return to the stock." colspan="4"/>"""
|
||||
_line_fields = result['fields']
|
||||
_line_fields = result['fields']
|
||||
order=order_obj.browse(cr, uid, active_id)
|
||||
for line in order.lines:
|
||||
quantity=line.qty
|
||||
for line in order.lines:
|
||||
quantity=line.qty
|
||||
_line_fields.update({
|
||||
'return%s'%(line.id) : {
|
||||
'string': line.product_id.name,
|
||||
'type' : 'float',
|
||||
'required': True,
|
||||
'default':quantity
|
||||
},
|
||||
})
|
||||
'return%s'%(line.id) : {
|
||||
'string': line.product_id.name,
|
||||
'type' : 'float',
|
||||
'required': True,
|
||||
'default':quantity
|
||||
},
|
||||
})
|
||||
_moves_arch_lst += """
|
||||
<field name="return%s"/>
|
||||
<newline/>
|
||||
<newline/>
|
||||
"""%(line.id)
|
||||
|
||||
|
||||
_moves_arch_lst+="""
|
||||
<newline/>
|
||||
<newline/>
|
||||
<separator colspan="4"/>
|
||||
<button icon='gtk-cancel' special="cancel"
|
||||
string="Cancel" />
|
||||
|
@ -130,36 +130,36 @@ class pos_return(osv.osv_memory):
|
|||
string="Return goods and Exchange" type="object"/>
|
||||
<button icon='gtk-ok' name="create_returns2"
|
||||
string="Return without Refund" type="object"/>
|
||||
</form>"""
|
||||
|
||||
</form>"""
|
||||
|
||||
result['arch'] = _moves_arch_lst
|
||||
result['fields'] = _line_fields
|
||||
return result
|
||||
|
||||
|
||||
result['fields'] = _line_fields
|
||||
return result
|
||||
|
||||
|
||||
def create_returns(self, cr, uid, data, context):
|
||||
"""
|
||||
"""
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param context: A standard dictionary
|
||||
|
||||
@param context: A standard dictionary
|
||||
|
||||
@return: Return the add product form again for adding more product
|
||||
|
||||
|
||||
"""
|
||||
return {
|
||||
'name': _('Add Product'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'pos.add.product',
|
||||
'view_id': False,
|
||||
'target':'new',
|
||||
'views': False,
|
||||
'context': context,
|
||||
'type': 'ir.actions.act_window',
|
||||
'name': _('Add Product'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'pos.add.product',
|
||||
'view_id': False,
|
||||
'target':'new',
|
||||
'views': False,
|
||||
'context': context,
|
||||
'type': 'ir.actions.act_window',
|
||||
}
|
||||
def create_returns2(self, cr, uid, ids, context):
|
||||
active_id = context.get('active_id', False)
|
||||
active_id = context.get('active_id', False)
|
||||
order_obj =self.pool.get('pos.order')
|
||||
line_obj = self.pool.get('pos.order.line')
|
||||
picking_obj = self.pool.get('stock.picking')
|
||||
|
@ -182,10 +182,10 @@ class pos_return(osv.osv_memory):
|
|||
location_id = res and res[0] or None
|
||||
stock_dest_id = val.id
|
||||
new_picking = picking_obj.copy(cr, uid, order_id.picking_id.id, {'name':'%s (return)' % order_id.name,
|
||||
'move_lines': [],
|
||||
'state':'draft',
|
||||
'move_lines': [],
|
||||
'state':'draft',
|
||||
'type': 'in',
|
||||
'address_id': order_id.partner_id.id,
|
||||
'address_id': order_id.partner_id.id,
|
||||
'date': date_cur })
|
||||
new_order = order_obj.copy(cr, uid, order_id.id, {'name': 'Refund %s'%order_id.name,
|
||||
'lines':[],
|
||||
|
@ -197,7 +197,7 @@ class pos_return(osv.osv_memory):
|
|||
qty = data['return%s' %line.id]
|
||||
except :
|
||||
qty = line.qty
|
||||
new_move = stock_move_obj.create(cr, uid,{
|
||||
new_move = stock_move_obj.create(cr, uid, {
|
||||
'product_qty': qty ,
|
||||
'product_uos_qty': uom_obj._compute_qty(cr, uid, qty ,line.product_id.uom_id.id),
|
||||
'picking_id': new_picking,
|
||||
|
@ -207,7 +207,8 @@ class pos_return(osv.osv_memory):
|
|||
'location_dest_id': stock_dest_id,
|
||||
'name': '%s (return)' %order_id.name,
|
||||
'date': date_cur,
|
||||
'date_planned': date_cur,})
|
||||
'date_planned': date_cur
|
||||
})
|
||||
line_obj.copy(cr, uid, line.id, {'qty': -qty, 'order_id': new_order})
|
||||
order_obj.write(cr,uid, [active_id,new_order], {'state': 'done'})
|
||||
wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
|
||||
|
@ -225,25 +226,25 @@ class pos_return(osv.osv_memory):
|
|||
'type': 'ir.actions.act_window'
|
||||
}
|
||||
return act
|
||||
|
||||
|
||||
pos_return()
|
||||
|
||||
class add_product(osv.osv_memory):
|
||||
_inherit = 'pos.add.product'
|
||||
_inherit = 'pos.add.product'
|
||||
def select_product(self, cr, uid, ids, context):
|
||||
"""
|
||||
To get the product and quantity and add in order .
|
||||
"""
|
||||
To get the product and quantity and add in order .
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param context: A standard dictionary
|
||||
@param context: A standard dictionary
|
||||
@return : Retrun the add product form again for adding more product
|
||||
"""
|
||||
|
||||
"""
|
||||
|
||||
active_id=context.get('active_id', False)
|
||||
data = self.read(cr, uid, ids)
|
||||
data = data and data[0] or False
|
||||
if active_id:
|
||||
if active_id:
|
||||
order_obj = self.pool.get('pos.order')
|
||||
lines_obj = self.pool.get('pos.order.line')
|
||||
picking_obj = self.pool.get('stock.picking')
|
||||
|
@ -259,7 +260,7 @@ class add_product(osv.osv_memory):
|
|||
wf_service = netsvc.LocalService("workflow")
|
||||
return_boj=self.pool.get('pos.return')
|
||||
order_obj.add_product(cr, uid, active_id, data['product_id'], data['quantity'], context=context)
|
||||
|
||||
|
||||
for order_id in order_obj.browse(cr, uid, [active_id], context=context):
|
||||
prod=data['product_id']
|
||||
qty=data['quantity']
|
||||
|
@ -269,15 +270,16 @@ class add_product(osv.osv_memory):
|
|||
res=cr.fetchone()
|
||||
location_id=res and res[0] or None
|
||||
stock_dest_id = val.id
|
||||
|
||||
|
||||
prod_id=prod_obj.browse(cr, uid, prod)
|
||||
new_picking=picking_obj.create(cr, uid,{
|
||||
'name':'%s (Added)' %order_id.name,
|
||||
'move_lines':[],
|
||||
'state':'draft',
|
||||
'type':'out',
|
||||
'date':date_cur, })
|
||||
new_move=stock_move_obj.create(cr, uid,{
|
||||
new_picking=picking_obj.create(cr, uid, {
|
||||
'name':'%s (Added)' %order_id.name,
|
||||
'move_lines':[],
|
||||
'state':'draft',
|
||||
'type':'out',
|
||||
'date':date_cur
|
||||
})
|
||||
new_move=stock_move_obj.create(cr, uid, {
|
||||
'product_qty': qty,
|
||||
'product_uos_qty': uom_obj._compute_qty(cr, uid, prod_id.uom_id.id, qty, prod_id.uom_id.id),
|
||||
'picking_id':new_picking,
|
||||
|
@ -287,33 +289,34 @@ class add_product(osv.osv_memory):
|
|||
'location_dest_id':stock_dest_id,
|
||||
'name':'%s (return)' %order_id.name,
|
||||
'date':date_cur,
|
||||
'date_planned':date_cur,})
|
||||
|
||||
'date_planned':date_cur
|
||||
})
|
||||
|
||||
wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
|
||||
picking_obj.force_assign(cr, uid, [new_picking], context)
|
||||
order_obj.write(cr,uid,active_id,{'picking_id':new_picking})
|
||||
|
||||
|
||||
return {
|
||||
'name': _('Add Product'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'pos.add.product',
|
||||
'view_id': False,
|
||||
'target':'new',
|
||||
'context':context,
|
||||
'views': False,
|
||||
'type': 'ir.actions.act_window',
|
||||
}
|
||||
|
||||
|
||||
|
||||
return {
|
||||
'name': _('Add Product'),
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'pos.add.product',
|
||||
'view_id': False,
|
||||
'target':'new',
|
||||
'context':context,
|
||||
'views': False,
|
||||
'type': 'ir.actions.act_window',
|
||||
}
|
||||
|
||||
def close_action(self, cr, uid, ids, context):
|
||||
active_ids=context.get('active_ids', False)
|
||||
active_ids=context.get('active_ids', False)
|
||||
order_obj = self.pool.get('pos.order')
|
||||
lines_obj = self.pool.get('pos.order.line')
|
||||
picking_obj = self.pool.get('stock.picking')
|
||||
stock_move_obj = self.pool.get('stock.move')
|
||||
move_obj = self.pool.get('stock.move')
|
||||
property_obj= self.pool.get("ir.property")
|
||||
property_obj= self.pool.get("ir.property")
|
||||
invoice_obj=self.pool.get('account.invoice')
|
||||
picking_ids = picking_obj.search(cr, uid, [('pos_order', 'in', active_ids), ('state', '=', 'done')])
|
||||
clone_list = []
|
||||
|
@ -330,19 +333,20 @@ class add_product(osv.osv_memory):
|
|||
res=cr.fetchone()
|
||||
location_id=res and res[0] or None
|
||||
stock_dest_id = val.id
|
||||
|
||||
|
||||
order_obj.write(cr,uid,[order_id.id],{'type_rec':'Exchange'})
|
||||
if order_id.invoice_id:
|
||||
invoice_obj.refund(cr, uid, [order_id.invoice_id.id], time.strftime('%Y-%m-%d'), False, order_id.name)
|
||||
new_picking=picking_obj.create(cr, uid,{
|
||||
'name':'%s (return)' %order_id.name,
|
||||
'move_lines':[], 'state':'draft',
|
||||
'type':'in',
|
||||
'date':date_cur})
|
||||
new_picking=picking_obj.create(cr, uid, {
|
||||
'name':'%s (return)' %order_id.name,
|
||||
'move_lines':[], 'state':'draft',
|
||||
'type':'in',
|
||||
'date':date_cur
|
||||
})
|
||||
for line in order_id.lines:
|
||||
key=('return%s') %line.id
|
||||
if line.id and data.has_key(key):
|
||||
new_move=stock_move_obj.create(cr, uid,{
|
||||
new_move=stock_move_obj.create(cr, uid, {
|
||||
'product_qty': data['return%s' %line.id ],
|
||||
'product_uos_qty': uom_obj._compute_qty(cr, uid, data['return%s' %line.id], line.product_id.uom_id.id),
|
||||
'picking_id':new_picking,
|
||||
|
@ -352,29 +356,30 @@ class add_product(osv.osv_memory):
|
|||
'location_dest_id':stock_dest_id,
|
||||
'name':'%s (return)' %order_id.name,
|
||||
'date':date_cur,
|
||||
'date_planned':date_cur,})
|
||||
lines_obj.write(cr,uid,[line.id],{'qty_rfd':(line.qty or 0.0) + data['return%s' %line.id],
|
||||
'qty':line.qty-(data['return%s' %line.id] or 0.0)
|
||||
'date_planned':date_cur
|
||||
})
|
||||
lines_obj.write(cr,uid,[line.id], {
|
||||
'qty_rfd':(line.qty or 0.0) + data['return%s' %line.id],
|
||||
'qty':line.qty-(data['return%s' %line.id] or 0.0)
|
||||
})
|
||||
wf_service.trg_validate(uid, 'stock.picking',new_picking,'button_confirm', cr)
|
||||
picking_obj.force_assign(cr, uid, [new_picking], context)
|
||||
obj=order_obj.browse(cr,uid, active_ids[0])
|
||||
context.update({'return':'return'})
|
||||
|
||||
obj=order_obj.browse(cr,uid, active_ids[0])
|
||||
context.update({'return':'return'})
|
||||
|
||||
if obj.amount_total != obj.amount_paid:
|
||||
return {
|
||||
'name': _('Make Payment'),
|
||||
'context ':context,
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'pos.make.payment',
|
||||
'view_id': False,
|
||||
'target': 'new',
|
||||
'views': False,
|
||||
'type': 'ir.actions.act_window',
|
||||
|
||||
'name': _('Make Payment'),
|
||||
'context ':context,
|
||||
'view_type': 'form',
|
||||
'view_mode': 'form',
|
||||
'res_model': 'pos.make.payment',
|
||||
'view_id': False,
|
||||
'target': 'new',
|
||||
'views': False,
|
||||
'type': 'ir.actions.act_window',
|
||||
}
|
||||
return True
|
||||
|
||||
add_product()
|
||||
return True
|
||||
|
||||
add_product()
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<openerp>
|
||||
<data>
|
||||
<data>
|
||||
<!-- pos sales user -->
|
||||
|
||||
|
||||
<record id="view_pos_sale_user" model="ir.ui.view">
|
||||
<field name="name">Sale By User</field>
|
||||
<field name="model">pos.sale.user</field>
|
||||
|
@ -31,13 +31,6 @@
|
|||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
</record>
|
||||
<!-- <act_window name="POS Details"
|
||||
res_model="pos.details"
|
||||
src_model="pos.order"
|
||||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
id="action_report_pos_details"/> -->
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
|
@ -37,7 +37,10 @@
|
|||
'website': 'http://www.openerp.com',
|
||||
'depends': ['base'],
|
||||
'init_xml': [],
|
||||
'update_xml': ['security/ir.model.access.csv', 'process_view.xml'],
|
||||
'update_xml': [
|
||||
'security/ir.model.access.csv',
|
||||
'process_view.xml'
|
||||
],
|
||||
'demo_xml': [],
|
||||
'installable': True,
|
||||
'active': False,
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
##############################################################################
|
||||
#
|
||||
#
|
||||
# OpenERP, Open Source Management Solution
|
||||
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
|
||||
#
|
||||
|
@ -15,7 +15,7 @@
|
|||
# GNU Affero General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Affero General Public License
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
|
@ -25,22 +25,22 @@ import pooler, tools
|
|||
from osv import fields, osv
|
||||
|
||||
class Env(dict):
|
||||
|
||||
|
||||
def __init__(self, obj, user):
|
||||
self.__obj = obj
|
||||
self.__usr = user
|
||||
|
||||
|
||||
def __getitem__(self, name):
|
||||
|
||||
|
||||
if name in ('__obj', '__user'):
|
||||
return super(ExprContext, self).__getitem__(name)
|
||||
|
||||
|
||||
if name == 'user':
|
||||
return self.__user
|
||||
|
||||
|
||||
if name == 'object':
|
||||
return self.__obj
|
||||
|
||||
|
||||
return self.__obj[name]
|
||||
|
||||
class process_process(osv.osv):
|
||||
|
@ -85,7 +85,7 @@ class process_process(osv.osv):
|
|||
def graph_get(self, cr, uid, id, res_model, res_id, scale, context):
|
||||
|
||||
pool = pooler.get_pool(cr.dbname)
|
||||
|
||||
|
||||
process = pool.get('process.process').browse(cr, uid, [id], context)[0]
|
||||
|
||||
name = process.name
|
||||
|
@ -135,7 +135,7 @@ class process_process(osv.osv):
|
|||
|
||||
if node.menu_id:
|
||||
data['menu'] = {'name': node.menu_id.complete_name, 'id': node.menu_id.id}
|
||||
|
||||
|
||||
if node.model_id and node.model_id.model == res_model:
|
||||
try:
|
||||
data['active'] = eval(node.model_states, expr_context)
|
||||
|
@ -233,7 +233,7 @@ class process_process(osv.osv):
|
|||
|
||||
# calculate graph layout
|
||||
g = tools.graph(nodes.keys(), map(lambda x: (x['source'], x['target']), transitions.values()))
|
||||
g.process(start)
|
||||
g.process(start)
|
||||
g.scale(*scale) #g.scale(100, 100, 180, 120)
|
||||
graph = g.result_get()
|
||||
|
||||
|
|
|
@ -28,10 +28,10 @@ class company(osv.osv):
|
|||
help="This is the time frame analysed by the scheduler when "\
|
||||
"computing procurements. All procurements that are not between "\
|
||||
"today and today+range are skipped for futur computation."),
|
||||
}
|
||||
}
|
||||
_defaults = {
|
||||
'schedule_range': 80.0,
|
||||
}
|
||||
}
|
||||
|
||||
company()
|
||||
|
||||
|
|
|
@ -263,12 +263,5 @@
|
|||
res_model="stock.warehouse.orderpoint"
|
||||
src_model="procurement.order"/>
|
||||
|
||||
<!-- <act_window-->
|
||||
<!-- domain="[('id', '=', product_id)]"-->
|
||||
<!-- id="act_product_product_2_stock_warehouse_orderpoint"-->
|
||||
<!-- name="Product"-->
|
||||
<!-- res_model="product.product"-->
|
||||
<!-- src_model="procurement.order"/>-->
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -259,7 +259,7 @@ class procurement_order(osv.osv):
|
|||
'act_from': user_id,
|
||||
'act_to': user_id,
|
||||
'body': '\n'.join(report)
|
||||
})
|
||||
})
|
||||
if use_new_cursor:
|
||||
cr.commit()
|
||||
cr.close()
|
||||
|
|
|
@ -47,27 +47,27 @@ class make_procurement(osv.osv_memory):
|
|||
'warehouse_id': fields.many2one('stock.warehouse', 'Warehouse', required=True),
|
||||
'date_planned': fields.date('Planned Date', required=True),
|
||||
}
|
||||
|
||||
|
||||
_defaults = {
|
||||
'date_planned': lambda *args: time.strftime('%Y-%m-%d'),
|
||||
'qty': lambda *args: 1.0,
|
||||
'date_planned': lambda *args: time.strftime('%Y-%m-%d'),
|
||||
'qty': lambda *args: 1.0,
|
||||
}
|
||||
|
||||
|
||||
def make_procurement(self, cr, uid, ids, context=None):
|
||||
""" Creates procurement order for selected product.
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param ids: List of IDs selected
|
||||
@param context: A standard dictionary
|
||||
@return: A dictionary which loads Procurement form view.
|
||||
@param ids: List of IDs selected
|
||||
@param context: A standard dictionary
|
||||
@return: A dictionary which loads Procurement form view.
|
||||
"""
|
||||
user = self.pool.get('res.users').browse(cr, uid, uid, context).login
|
||||
wh_obj = self.pool.get('stock.warehouse')
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
procurement_obj = self.pool.get('procurement.order')
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
data_obj = self.pool.get('ir.model.data')
|
||||
|
||||
|
||||
for proc in self.browse(cr, uid, ids):
|
||||
wh = wh_obj.browse(cr, uid, proc.warehouse_id.id, context)
|
||||
procure_id = procurement_obj.create(cr, uid, {
|
||||
|
@ -79,42 +79,42 @@ class make_procurement(osv.osv_memory):
|
|||
'location_id': wh.lot_stock_id.id,
|
||||
'procure_method':'make_to_order',
|
||||
})
|
||||
|
||||
|
||||
wf_service.trg_validate(uid, 'procurement.order', procure_id, 'button_confirm', cr)
|
||||
|
||||
|
||||
|
||||
|
||||
id2 = data_obj._get_id(cr, uid, 'procurement', 'procurement_tree_view')
|
||||
id3 = data_obj._get_id(cr, uid, 'procurement', 'procurement_form_view')
|
||||
|
||||
|
||||
if id2:
|
||||
id2 = data_obj.browse(cr, uid, id2, context=context).res_id
|
||||
if id3:
|
||||
id3 = data_obj.browse(cr, uid, id3, context=context).res_id
|
||||
|
||||
|
||||
return {
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'procurement.order',
|
||||
'res_id' : procure_id,
|
||||
'views': [(id3,'form'),(id2,'tree')],
|
||||
'type': 'ir.actions.act_window',
|
||||
'view_type': 'form',
|
||||
'view_mode': 'tree,form',
|
||||
'res_model': 'procurement.order',
|
||||
'res_id' : procure_id,
|
||||
'views': [(id3,'form'),(id2,'tree')],
|
||||
'type': 'ir.actions.act_window',
|
||||
}
|
||||
|
||||
|
||||
def default_get(self, cr, uid, fields, context=None):
|
||||
""" To get default values for the object.
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param fields: List of fields for which we want default values
|
||||
@param context: A standard dictionary
|
||||
@return: A dictionary which of fields with values.
|
||||
@param fields: List of fields for which we want default values
|
||||
@param context: A standard dictionary
|
||||
@return: A dictionary which of fields with values.
|
||||
"""
|
||||
record_id = context and context.get('active_id', False) or False
|
||||
|
||||
res = super(make_procurement, self).default_get(cr, uid, fields, context=context)
|
||||
product_id = self.pool.get('product.product').browse(cr, uid, record_id, context=context).id
|
||||
if 'product_id' in fields:
|
||||
res.update({'product_id':product_id})
|
||||
res.update({'product_id':product_id})
|
||||
return res
|
||||
|
||||
make_procurement()
|
||||
|
|
|
@ -25,28 +25,27 @@ from osv import osv, fields
|
|||
class procurement_compute(osv.osv_memory):
|
||||
_name = 'procurement.order.compute'
|
||||
_description = 'Compute Procurement'
|
||||
|
||||
|
||||
def _procure_calculation_procure(self, cr, uid, ids, context):
|
||||
try:
|
||||
proc_obj = self.pool.get('procurement.order')
|
||||
proc_obj._procure_confirm(cr, uid, use_new_cursor=cr.dbname, context=context)
|
||||
finally:
|
||||
pass
|
||||
#cr.close()
|
||||
return {}
|
||||
|
||||
|
||||
def procure_calculation(self, cr, uid, ids, context):
|
||||
"""
|
||||
"""
|
||||
@param self: The object pointer.
|
||||
@param cr: A database cursor
|
||||
@param uid: ID of the user currently logged in
|
||||
@param ids: List of IDs selected
|
||||
@param context: A standard dictionary
|
||||
@param ids: List of IDs selected
|
||||
@param context: A standard dictionary
|
||||
"""
|
||||
threaded_calculation = threading.Thread(target=self._procure_calculation_procure, args=(cr, uid, ids, context))
|
||||
threaded_calculation.start()
|
||||
return {}
|
||||
|
||||
|
||||
procurement_compute()
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||
|
|
|
@ -22,13 +22,5 @@
|
|||
</field>
|
||||
</record>
|
||||
|
||||
<!-- <act_window name="Compute Procurements" -->
|
||||
<!-- res_model="procurement.order.compute"-->
|
||||
<!-- src_model="procurement.order"-->
|
||||
<!-- view_mode="form"-->
|
||||
<!-- target="new" -->
|
||||
<!-- key2="client_action_multi" -->
|
||||
<!-- id="act_compute_procurement"/> -->
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
</openerp>
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue