[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
|
Credits: Sistheo Zeekom CrysaLEAD
|
||||||
""",
|
""",
|
||||||
"depends" : ['base', 'account', 'account_chart', 'account_report', 'base_vat'],
|
"depends" : ['base', 'account', 'account_chart', 'account_report', 'base_vat'],
|
||||||
"init_xml" : [
|
"init_xml" : [],
|
||||||
],
|
|
||||||
"update_xml" : [
|
"update_xml" : [
|
||||||
"report.xml",
|
"report.xml",
|
||||||
"pcg.xml",
|
"pcg.xml",
|
||||||
|
|
|
@ -35,8 +35,8 @@ class l10n_fr_report(osv.osv):
|
||||||
'line_ids': fields.one2many('l10n.fr.line', 'report_id', 'Lines'),
|
'line_ids': fields.one2many('l10n.fr.line', 'report_id', 'Lines'),
|
||||||
}
|
}
|
||||||
_sql_constraints = [
|
_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()
|
l10n_fr_report()
|
||||||
|
|
||||||
class l10n_fr_line(osv.osv):
|
class l10n_fr_line(osv.osv):
|
||||||
|
@ -49,7 +49,7 @@ class l10n_fr_line(osv.osv):
|
||||||
'report_id': fields.many2one('l10n.fr.report', 'Report'),
|
'report_id': fields.many2one('l10n.fr.report', 'Report'),
|
||||||
}
|
}
|
||||||
_sql_constraints = [
|
_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()
|
l10n_fr_line()
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,5 @@
|
||||||
<?xml version="1.0"?>
|
<?xml version="1.0"?>
|
||||||
<openerp>
|
<openerp>
|
||||||
<data>
|
<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>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
<record id="account_type_dettes" model="account.account.type">
|
<record id="account_type_dettes" model="account.account.type">
|
||||||
<field name="name">Dettes long terme</field>
|
<field name="name">Dettes long terme</field>
|
||||||
<field name="code">dettes</field>
|
<field name="code">dettes</field>
|
||||||
<!-- <field name="report_type">?</field> -->
|
|
||||||
<field name="close_method">balance</field>
|
<field name="close_method">balance</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
@ -35,7 +34,6 @@
|
||||||
<record id="account_type_cloture" model="account.account.type">
|
<record id="account_type_cloture" model="account.account.type">
|
||||||
<field name="name">Cloture</field>
|
<field name="name">Cloture</field>
|
||||||
<field name="code">cloture</field>
|
<field name="code">cloture</field>
|
||||||
<!-- <field name="report_type">?</field> -->
|
|
||||||
<field name="close_method">balance</field>
|
<field name="close_method">balance</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
@ -76,7 +74,6 @@
|
||||||
<record model="account.account.type" id="account_type_tax">
|
<record model="account.account.type" id="account_type_tax">
|
||||||
<field name="name">Tax</field>
|
<field name="name">Tax</field>
|
||||||
<field name="code">tax</field>
|
<field name="code">tax</field>
|
||||||
<!-- <field name="report_type">?</field> -->
|
|
||||||
<field name="close_method">unreconciled</field>
|
<field name="close_method">unreconciled</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
@ -104,14 +101,12 @@
|
||||||
<record model="account.account.type" id="account_type_provision">
|
<record model="account.account.type" id="account_type_provision">
|
||||||
<field name="name">Provisions</field>
|
<field name="name">Provisions</field>
|
||||||
<field name="code">provision</field>
|
<field name="code">provision</field>
|
||||||
<!-- <field name="report_type">?</field> -->
|
|
||||||
<field name="close_method">balance</field>
|
<field name="close_method">balance</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="account.account.type" id="account_type_commitment">
|
<record model="account.account.type" id="account_type_commitment">
|
||||||
<field name="name">Engagements</field>
|
<field name="name">Engagements</field>
|
||||||
<field name="code">commitment</field>
|
<field name="code">commitment</field>
|
||||||
<!-- <field name="report_type">?</field> -->
|
|
||||||
<field name="close_method">balance</field>
|
<field name="close_method">balance</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
@ -125,7 +120,6 @@
|
||||||
<record model="account.account.type" id="account_type_special">
|
<record model="account.account.type" id="account_type_special">
|
||||||
<field name="name">Comptes spéciaux</field>
|
<field name="name">Comptes spéciaux</field>
|
||||||
<field name="code">special</field>
|
<field name="code">special</field>
|
||||||
<!-- <field name="report_type">?</field> -->
|
|
||||||
<field name="close_method">none</field>
|
<field name="close_method">none</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
@ -9255,49 +9249,5 @@
|
||||||
<field name="parent_id" ref="pcg_89"/>
|
<field name="parent_id" ref="pcg_89"/>
|
||||||
</record>
|
</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>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -504,9 +504,6 @@
|
||||||
|
|
||||||
<record id="pcg_bpvar10" model="l10n.fr.line">
|
<record id="pcg_bpvar10" model="l10n.fr.line">
|
||||||
<field name="name">Capitaux propres : Résultat de l'exercice</field>
|
<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="definition">{'load':['-:7:S','-:6:S'], 'except':[]}</field>
|
||||||
<field name="code">bpvar10</field>
|
<field name="code">bpvar10</field>
|
||||||
<field name="report_id" ref="pcg_bilan"/>
|
<field name="report_id" ref="pcg_bilan"/>
|
||||||
|
|
|
@ -32,7 +32,7 @@ from report import report_sxw
|
||||||
class base_report(report_sxw.rml_parse):
|
class base_report(report_sxw.rml_parse):
|
||||||
def __init__(self, cr, uid, name, context):
|
def __init__(self, cr, uid, name, context):
|
||||||
super(base_report, self).__init__(cr, uid, name, context=context)
|
super(base_report, self).__init__(cr, uid, name, context=context)
|
||||||
self.localcontext.update( {
|
self.localcontext.update({
|
||||||
'time': time,
|
'time': time,
|
||||||
'_load': self._load,
|
'_load': self._load,
|
||||||
'_get_variable': self._get_variable,
|
'_get_variable': self._get_variable,
|
||||||
|
@ -62,7 +62,6 @@ class base_report(report_sxw.rml_parse):
|
||||||
return self.localcontext[variable]
|
return self.localcontext[variable]
|
||||||
|
|
||||||
def _load_accounts(self,form,code,definition,fiscalyear,period_query_cond):
|
def _load_accounts(self,form,code,definition,fiscalyear,period_query_cond):
|
||||||
#self.context.copy()
|
|
||||||
accounts={}
|
accounts={}
|
||||||
for x in definition['load']:
|
for x in definition['load']:
|
||||||
p=x.split(":")
|
p=x.split(":")
|
||||||
|
|
|
@ -159,17 +159,6 @@
|
||||||
<field name="parent_id" ref="IA_AC011"/>
|
<field name="parent_id" ref="IA_AC011"/>
|
||||||
</record>
|
</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">
|
<record model="account.account.template" id="IA_AC0116">
|
||||||
<field name="name">Total Sundry Debtors Account</field>
|
<field name="name">Total Sundry Debtors Account</field>
|
||||||
<field name="code">IA_AC0116</field>
|
<field name="code">IA_AC0116</field>
|
||||||
|
@ -181,7 +170,6 @@
|
||||||
<field name="parent_id" ref="IA_AC011"/>
|
<field name="parent_id" ref="IA_AC011"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
|
||||||
<record model="account.account.template" id="IA_AC01161">
|
<record model="account.account.template" id="IA_AC01161">
|
||||||
<field name="name">Sundry Debtors Account</field>
|
<field name="name">Sundry Debtors Account</field>
|
||||||
<field name="code">IA_AC01161</field>
|
<field name="code">IA_AC01161</field>
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
<record id="account_type_creances" model="account.account.type">
|
<record id="account_type_creances" model="account.account.type">
|
||||||
<field name="name">Créances</field>
|
<field name="name">Créances</field>
|
||||||
<field name="code">creances</field>
|
<field name="code">creances</field>
|
||||||
<!-- <field name="report_type">?</field> -->
|
|
||||||
<field name="close_method">balance</field>
|
<field name="close_method">balance</field>
|
||||||
</record>
|
</record>
|
||||||
<record id="account_type_cash_equity" model="account.account.type">
|
<record id="account_type_cash_equity" model="account.account.type">
|
||||||
|
|
|
@ -64,7 +64,7 @@ def extract_keys(lines):
|
||||||
keys = []
|
keys = []
|
||||||
for line in lines:
|
for line in lines:
|
||||||
if line.startswith('/V'):
|
if line.startswith('/V'):
|
||||||
pass #print 'value',line
|
pass
|
||||||
elif line.startswith('/T'):
|
elif line.startswith('/T'):
|
||||||
key = line[7:-2]
|
key = line[7:-2]
|
||||||
key = ''.join(key.split('\x00'))
|
key = ''.join(key.split('\x00'))
|
||||||
|
@ -85,7 +85,6 @@ def write_fields(out, fields):
|
||||||
for key in fields:
|
for key in fields:
|
||||||
value = fields[key]
|
value = fields[key]
|
||||||
write_field(out, key, value)
|
write_field(out, key, value)
|
||||||
# write_field(out, key+"a", value) # pour copie-carbone sur autres pages
|
|
||||||
out.write(TAIL)
|
out.write(TAIL)
|
||||||
|
|
||||||
def extract_keys_from_pdf(filename):
|
def extract_keys_from_pdf(filename):
|
||||||
|
|
|
@ -47,12 +47,9 @@
|
||||||
'lunch_view.xml',
|
'lunch_view.xml',
|
||||||
'lunch_report.xml',
|
'lunch_report.xml',
|
||||||
'report/report_lunch_order_view.xml',
|
'report/report_lunch_order_view.xml',
|
||||||
#'process/lunch_process.xml'
|
|
||||||
],
|
],
|
||||||
"demo_xml": ['lunch_demo.xml',
|
"demo_xml": ['lunch_demo.xml'],
|
||||||
],
|
"test": ['test/test_lunch.yml'],
|
||||||
"test": ['test/test_lunch.yml'
|
|
||||||
],
|
|
||||||
"installable": True,
|
"installable": True,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,7 +52,7 @@ class lunch_product(osv.osv):
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'active': lambda *a : True,
|
'active': lambda *a : True,
|
||||||
}
|
}
|
||||||
|
|
||||||
lunch_product()
|
lunch_product()
|
||||||
|
|
||||||
|
@ -82,7 +82,7 @@ class lunch_cashbox(osv.osv):
|
||||||
'manager': fields.many2one('res.users', 'Manager'),
|
'manager': fields.many2one('res.users', 'Manager'),
|
||||||
'name': fields.char('Name', size=30, required=True, unique = True),
|
'name': fields.char('Name', size=30, required=True, unique = True),
|
||||||
'sum_remain': fields.function(amount_available, method=True, string='Remained Total'),
|
'sum_remain': fields.function(amount_available, method=True, string='Remained Total'),
|
||||||
}
|
}
|
||||||
|
|
||||||
lunch_cashbox()
|
lunch_cashbox()
|
||||||
|
|
||||||
|
@ -100,10 +100,10 @@ class lunch_cashmove(osv.osv):
|
||||||
'box': fields.many2one('lunch.cashbox', 'Box Name', size=30, required=True),
|
'box': fields.many2one('lunch.cashbox', 'Box Name', size=30, required=True),
|
||||||
'active': fields.boolean('Active'),
|
'active': fields.boolean('Active'),
|
||||||
'create_date': fields.datetime('Created date', readonly=True),
|
'create_date': fields.datetime('Created date', readonly=True),
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'active': lambda *a: True,
|
'active': lambda *a: True,
|
||||||
}
|
}
|
||||||
|
|
||||||
lunch_cashmove()
|
lunch_cashmove()
|
||||||
|
@ -215,7 +215,7 @@ class report_lunch_amount(osv.osv):
|
||||||
'user_id': fields.many2one('res.users', 'User Name', readonly=True),
|
'user_id': fields.many2one('res.users', 'User Name', readonly=True),
|
||||||
'amount': fields.float('Amount', readonly=True, digits=(16, 2)),
|
'amount': fields.float('Amount', readonly=True, digits=(16, 2)),
|
||||||
'box': fields.many2one('lunch.cashbox', 'Box Name', size=30, readonly=True),
|
'box': fields.many2one('lunch.cashbox', 'Box Name', size=30, readonly=True),
|
||||||
}
|
}
|
||||||
|
|
||||||
def init(self, cr):
|
def init(self, cr):
|
||||||
|
|
||||||
|
|
|
@ -36,8 +36,8 @@ class order(report_sxw.rml_parse):
|
||||||
super(order, self).__init__(cr, uid, name, context)
|
super(order, self).__init__(cr, uid, name, context)
|
||||||
|
|
||||||
self.localcontext.update({
|
self.localcontext.update({
|
||||||
'time': time,
|
'time': time,
|
||||||
'sum_price': self.sum_price,
|
'sum_price': self.sum_price,
|
||||||
})
|
})
|
||||||
|
|
||||||
report_sxw.report_sxw('report.lunch.order', 'lunch.order',
|
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'),
|
'user_id': fields.many2one('res.users', 'User Name'),
|
||||||
'box_name': fields.char('Name', size=30),
|
'box_name': fields.char('Name', size=30),
|
||||||
'price_total':fields.float('Total Price', readonly=True),
|
'price_total':fields.float('Total Price', readonly=True),
|
||||||
}
|
}
|
||||||
_order = 'date desc'
|
_order = 'date desc'
|
||||||
def init(self, cr):
|
def init(self, cr):
|
||||||
tools.drop_view_if_exists(cr, 'report_lunch_order')
|
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),))
|
and box IN %s" , (tuple(data),))
|
||||||
|
|
||||||
for (user_id, box_id, amount) in res:
|
for (user_id, box_id, amount) in res:
|
||||||
cashmove_ref.create(cr, uid, {'name': 'Summary for user' + str(user_id),
|
cashmove_ref.create(cr, uid, {
|
||||||
'amount': amount,
|
'name': 'Summary for user' + str(user_id),
|
||||||
'user_cashmove': user_id,
|
'amount': amount,
|
||||||
'box': box_id,
|
'user_cashmove': user_id,
|
||||||
'active': True,
|
'box': box_id,
|
||||||
})
|
'active': True,
|
||||||
|
})
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
lunch_cashbox_clean()
|
lunch_cashbox_clean()
|
||||||
|
|
|
@ -29,8 +29,8 @@ class lunch_order_confirm(osv.osv_memory):
|
||||||
_description = "confirm Order"
|
_description = "confirm Order"
|
||||||
|
|
||||||
_columns = {
|
_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):
|
def confirm(self, cr, uid, ids, context):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -60,10 +60,10 @@ class mailgate_thread(osv.osv):
|
||||||
default = {}
|
default = {}
|
||||||
|
|
||||||
default.update({
|
default.update({
|
||||||
'message_ids': [],
|
'message_ids': [],
|
||||||
'date_closed': False,
|
'date_closed': False,
|
||||||
'date_open': False
|
'date_open': False
|
||||||
})
|
})
|
||||||
return super(mailgate_thread, self).copy(cr, uid, id, default, context=context)
|
return super(mailgate_thread, self).copy(cr, uid, id, default, context=context)
|
||||||
|
|
||||||
def message_new(self, cr, uid, msg, context):
|
def message_new(self, cr, uid, msg, context):
|
||||||
|
@ -256,19 +256,19 @@ class mailgate_tool(osv.osv_memory):
|
||||||
msg_pool = self.pool.get('mailgate.message')
|
msg_pool = self.pool.get('mailgate.message')
|
||||||
for res_id in res_ids:
|
for res_id in res_ids:
|
||||||
msg_data = {
|
msg_data = {
|
||||||
'name': msg.get('subject', 'No subject'),
|
'name': msg.get('subject', 'No subject'),
|
||||||
'date': msg.get('date'),
|
'date': msg.get('date'),
|
||||||
'description': msg.get('body', msg.get('from')),
|
'description': msg.get('body', msg.get('from')),
|
||||||
'history': True,
|
'history': True,
|
||||||
'res_model': model,
|
'res_model': model,
|
||||||
'email_cc': msg.get('cc'),
|
'email_cc': msg.get('cc'),
|
||||||
'email_from': msg.get('from'),
|
'email_from': msg.get('from'),
|
||||||
'email_to': msg.get('to'),
|
'email_to': msg.get('to'),
|
||||||
'message_id': msg.get('message-id'),
|
'message_id': msg.get('message-id'),
|
||||||
'references': msg.get('references') or msg.get('in-reply-to'),
|
'references': msg.get('references') or msg.get('in-reply-to'),
|
||||||
'res_id': res_id,
|
'res_id': res_id,
|
||||||
'user_id': uid,
|
'user_id': uid,
|
||||||
'attachment_ids': [(6, 0, attach)]
|
'attachment_ids': [(6, 0, attach)]
|
||||||
}
|
}
|
||||||
msg_pool.create(cr, uid, msg_data, context=context)
|
msg_pool.create(cr, uid, msg_data, context=context)
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -6,4 +6,3 @@
|
||||||
</record>
|
</record>
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
<!--group_marketing_user-->
|
|
||||||
|
|
|
@ -349,8 +349,6 @@ class marketing_campaign_activity(osv.osv):
|
||||||
'from_ids': fields.one2many('marketing.campaign.transition',
|
'from_ids': fields.one2many('marketing.campaign.transition',
|
||||||
'activity_to_id',
|
'activity_to_id',
|
||||||
'Previous Activities'),
|
'Previous Activities'),
|
||||||
#'subcampaign_id': fields.many2one('marketing.campaign', 'Sub-Campaign',
|
|
||||||
# domain="[('object_id', '=', object_id)]"),
|
|
||||||
'variable_cost': fields.float('Variable Cost'),
|
'variable_cost': fields.float('Variable Cost'),
|
||||||
'revenue': fields.float('Revenue'),
|
'revenue': fields.float('Revenue'),
|
||||||
'signal': fields.char('Signal', size=128,
|
'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)
|
service = netsvc.LocalService('report.%s'%activity.report_id.report_name)
|
||||||
(report_data, format) = service.create(cr, uid, [], {}, {})
|
(report_data, format) = service.create(cr, uid, [], {}, {})
|
||||||
attach_vals = {
|
attach_vals = {
|
||||||
'name': '%s_%s_%s'%(activity.report_id.report_name,
|
'name': '%s_%s_%s'%(activity.report_id.report_name,
|
||||||
activity.name,workitem.partner_id.name),
|
activity.name,workitem.partner_id.name),
|
||||||
'datas_fname': '%s.%s'%(activity.report_id.report_name,
|
'datas_fname': '%s.%s'%(activity.report_id.report_name,
|
||||||
activity.report_id.report_type),
|
activity.report_id.report_type),
|
||||||
'parent_id': activity.report_directory_id.id,
|
'parent_id': activity.report_directory_id.id,
|
||||||
'datas': base64.encodestring(report_data),
|
'datas': base64.encodestring(report_data),
|
||||||
'file_type': format
|
'file_type': format
|
||||||
}
|
}
|
||||||
self.pool.get('ir.attachment').create(cr, uid, attach_vals)
|
self.pool.get('ir.attachment').create(cr, uid, attach_vals)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
@ -430,9 +428,10 @@ class marketing_campaign_transition(osv.osv):
|
||||||
_name = "marketing.campaign.transition"
|
_name = "marketing.campaign.transition"
|
||||||
_description = "Campaign Transition"
|
_description = "Campaign Transition"
|
||||||
|
|
||||||
_interval_units = [('hours', 'Hour(s)'), ('days', 'Day(s)'),
|
_interval_units = [
|
||||||
('months', 'Month(s)'), ('years','Year(s)')]
|
('hours', 'Hour(s)'), ('days', 'Day(s)'),
|
||||||
|
('months', 'Month(s)'), ('years','Year(s)')
|
||||||
|
]
|
||||||
|
|
||||||
def _get_name(self, cr, uid, ids, fn, args, context=None):
|
def _get_name(self, cr, uid, ids, fn, args, context=None):
|
||||||
result = dict.fromkeys(ids, False)
|
result = dict.fromkeys(ids, False)
|
||||||
|
@ -671,8 +670,10 @@ class marketing_campaign_workitem(osv.osv):
|
||||||
}
|
}
|
||||||
|
|
||||||
elif wi_obj.activity_id.type == 'paper':
|
elif wi_obj.activity_id.type == 'paper':
|
||||||
datas = {'ids': [wi_obj.res_id],
|
datas = {
|
||||||
'model': wi_obj.object_id.model}
|
'ids': [wi_obj.res_id],
|
||||||
|
'model': wi_obj.object_id.model
|
||||||
|
}
|
||||||
res = {
|
res = {
|
||||||
'type' : 'ir.actions.report.xml',
|
'type' : 'ir.actions.report.xml',
|
||||||
'report_name': wi_obj.activity_id.report_id.report_name,
|
'report_name': wi_obj.activity_id.report_id.report_name,
|
||||||
|
|
|
@ -249,9 +249,6 @@
|
||||||
<field name="report_directory_id" attrs="{'required':[('type','=','paper')]}" />
|
<field name="report_directory_id" attrs="{'required':[('type','=','paper')]}" />
|
||||||
</group>
|
</group>
|
||||||
<field name="server_action_id" attrs="{'required':[('type','=','action')],'invisible':[('type','!=','action')]}" domain="[('model_id','=',object_id)]" />
|
<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>
|
||||||
</group>
|
</group>
|
||||||
<newline/>
|
<newline/>
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
import tools
|
import tools
|
||||||
from osv import fields, osv
|
from osv import fields, osv
|
||||||
|
|
||||||
class campaign_analysis(osv.osv): #{{{
|
class campaign_analysis(osv.osv):
|
||||||
_name = "campaign.analysis"
|
_name = "campaign.analysis"
|
||||||
_description = "Campaign Analysis"
|
_description = "Campaign Analysis"
|
||||||
_auto = False
|
_auto = False
|
||||||
|
@ -89,4 +89,4 @@ class campaign_analysis(osv.osv): #{{{
|
||||||
wi.date::date
|
wi.date::date
|
||||||
)
|
)
|
||||||
""")
|
""")
|
||||||
campaign_analysis() #}}}
|
campaign_analysis()
|
||||||
|
|
|
@ -5,9 +5,6 @@
|
||||||
<record id="base.res_groups_email_template_admin" model="res.groups">
|
<record id="base.res_groups_email_template_admin" model="res.groups">
|
||||||
<field name="name">Marketing / User</field>
|
<field name="name">Marketing / User</field>
|
||||||
</record>
|
</record>
|
||||||
<!--record id="res_groups_marketing_campaign" model="res.groups">
|
|
||||||
<field name="name">Marketing / Campaign</field>
|
|
||||||
</record-->
|
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -31,19 +31,19 @@ class mailchimp_account(osv.osv):
|
||||||
_name = "mailchimp.account"
|
_name = "mailchimp.account"
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'name': fields.char('Account Name', size=64),
|
'name': fields.char('Account Name', size=64),
|
||||||
'username': fields.char('Username', size=64, required=True),
|
'username': fields.char('Username', size=64, required=True),
|
||||||
'password': fields.char('Password', size=64, required=True),
|
'password': fields.char('Password', size=64, required=True),
|
||||||
'apikey': fields.char('API Key', size=128),
|
'apikey': fields.char('API Key', size=128),
|
||||||
'data_center': fields.selection([('us1', 'US1'), ('us2', 'US2'),
|
'data_center': fields.selection([('us1', 'US1'), ('us2', 'US2'),
|
||||||
('uk1', 'UK1')], 'Data Center'),
|
('uk1', 'UK1')], 'Data Center'),
|
||||||
'state': fields.selection([('draft', 'Draft'), ('approved', 'Approved'),
|
'state': fields.selection([('draft', 'Draft'), ('approved', 'Approved'),
|
||||||
('cancelled', 'Cancelled')], 'State', readonly=True)
|
('cancelled', 'Cancelled')], 'State', readonly=True)
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'state': lambda *a: 'draft'
|
'state': lambda *a: 'draft'
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_response(self, cr, uid, mailchimp_id, method, params={}):
|
def get_response(self, cr, uid, mailchimp_id, method, params={}):
|
||||||
mailchimp_account = self.browse(cr, uid, mailchimp_id)
|
mailchimp_account = self.browse(cr, uid, mailchimp_id)
|
||||||
|
@ -83,7 +83,8 @@ class mailchimp_account(osv.osv):
|
||||||
def add_partner_list(self, cr, uid, account_id, list_id, partner_ids):
|
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
|
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):
|
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_address' : partner.email,
|
||||||
'email_type':'text',
|
'email_type':'text',
|
||||||
'merge_vars[FNAME]':partner.name ,
|
'merge_vars[FNAME]':partner.name ,
|
||||||
|
@ -92,7 +93,8 @@ class mailchimp_account(osv.osv):
|
||||||
'merge_vars[website]' : partner.website,
|
'merge_vars[website]' : partner.website,
|
||||||
'merge_vars[address][country]' : partner.country.code,
|
'merge_vars[address][country]' : partner.country.code,
|
||||||
'merge_vars[address][city]' : partner.city,
|
'merge_vars[address][city]' : partner.city,
|
||||||
'double_optin':False}
|
'double_optin':False
|
||||||
|
}
|
||||||
vals[partner.id] = self.get_response(cr, uid, account_id,
|
vals[partner.id] = self.get_response(cr, uid, account_id,
|
||||||
'listSubscribe', params)
|
'listSubscribe', params)
|
||||||
return vals
|
return vals
|
||||||
|
@ -115,9 +117,9 @@ class marketing_campaign(osv.osv):
|
||||||
_inherit = "marketing.campaign"
|
_inherit = "marketing.campaign"
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'mailchimp_account_id': fields.many2one(
|
'mailchimp_account_id': fields.many2one(
|
||||||
'mailchimp.account', 'Account'),
|
'mailchimp.account', 'Account'),
|
||||||
'mailchimp_campaign': fields.char('campaign', size=64),
|
'mailchimp_campaign': fields.char('campaign', size=64),
|
||||||
}
|
}
|
||||||
marketing_campaign()
|
marketing_campaign()
|
||||||
|
|
||||||
|
@ -126,9 +128,9 @@ class marketing_campaign_activity(osv.osv):
|
||||||
_inherit = "marketing.campaign.activity"
|
_inherit = "marketing.campaign.activity"
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'mailchimp_account_id': fields.many2one(
|
'mailchimp_account_id': fields.many2one(
|
||||||
'mailchimp.account', 'Account'),
|
'mailchimp.account', 'Account'),
|
||||||
'mailchimp_list': fields.char('List', size=64),
|
'mailchimp_list': fields.char('List', size=64),
|
||||||
}
|
}
|
||||||
|
|
||||||
def onchange_mailchimp(self, cr, uid, ids, mailchimp_account_id):
|
def onchange_mailchimp(self, cr, uid, ids, mailchimp_account_id):
|
||||||
|
@ -163,34 +165,38 @@ class marketing_campaign_activity(osv.osv):
|
||||||
model_obj = self.pool.get(res_model).browse(cr, uid, res_id)
|
model_obj = self.pool.get(res_model).browse(cr, uid, res_id)
|
||||||
params ={}
|
params ={}
|
||||||
if res_model == 'res.partner' :
|
if res_model == 'res.partner' :
|
||||||
params.update({'email_address' : model_obj.email,
|
params.update({
|
||||||
'merge_vars[FNAME]':model_obj.name and model_obj.name or '',
|
'email_address' : model_obj.email,
|
||||||
'merge_vars[website]' : model_obj.website,
|
'merge_vars[FNAME]':model_obj.name and model_obj.name or '',
|
||||||
'merge_vars[address][country]' : model_obj.country.code,
|
'merge_vars[website]' : model_obj.website,
|
||||||
})
|
'merge_vars[address][country]' : model_obj.country.code,
|
||||||
|
})
|
||||||
elif res_model == 'crm.lead' :
|
elif res_model == 'crm.lead' :
|
||||||
params.update({'email_address' : model_obj.email_from,
|
params.update({
|
||||||
'merge_vars[FNAME]':model_obj.partner_name and \
|
'email_address' : model_obj.email_from,
|
||||||
model_obj.partner_name or '',
|
'merge_vars[FNAME]':model_obj.partner_name and \
|
||||||
'merge_vars[address][country]' : model_obj.country_id and \
|
model_obj.partner_name or '',
|
||||||
model_obj.country_id.code or ''
|
'merge_vars[address][country]' : model_obj.country_id and \
|
||||||
})
|
model_obj.country_id.code or ''
|
||||||
|
})
|
||||||
if params['email_address'] :
|
if params['email_address'] :
|
||||||
user = mc_acc_obj.get_response(cr, uid, mailchimp_account_id,
|
user = mc_acc_obj.get_response(cr, uid, mailchimp_account_id,
|
||||||
'listMemberInfo',
|
'listMemberInfo', {
|
||||||
{'id' : list_id,
|
'id' : list_id,
|
||||||
'email_address': params['email_address']})
|
'email_address': params['email_address']
|
||||||
|
})
|
||||||
# if there s no user with the specify email it will return error code
|
# 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
|
# and thus we add that user otherwise user is alredy subscribe and there
|
||||||
# is no need to subscribe user again
|
# is no need to subscribe user again
|
||||||
if 'error' in user:
|
if 'error' in user:
|
||||||
params.update({'id' : list_id,
|
params.update({
|
||||||
|
'id' : list_id,
|
||||||
'email_type':'text',
|
'email_type':'text',
|
||||||
'double_optin':False,
|
'double_optin':False,
|
||||||
'merge_vars[date]' : time.strftime('%Y-%m-%d'),
|
'merge_vars[date]' : time.strftime('%Y-%m-%d'),
|
||||||
'merge_vars[address][city]' : model_obj.city and model_obj.city or '',
|
'merge_vars[address][city]' : model_obj.city and model_obj.city or '',
|
||||||
'merge_vars[phone]' : model_obj.phone and model_obj.phone or '',
|
'merge_vars[phone]' : model_obj.phone and model_obj.phone or '',
|
||||||
})
|
})
|
||||||
mc_acc_obj.get_response(cr, uid, mailchimp_account_id, 'listSubscribe', params)
|
mc_acc_obj.get_response(cr, uid, mailchimp_account_id, 'listSubscribe', params)
|
||||||
# TODO handle mailchimp error
|
# TODO handle mailchimp error
|
||||||
return True
|
return True
|
||||||
|
|
|
@ -8,4 +8,3 @@
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
<!--group_marketing_user-->
|
|
||||||
|
|
|
@ -41,17 +41,14 @@ class create_list(osv.osv_memory):
|
||||||
|
|
||||||
def onchange_mailchimp_account_id(self, cr, uid, ids, mailchimp_account_id,
|
def onchange_mailchimp_account_id(self, cr, uid, ids, mailchimp_account_id,
|
||||||
action):
|
action):
|
||||||
print mailchimp_account_id,action,
|
|
||||||
return {'value':{}}
|
return {'value':{}}
|
||||||
|
|
||||||
def create_list(self, cr, uid, ids, context=None):
|
def create_list(self, cr, uid, ids, context=None):
|
||||||
create_list_obj = self.browse(cr, uid, ids[0])
|
create_list_obj = self.browse(cr, uid, ids[0])
|
||||||
print create_list_obj.id
|
|
||||||
mailchimp_account_obj = self.pool.get('mailchimp.account')
|
mailchimp_account_obj = self.pool.get('mailchimp.account')
|
||||||
account_id = create_list_obj.mailchimp_account_id
|
account_id = create_list_obj.mailchimp_account_id
|
||||||
lists = mailchimp_account_obj.get_response(cr, uid, account_id.id, 'lists')
|
lists = mailchimp_account_obj.get_response(cr, uid, account_id.id, 'lists')
|
||||||
lists = dict([(l['name'],l['id']) for l in lists])
|
lists = dict([(l['name'],l['id']) for l in lists])
|
||||||
print lists
|
|
||||||
if create_list_obj.list_name not in lists.keys():
|
if create_list_obj.list_name not in lists.keys():
|
||||||
raise osv.except_osv(_('UserError'),
|
raise osv.except_osv(_('UserError'),
|
||||||
_('There is no list define in account %s') % (account_id.name))
|
_('There is no list define in account %s') % (account_id.name))
|
||||||
|
|
|
@ -11,9 +11,6 @@
|
||||||
<newline/>
|
<newline/>
|
||||||
<separator string="Partner" colspan="4"/>
|
<separator string="Partner" colspan="4"/>
|
||||||
<field name="partner_ids" nolabel="1" colspan="4"/>
|
<field name="partner_ids" nolabel="1" colspan="4"/>
|
||||||
<!--group ">
|
|
||||||
<field name="mailchimp_list_id" />
|
|
||||||
</group-->
|
|
||||||
<group col="4" colspan="4">
|
<group col="4" colspan="4">
|
||||||
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
<button special="cancel" string="Cancel" icon="gtk-cancel"/>
|
||||||
<button name="create_list" string="Update" type="object" icon="gtk-ok"/>
|
<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"/>
|
<field name="account_id" ref="account.a_sale"/>
|
||||||
</record>
|
</record>
|
||||||
</data>
|
</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>
|
</openerp>
|
||||||
|
|
|
@ -37,14 +37,14 @@ STATE = [
|
||||||
]
|
]
|
||||||
|
|
||||||
STATE_PRIOR = {
|
STATE_PRIOR = {
|
||||||
'none' : 0,
|
'none' : 0,
|
||||||
'canceled' : 1,
|
'canceled' : 1,
|
||||||
'old' : 2,
|
'old' : 2,
|
||||||
'waiting' : 3,
|
'waiting' : 3,
|
||||||
'invoiced' : 4,
|
'invoiced' : 4,
|
||||||
'free' : 6,
|
'free' : 6,
|
||||||
'paid' : 7
|
'paid' : 7
|
||||||
}
|
}
|
||||||
|
|
||||||
class membership_line(osv.osv):
|
class membership_line(osv.osv):
|
||||||
'''Member line'''
|
'''Member line'''
|
||||||
|
@ -124,21 +124,21 @@ class membership_line(osv.osv):
|
||||||
_description = __doc__
|
_description = __doc__
|
||||||
_name = 'membership.membership_line'
|
_name = 'membership.membership_line'
|
||||||
_columns = {
|
_columns = {
|
||||||
'partner': fields.many2one('res.partner', 'Partner', ondelete='cascade', select=1),
|
'partner': fields.many2one('res.partner', 'Partner', ondelete='cascade', select=1),
|
||||||
'membership_id': fields.many2one('product.product', string="Membership", required=True),
|
'membership_id': fields.many2one('product.product', string="Membership", required=True),
|
||||||
'date_from': fields.date('From', readonly=True),
|
'date_from': fields.date('From', readonly=True),
|
||||||
'date_to': fields.date('To', readonly=True),
|
'date_to': fields.date('To', readonly=True),
|
||||||
'date_cancel' : fields.date('Cancel date'),
|
'date_cancel' : fields.date('Cancel date'),
|
||||||
'date': fields.date('Join Date'),
|
'date': fields.date('Join Date'),
|
||||||
'member_price':fields.float('Member Price', digits_compute= dp.get_precision('Sale Price'), required=True),
|
'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_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),
|
'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),
|
'state': fields.function(_state, method=True, string='State', type='selection', selection=STATE),
|
||||||
}
|
}
|
||||||
_rec_name = 'partner'
|
_rec_name = 'partner'
|
||||||
_order = 'id desc'
|
_order = 'id desc'
|
||||||
_constraints = [
|
_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()
|
membership_line()
|
||||||
|
@ -255,11 +255,11 @@ class Partner(osv.osv):
|
||||||
else:
|
else:
|
||||||
partner_id = partner.id
|
partner_id = partner.id
|
||||||
|
|
||||||
res[partner.id]={
|
res[partner.id] = {
|
||||||
'membership_start': False,
|
'membership_start': False,
|
||||||
'membership_stop': False,
|
'membership_stop': False,
|
||||||
'membership_cancel': False
|
'membership_cancel': False
|
||||||
}
|
}
|
||||||
|
|
||||||
if name == 'membership_start':
|
if name == 'membership_start':
|
||||||
line_id = member_line_obj.search(cr, uid, [('partner', '=', partner_id)],
|
line_id = member_line_obj.search(cr, uid, [('partner', '=', partner_id)],
|
||||||
|
@ -427,7 +427,7 @@ Partner()
|
||||||
class product_template(osv.osv):
|
class product_template(osv.osv):
|
||||||
_inherit = 'product.template'
|
_inherit = 'product.template'
|
||||||
_columns = {
|
_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()
|
product_template()
|
||||||
|
|
||||||
|
@ -451,15 +451,14 @@ class Product(osv.osv):
|
||||||
'''Product'''
|
'''Product'''
|
||||||
_inherit = 'product.product'
|
_inherit = 'product.product'
|
||||||
_columns = {
|
_columns = {
|
||||||
'membership': fields.boolean('Membership', help='Specify if this product is a membership product'),
|
'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_from': fields.date('Date from', help='Active Membership since this date'),
|
||||||
'membership_date_to': fields.date('Date to', help='Expired date of Membership'),
|
'membership_date_to': fields.date('Date to', help='Expired date of Membership'),
|
||||||
# 'member_price':fields.float('Member Price'),
|
}
|
||||||
}
|
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'membership': lambda *args: False
|
'membership': lambda *args: False
|
||||||
}
|
}
|
||||||
Product()
|
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:
|
if line.invoice_id.date_invoice > date_from and line.invoice_id.date_invoice < date_to:
|
||||||
date_from = line.invoice_id.date_invoice
|
date_from = line.invoice_id.date_invoice
|
||||||
line_id = member_line_obj.create(cr, uid, {
|
line_id = member_line_obj.create(cr, uid, {
|
||||||
'partner': line.invoice_id.partner_id and line.invoice_id.partner_id.id or False,
|
'partner': line.invoice_id.partner_id and line.invoice_id.partner_id.id or False,
|
||||||
'membership_id': line.product_id.id,
|
'membership_id': line.product_id.id,
|
||||||
'member_price': line.price_unit,
|
'member_price': line.price_unit,
|
||||||
'date': time.strftime('%Y-%m-%d'),
|
'date': time.strftime('%Y-%m-%d'),
|
||||||
'date_from': date_from,
|
'date_from': date_from,
|
||||||
'date_to': date_to,
|
'date_to': date_to,
|
||||||
'account_invoice_line': line.id,
|
'account_invoice_line': line.id,
|
||||||
})
|
})
|
||||||
return result
|
return result
|
||||||
|
|
||||||
account_invoice_line()
|
account_invoice_line()
|
||||||
|
|
|
@ -167,16 +167,6 @@
|
||||||
<menuitem name="Members" parent="menu_membership" id="menu_members" sequence="2" action="action_membership_members"/>
|
<menuitem name="Members" parent="menu_membership" id="menu_members" sequence="2" action="action_membership_members"/>
|
||||||
|
|
||||||
<!-- PARTNERS -->
|
<!-- 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">
|
<record model="ir.ui.view" id="view_partner_tree">
|
||||||
<field name="name">res.partner.tree.form.inherit</field>
|
<field name="name">res.partner.tree.form.inherit</field>
|
||||||
|
|
|
@ -70,7 +70,6 @@
|
||||||
'wizard/mrp_price_view.xml',
|
'wizard/mrp_price_view.xml',
|
||||||
'wizard/mrp_workcenter_load_view.xml',
|
'wizard/mrp_workcenter_load_view.xml',
|
||||||
'wizard/mrp_change_standard_price_view.xml',
|
'wizard/mrp_change_standard_price_view.xml',
|
||||||
# 'wizard/mrp_track_prod_view.xml',
|
|
||||||
'mrp_view.xml',
|
'mrp_view.xml',
|
||||||
'mrp_report.xml',
|
'mrp_report.xml',
|
||||||
'company_view.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': [
|
||||||
'test/mrp_packs.yml',
|
'test/mrp_packs.yml',
|
||||||
'test/mrp_phantom_bom.yml',
|
'test/mrp_phantom_bom.yml',
|
||||||
|
|
|
@ -1,13 +1,6 @@
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<openerp>
|
<openerp>
|
||||||
<data noupdate="1">
|
<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">
|
<record id="base.user_root" model="res.users">
|
||||||
<field name="action_id" ref="open_board_manufacturing"/>
|
<field name="action_id" ref="open_board_manufacturing"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
|
@ -7,7 +7,6 @@
|
||||||
<menuitem id="menu_mrp_reordering" name="Automatic Procurements" parent="stock.menu_stock_root" sequence="5"/>
|
<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 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"
|
<menuitem name="Master Data"
|
||||||
id="menu_mrp_bom"
|
id="menu_mrp_bom"
|
||||||
parent="base.menu_mrp_root"
|
parent="base.menu_mrp_root"
|
||||||
|
@ -283,8 +282,6 @@
|
||||||
<field name="view_id" ref="mrp_routing_tree_view"/>
|
<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>
|
<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>
|
</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_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"/>
|
<menuitem action="mrp_routing_action" id="menu_mrp_routing_action" parent="mrp.menu_mrp_property" groups="base.group_extended" sequence="30"/>
|
||||||
|
|
||||||
|
@ -415,10 +412,6 @@
|
||||||
|
|
||||||
<!-- BOM menus -->
|
<!-- BOM menus -->
|
||||||
|
|
||||||
<!-- <menuitem name="Bill of Materials"
|
|
||||||
id="menu_mrp_bom"
|
|
||||||
parent="menu_mrp_bom"
|
|
||||||
sequence="50" />-->
|
|
||||||
<menuitem
|
<menuitem
|
||||||
action="mrp_bom_form_action"
|
action="mrp_bom_form_action"
|
||||||
id="menu_mrp_bom_form_action"
|
id="menu_mrp_bom_form_action"
|
||||||
|
@ -483,10 +476,7 @@
|
||||||
|
|
||||||
<menuitem action="procurement.procurement_action" id="menu_mrp_procurement_action"
|
<menuitem action="procurement.procurement_action" id="menu_mrp_procurement_action"
|
||||||
parent="mrp.menu_mrp_manufacturing" sequence="3" />
|
parent="mrp.menu_mrp_manufacturing" sequence="3" />
|
||||||
<!-- <menuitem action="procurement.procurement_action5" id="menu_mrp_procurement_exception_action"-->
|
<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"/>
|
||||||
<!-- 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 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"/>
|
<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"/>
|
||||||
|
|
||||||
<!--
|
<!--
|
||||||
|
|
|
@ -30,7 +30,6 @@ import StringIO
|
||||||
|
|
||||||
|
|
||||||
theme.use_color = 1
|
theme.use_color = 1
|
||||||
#theme.scale = 2
|
|
||||||
random.seed(0)
|
random.seed(0)
|
||||||
|
|
||||||
#
|
#
|
||||||
|
|
|
@ -22,7 +22,6 @@
|
||||||
import mrp_product_produce
|
import mrp_product_produce
|
||||||
import mrp_price
|
import mrp_price
|
||||||
import mrp_workcenter_load
|
import mrp_workcenter_load
|
||||||
#import mrp_track_prod
|
|
||||||
import change_production_qty
|
import change_production_qty
|
||||||
import mrp_change_standard_price
|
import mrp_change_standard_price
|
||||||
|
|
||||||
|
|
|
@ -45,9 +45,9 @@ class mrp_price(osv.osv_memory):
|
||||||
datas['form'] = res
|
datas['form'] = res
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'type' : 'ir.actions.report.xml',
|
'type' : 'ir.actions.report.xml',
|
||||||
'report_name':'product.price',
|
'report_name':'product.price',
|
||||||
'datas' : datas,
|
'datas' : datas,
|
||||||
}
|
}
|
||||||
|
|
||||||
mrp_price()
|
mrp_price()
|
||||||
|
|
|
@ -51,9 +51,9 @@ class mrp_product_produce(osv.osv_memory):
|
||||||
return (prod.product_qty - done) or prod.product_qty
|
return (prod.product_qty - done) or prod.product_qty
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'product_qty': _get_product_qty,
|
'product_qty': _get_product_qty,
|
||||||
'mode': lambda *x: 'consume_produce'
|
'mode': lambda *x: 'consume_produce'
|
||||||
}
|
}
|
||||||
|
|
||||||
def do_produce(self, cr, uid, ids, context={}):
|
def do_produce(self, cr, uid, ids, context={}):
|
||||||
""" To check the product type
|
""" To check the product type
|
||||||
|
|
|
@ -44,9 +44,9 @@ class mrp_workcenter_load(osv.osv_memory):
|
||||||
datas['form'] = res
|
datas['form'] = res
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'type' : 'ir.actions.report.xml',
|
'type' : 'ir.actions.report.xml',
|
||||||
'report_name':'mrp.workcenter.load',
|
'report_name':'mrp.workcenter.load',
|
||||||
'datas' : datas,
|
'datas' : datas,
|
||||||
}
|
}
|
||||||
|
|
||||||
mrp_workcenter_load()
|
mrp_workcenter_load()
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="process_node_workorder0" model="process.node">
|
<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 name="model_id" ref="mrp.model_mrp_production_workcenter_line"/>
|
||||||
<field eval=""""state"""" name="kind"/>
|
<field eval=""""state"""" name="kind"/>
|
||||||
<field eval=""""Information from the routing definition."""" name="note"/>
|
<field eval=""""Information from the routing definition."""" name="note"/>
|
||||||
|
@ -39,7 +38,6 @@
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="process_node_startoperation0" model="process.node">
|
<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 name="model_id" ref="mrp.model_mrp_production_workcenter_line"/>
|
||||||
<field eval=""""state"""" name="kind"/>
|
<field eval=""""state"""" name="kind"/>
|
||||||
<field eval=""""Start the operation."""" name="note"/>
|
<field eval=""""Start the operation."""" name="note"/>
|
||||||
|
@ -50,7 +48,6 @@
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="process_node_doneoperation0" model="process.node">
|
<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 name="model_id" ref="mrp.model_mrp_production_workcenter_line"/>
|
||||||
<field eval=""""state"""" name="kind"/>
|
<field eval=""""state"""" name="kind"/>
|
||||||
<field eval=""""Finish the operation."""" name="note"/>
|
<field eval=""""Finish the operation."""" name="note"/>
|
||||||
|
@ -61,7 +58,6 @@
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record id="process_node_canceloperation0" model="process.node">
|
<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 name="model_id" ref="mrp.model_mrp_production_workcenter_line"/>
|
||||||
<field eval=""""state"""" name="kind"/>
|
<field eval=""""state"""" name="kind"/>
|
||||||
<field eval=""""Cancel the operation."""" name="note"/>
|
<field eval=""""Cancel the operation."""" name="note"/>
|
||||||
|
|
|
@ -389,7 +389,7 @@ class mrp_repair(osv.osv):
|
||||||
'price_unit': operation.price_unit,
|
'price_unit': operation.price_unit,
|
||||||
'price_subtotal': operation.product_uom_qty*operation.price_unit,
|
'price_subtotal': operation.product_uom_qty*operation.price_unit,
|
||||||
'product_id': operation.product_id and operation.product_id.id or False
|
'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})
|
repair_line_obj.write(cr, uid, [operation.id], {'invoiced': True, 'invoice_line_id': invoice_line_id})
|
||||||
for fee in repair.fees_lines:
|
for fee in repair.fees_lines:
|
||||||
if fee.to_invoice == True:
|
if fee.to_invoice == True:
|
||||||
|
@ -408,7 +408,7 @@ class mrp_repair(osv.osv):
|
||||||
'product_id': fee.product_id and fee.product_id.id or False,
|
'product_id': fee.product_id and fee.product_id.id or False,
|
||||||
'price_unit': fee.price_unit,
|
'price_unit': fee.price_unit,
|
||||||
'price_subtotal': fee.product_uom_qty*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})
|
repair_fee_obj.write(cr, uid, [fee.id], {'invoiced': True, 'invoice_line_id': invoice_fee_id})
|
||||||
res[repair.id] = inv_id
|
res[repair.id] = inv_id
|
||||||
return res
|
return res
|
||||||
|
@ -574,7 +574,7 @@ class ProductChangeMixin(object):
|
||||||
'message':
|
'message':
|
||||||
"Couldn't find a pricelist line matching this product and quantity.\n"
|
"Couldn't find a pricelist line matching this product and quantity.\n"
|
||||||
"You have to change either the product, the quantity or the pricelist."
|
"You have to change either the product, the quantity or the pricelist."
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
result.update({'price_unit': price, 'price_subtotal': price*product_uom_qty})
|
result.update({'price_unit': price, 'price_subtotal': price*product_uom_qty})
|
||||||
|
|
||||||
|
|
|
@ -50,13 +50,6 @@
|
||||||
<field name="action">wkf_repair_done()</field>
|
<field name="action">wkf_repair_done()</field>
|
||||||
<field name="join_mode">XOR</field>
|
<field name="join_mode">XOR</field>
|
||||||
</record>
|
</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">
|
<record id="act_repair_start" model="workflow.activity">
|
||||||
<field name="wkf_id" ref="wkf_repair"/>
|
<field name="wkf_id" ref="wkf_repair"/>
|
||||||
<field name="name">Start Repair</field>
|
<field name="name">Start Repair</field>
|
||||||
|
@ -75,21 +68,6 @@
|
||||||
<field name="kind">function</field>
|
<field name="kind">function</field>
|
||||||
<field name="action">action_repair_end()</field>
|
<field name="action">action_repair_end()</field>
|
||||||
</record>
|
</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">
|
<record id="act_cancel" model="workflow.activity">
|
||||||
<field name="wkf_id" ref="wkf_repair"/>
|
<field name="wkf_id" ref="wkf_repair"/>
|
||||||
<field name="name">cancel</field>
|
<field name="name">cancel</field>
|
||||||
|
@ -133,12 +111,6 @@
|
||||||
<field name="condition">(invoice_method=='after_repair' or invoice_method=='none')</field>
|
<field name="condition">(invoice_method=='after_repair' or invoice_method=='none')</field>
|
||||||
</record>
|
</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">
|
<record id="trans_wait_invoice_invoice" model="workflow.transition">
|
||||||
<field name="act_from" ref="act_wait_invoice"/>
|
<field name="act_from" ref="act_wait_invoice"/>
|
||||||
<field name="act_to" ref="act_invoice_end"/>
|
<field name="act_to" ref="act_invoice_end"/>
|
||||||
|
|
|
@ -27,7 +27,7 @@ class make_invoice(osv.osv_memory):
|
||||||
_description = 'Make Invoice'
|
_description = 'Make Invoice'
|
||||||
|
|
||||||
_columns = {
|
_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):
|
def make_invoices(self, cr, uid, ids, context):
|
||||||
|
|
|
@ -36,7 +36,10 @@ With this module:
|
||||||
'website': 'http://www.openerp.com',
|
'website': 'http://www.openerp.com',
|
||||||
'depends': ['base', 'mrp'],
|
'depends': ['base', 'mrp'],
|
||||||
'init_xml': [],
|
'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': [],
|
'demo_xml': [],
|
||||||
'test': ['test/mrp_subproduct.yml'],
|
'test': ['test/mrp_subproduct.yml'],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
|
|
|
@ -38,7 +38,6 @@
|
||||||
'init_xml': [],
|
'init_xml': [],
|
||||||
'update_xml': [
|
'update_xml': [
|
||||||
'res_company_view.xml'
|
'res_company_view.xml'
|
||||||
#'security/ir.model.access.csv',
|
|
||||||
],
|
],
|
||||||
'demo_xml': [
|
'demo_xml': [
|
||||||
'multi_company_demo.xml'
|
'multi_company_demo.xml'
|
||||||
|
|
|
@ -380,89 +380,6 @@
|
||||||
<record id="base.res_partner_accent" model="res.partner">
|
<record id="base.res_partner_accent" model="res.partner">
|
||||||
<field name="company_id" ref="res_company_oerp_be"/>
|
<field name="company_id" ref="res_company_oerp_be"/>
|
||||||
</record>
|
</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>
|
||||||
<data noupdate="1">
|
<data noupdate="1">
|
||||||
<record id="multi_company_default_productopenerpus0" model="multi_company.default">
|
<record id="multi_company_default_productopenerpus0" model="multi_company.default">
|
||||||
|
|
|
@ -46,8 +46,7 @@
|
||||||
"data/olap_security.xml",
|
"data/olap_security.xml",
|
||||||
'security/ir.model.access.csv'
|
'security/ir.model.access.csv'
|
||||||
],
|
],
|
||||||
"demo_xml" : ["data/olap_demo.xml"
|
"demo_xml" : ["data/olap_demo.xml"],
|
||||||
],
|
|
||||||
"active": False,
|
"active": False,
|
||||||
"installable": True
|
"installable": True
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,7 +83,6 @@
|
||||||
<newline/>
|
<newline/>
|
||||||
<label align="0.0" string="This wizard will automatically configure the web client for Business Intelligence." width="200" colspan="2"/>
|
<label align="0.0" string="This wizard will automatically configure the web client for Business Intelligence." width="200" colspan="2"/>
|
||||||
</group>
|
</group>
|
||||||
<!--separator string="" orientation="vertical" colspan="1" rowspan="12"/-->
|
|
||||||
<group colspan="4">
|
<group colspan="4">
|
||||||
<separator string=" Business Intelligence Web Client" colspan="4"/>
|
<separator string=" Business Intelligence Web Client" colspan="4"/>
|
||||||
<field name="host_name" colspan="4"/>
|
<field name="host_name" colspan="4"/>
|
||||||
|
@ -99,18 +98,6 @@
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</form>
|
</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>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
@ -389,11 +376,7 @@
|
||||||
<field name="name" select="1" colspan="2"/>
|
<field name="name" select="1" colspan="2"/>
|
||||||
<field name="sequence" colspan="2"/>
|
<field name="sequence" colspan="2"/>
|
||||||
<field name="dimension_id" select="1" attrs="{'readonly':[('dimension_id','!=','')]}" colspan="4"/>
|
<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}"/>
|
<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>
|
</form>
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</record>
|
||||||
|
|
|
@ -41,16 +41,6 @@
|
||||||
<field name="kind">function</field>
|
<field name="kind">function</field>
|
||||||
<field name="action">action_dbready()</field>
|
<field name="action">action_dbready()</field>
|
||||||
</record>
|
</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">
|
<record model="workflow.transition" id="trans_none_dbconnect">
|
||||||
<field name="act_from" ref="act_none"/>
|
<field name="act_from" ref="act_none"/>
|
||||||
|
@ -75,13 +65,6 @@
|
||||||
<field name="act_to" ref="act_dbready"/>
|
<field name="act_to" ref="act_dbready"/>
|
||||||
<field name="signal">dbready</field>
|
<field name="signal">dbready</field>
|
||||||
</record>
|
</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>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -77,8 +77,6 @@
|
||||||
<field name="fact_database_id" select="2"/>
|
<field name="fact_database_id" select="2"/>
|
||||||
<field name="active"/>
|
<field name="active"/>
|
||||||
<field name="hide"/>
|
<field name="hide"/>
|
||||||
<!-- <button name="show_col_view" string="Columns" type="object"/>-->
|
|
||||||
|
|
||||||
<button name="hide_col" string="Hide" type="object"/>
|
<button name="hide_col" string="Hide" type="object"/>
|
||||||
<button name="show_col" string="Show" type="object"/>
|
<button name="show_col" string="Show" type="object"/>
|
||||||
</tree>
|
</tree>
|
||||||
|
|
|
@ -3,53 +3,42 @@
|
||||||
<data>
|
<data>
|
||||||
|
|
||||||
<wizard
|
<wizard
|
||||||
string="Query Builder"
|
string="Query Builder"
|
||||||
model="olap.schema"
|
model="olap.schema"
|
||||||
name="olap.query_builder"
|
name="olap.query_builder"
|
||||||
menu= "False"
|
menu= "False"
|
||||||
multi="True"
|
multi="True"
|
||||||
id="bi_conf_cube_query_builder"/>
|
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
|
<wizard
|
||||||
string="Load Tables"
|
string="Open Configuration"
|
||||||
model="olap.schema"
|
model="olap.schema"
|
||||||
name="olap.load.table"
|
name="olap.load.configuration.table"
|
||||||
menu= "False"
|
menu= "False"
|
||||||
multi="True"
|
multi="True"
|
||||||
id="bi_menu_olap_load_table"/>-->
|
id="bi_load_configuration_table"/>
|
||||||
|
|
||||||
|
<wizard
|
||||||
|
string="Configure from Application"
|
||||||
|
model="olap.schema"
|
||||||
|
name="olap.application.configuration"
|
||||||
|
multi="True"
|
||||||
|
id="bi_application_configuration"/>
|
||||||
|
|
||||||
<wizard
|
<wizard
|
||||||
string="Load Tables"
|
string="Test Connection"
|
||||||
model="olap.schema"
|
model="olap.fact.database"
|
||||||
name="olap.load.table"
|
name="olap.fact.database.test_connection"
|
||||||
menu= "False"
|
menu="False"
|
||||||
multi="True"
|
id="bi_test_connection"/>
|
||||||
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"/>
|
|
||||||
|
|
||||||
|
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -203,7 +203,7 @@ class olap_schema(osv.osv ):
|
||||||
'state': lambda * a: 'none',
|
'state': lambda * a: 'none',
|
||||||
'configure': lambda * a: False,
|
'configure': lambda * a: False,
|
||||||
'ready': lambda * a: False
|
'ready': lambda * a: False
|
||||||
}
|
}
|
||||||
|
|
||||||
def action_dbconnect(self, cr, uid, ids, context = {}):
|
def action_dbconnect(self, cr, uid, ids, context = {}):
|
||||||
""" Connect DB with postgres ,Or MySql,Or Orcale
|
""" Connect DB with postgres ,Or MySql,Or Orcale
|
||||||
|
@ -497,7 +497,7 @@ class olap_database_columns(osv.osv):
|
||||||
'text': 'Text',
|
'text': 'Text',
|
||||||
'date': 'Date',
|
'date': 'Date',
|
||||||
'time': 'TimeStamp without Time Zone',
|
'time': 'TimeStamp without Time Zone',
|
||||||
'number': 'NUMBER',
|
'number': 'NUMBER',
|
||||||
}
|
}
|
||||||
|
|
||||||
def _datatypes_get(self, *args, **argv):
|
def _datatypes_get(self, *args, **argv):
|
||||||
|
@ -718,9 +718,9 @@ class olap_database_columns(osv.osv):
|
||||||
if context['parent_id']:
|
if context['parent_id']:
|
||||||
parent_id = context['parent_id']
|
parent_id = context['parent_id']
|
||||||
val = {
|
val = {
|
||||||
'cube_table_id': parent_id,
|
'cube_table_id': parent_id,
|
||||||
'table_id': table_id,
|
'table_id': table_id,
|
||||||
'field_id': ids[0]
|
'field_id': ids[0]
|
||||||
}
|
}
|
||||||
id = self.pool.get('olap.cube.table.line').create(cr, uid, val, context)
|
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',
|
relation = 'olap.database.columns',
|
||||||
string = 'Available Tables',
|
string = 'Available Tables',
|
||||||
type = "many2many"
|
type = "many2many"
|
||||||
),
|
),
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
|
@ -1070,8 +1070,8 @@ class olap_cube(osv.osv):
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'schema_id': _set_schema
|
'schema_id': _set_schema
|
||||||
}
|
}
|
||||||
olap_cube()
|
olap_cube()
|
||||||
|
|
||||||
|
|
||||||
|
@ -1091,8 +1091,8 @@ class olap_query_logs(osv.osv):
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'count':lambda * args: 0
|
'count':lambda * args: 0
|
||||||
}
|
}
|
||||||
olap_query_logs()
|
olap_query_logs()
|
||||||
|
|
||||||
|
|
||||||
|
@ -1120,7 +1120,7 @@ class olap_dimension(osv.osv):
|
||||||
'hierarchy_ids': fields.one2many('olap.hierarchy', 'dimension_id', 'Hierarchies'),
|
'hierarchy_ids': fields.one2many('olap.hierarchy', 'dimension_id', 'Hierarchies'),
|
||||||
}
|
}
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'cube_id': _set_cube,
|
'cube_id': _set_cube,
|
||||||
}
|
}
|
||||||
|
|
||||||
olap_dimension()
|
olap_dimension()
|
||||||
|
@ -1414,15 +1414,15 @@ class olap_saved_query(osv.osv):
|
||||||
_decription = "Olap Saved Query"
|
_decription = "Olap Saved Query"
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'name': fields.text('Query Name', size = 64),
|
'name': fields.text('Query Name', size = 64),
|
||||||
'user_id': fields.many2one('res.users', 'User'),
|
'user_id': fields.many2one('res.users', 'User'),
|
||||||
'query': fields.text('Query', required = True),
|
'query': fields.text('Query', required = True),
|
||||||
'cube_id': fields.many2one('olap.cube', 'Cube', required = True),
|
'cube_id': fields.many2one('olap.cube', 'Cube', required = True),
|
||||||
'mdx_id': fields.char('Module', size=64),
|
'mdx_id': fields.char('Module', size=64),
|
||||||
'schema_id': fields.many2one('olap.schema', 'Schema', required = True),
|
'schema_id': fields.many2one('olap.schema', 'Schema', required = True),
|
||||||
'time': fields.datetime('Time', required = True),
|
'time': fields.datetime('Time', required = True),
|
||||||
'axis_keys': fields.text('Axis Keys'),
|
'axis_keys': fields.text('Axis Keys'),
|
||||||
}
|
}
|
||||||
|
|
||||||
olap_saved_query()
|
olap_saved_query()
|
||||||
# Wizard for the Load Data Structure
|
# Wizard for the Load Data Structure
|
||||||
|
@ -1865,11 +1865,11 @@ class bi_auto_configure_wizard(osv.osv_memory):
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'name': fields.char('Fact Name' , size = 64, readonly = True),
|
'name': fields.char('Fact Name' , size = 64, readonly = True),
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'name': _get_name,
|
'name': _get_name,
|
||||||
}
|
}
|
||||||
|
|
||||||
def action_load(self, cr, uid, ids, context = None):
|
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' }
|
return {'type': 'ir.actions.act_window_close' }
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'query': fields.text('Query', readonly=True),
|
'query': fields.text('Query', readonly=True),
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'query': _get_queries,
|
'query': _get_queries,
|
||||||
}
|
}
|
||||||
|
|
||||||
olap_warehouse_wizard()
|
olap_warehouse_wizard()
|
||||||
|
|
||||||
|
@ -2152,14 +2152,14 @@ class olap_parameters_config_wizard(osv.osv_memory):
|
||||||
its not clear.", required = True),
|
its not clear.", required = True),
|
||||||
'config_logo': fields.binary('Image', readonly=True),
|
'config_logo': fields.binary('Image', readonly=True),
|
||||||
'progress': fields.float('Configuration Progress', readonly=True),
|
'progress': fields.float('Configuration Progress', readonly=True),
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'host_name': _get_host,
|
'host_name': _get_host,
|
||||||
'host_port': _get_port,
|
'host_port': _get_port,
|
||||||
'progress': _progress,
|
'progress': _progress,
|
||||||
'config_logo': _get_image,
|
'config_logo': _get_image,
|
||||||
}
|
}
|
||||||
|
|
||||||
def action_cancel(self, cr, uid, ids, conect = None):
|
def action_cancel(self, cr, uid, ids, conect = None):
|
||||||
"""
|
"""
|
||||||
|
@ -2171,11 +2171,11 @@ class olap_parameters_config_wizard(osv.osv_memory):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'view_type': 'form',
|
'view_type': 'form',
|
||||||
"view_mode": 'form',
|
"view_mode": 'form',
|
||||||
'res_model': 'ir.actions.configuration.wizard',
|
'res_model': 'ir.actions.configuration.wizard',
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
'target':'new',
|
'target':'new',
|
||||||
}
|
}
|
||||||
|
|
||||||
def action_config(self, cr, uid, ids, context = None):
|
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'})
|
':' + (conf.host_port or '8080') + '/designer'})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'view_type': 'form',
|
'view_type': 'form',
|
||||||
"view_mode": 'form',
|
"view_mode": 'form',
|
||||||
'res_model': 'ir.actions.configuration.wizard',
|
'res_model': 'ir.actions.configuration.wizard',
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
'target':'new',
|
'target':'new',
|
||||||
}
|
}
|
||||||
|
|
||||||
olap_parameters_config_wizard()
|
olap_parameters_config_wizard()
|
||||||
|
|
|
@ -35,7 +35,7 @@ class olap_query_logs_clear(osv.osv_memory):
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'user_name': _getdata
|
'user_name': _getdata
|
||||||
}
|
}
|
||||||
|
|
||||||
def clear_logs(self, cr, uid, part, context={}):
|
def clear_logs(self, cr, uid, part, context={}):
|
||||||
"""
|
"""
|
||||||
|
|
|
@ -33,12 +33,6 @@ import netsvc
|
||||||
class wizard_load_configured_table(wizard.interface):
|
class wizard_load_configured_table(wizard.interface):
|
||||||
def _get_table_data(self, cr, uid, data, context={}):
|
def _get_table_data(self, cr, uid, data, context={}):
|
||||||
pool_obj = pooler.get_pool(cr.dbname)
|
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 = netsvc.LocalService('workflow')
|
||||||
wf_service.trg_validate(uid, 'olap.schema', data['id'], 'dbconfigure', cr)
|
wf_service.trg_validate(uid, 'olap.schema', data['id'], 'dbconfigure', cr)
|
||||||
|
|
||||||
|
|
|
@ -101,7 +101,7 @@ def olap_db_connect(self,cr,uid,part,context={}):
|
||||||
WHERE table_schema = 'public'""")
|
WHERE table_schema = 'public'""")
|
||||||
|
|
||||||
for col in cr_db.fetchall():
|
for col in cr_db.fetchall():
|
||||||
val={
|
val = {
|
||||||
'table_id': tables[col[0]],
|
'table_id': tables[col[0]],
|
||||||
'column_db_name': col[1],
|
'column_db_name': col[1],
|
||||||
'type': col[2],
|
'type': col[2],
|
||||||
|
@ -126,7 +126,7 @@ def olap_db_connect(self,cr,uid,part,context={}):
|
||||||
constraint_type = 'PRIMARY KEY')""")
|
constraint_type = 'PRIMARY KEY')""")
|
||||||
print "Updating the Primary Key Constraint"
|
print "Updating the Primary Key Constraint"
|
||||||
for constraint in cr_db.fetchall():
|
for constraint in cr_db.fetchall():
|
||||||
val={
|
val = {
|
||||||
'primary_key':True
|
'primary_key':True
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +155,7 @@ def olap_db_connect(self,cr,uid,part,context={}):
|
||||||
constraint_type = 'FOREIGN KEY')""")
|
constraint_type = 'FOREIGN KEY')""")
|
||||||
|
|
||||||
for constraint in cr_db.fetchall():
|
for constraint in cr_db.fetchall():
|
||||||
val={
|
val = {
|
||||||
'related_to':tables[for_key[constraint[2]]]
|
'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)
|
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():
|
for col in cr_db.fetchall():
|
||||||
|
|
||||||
val={
|
val = {
|
||||||
'table_id': tables[col[0]],
|
'table_id': tables[col[0]],
|
||||||
'column_db_name': col[1],
|
'column_db_name': col[1],
|
||||||
'type': col[2],
|
'type': col[2],
|
||||||
|
@ -237,14 +237,14 @@ def olap_db_connect(self,cr,uid,part,context={}):
|
||||||
for constraint in cr_db.fetchall():
|
for constraint in cr_db.fetchall():
|
||||||
|
|
||||||
if constraint[0]:
|
if constraint[0]:
|
||||||
val={
|
val = {
|
||||||
'related_to':tables[constraint[1]]
|
'related_to':tables[constraint[1]]
|
||||||
}
|
}
|
||||||
else:
|
else:
|
||||||
|
|
||||||
val={
|
val = {
|
||||||
'primary_key':True
|
'primary_key':True
|
||||||
}
|
}
|
||||||
id_to_write=filter(lambda x:(int(cols[x][1])==int(tables[constraint[3]])and(constraint[2]==cols[x][0])),cols)
|
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)
|
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'
|
type_col='varchar'
|
||||||
else:
|
else:
|
||||||
type_col=col[2]
|
type_col=col[2]
|
||||||
val={
|
val = {
|
||||||
'table_id': tables[col[0]],
|
'table_id': tables[col[0]],
|
||||||
'column_db_name': col[1],
|
'column_db_name': col[1],
|
||||||
'type': type_col,
|
'type': type_col,
|
||||||
|
@ -331,7 +331,7 @@ def olap_db_connect(self,cr,uid,part,context={}):
|
||||||
temp = cr_db.fetchall()
|
temp = cr_db.fetchall()
|
||||||
pk_table = {}
|
pk_table = {}
|
||||||
for constraint in temp:
|
for constraint in temp:
|
||||||
val={
|
val = {
|
||||||
'primary_key' : True
|
'primary_key' : True
|
||||||
}
|
}
|
||||||
pk_table[constraint[2]] = constraint[0]
|
pk_table[constraint[2]] = constraint[0]
|
||||||
|
@ -364,7 +364,7 @@ def olap_db_connect(self,cr,uid,part,context={}):
|
||||||
for constraint in temp:
|
for constraint in temp:
|
||||||
rel_constraint_name=constraints_map[constraint[2]]
|
rel_constraint_name=constraints_map[constraint[2]]
|
||||||
req_table = pk_table[rel_constraint_name]
|
req_table = pk_table[rel_constraint_name]
|
||||||
val={
|
val = {
|
||||||
'related_to' : tables[req_table]
|
'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)
|
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"/>
|
<field name="mdx_query_output" colspan="4" height="100" width="800"/>
|
||||||
</form>"""
|
</form>"""
|
||||||
query_builder_fields={
|
query_builder_fields={
|
||||||
|
'dimension':{'string':'Dimension','type':'text'},
|
||||||
|
'hierarchy':{'string':'Hiearchy','type':'text'},
|
||||||
'dimension':{'string':'Dimension','type':'text'},
|
'level':{'string':'Level','type':'text'},
|
||||||
'hierarchy':{'string':'Hiearchy','type':'text'},
|
'measure':{'string':'Measure','type':'text'},
|
||||||
'level':{'string':'Level','type':'text'},
|
'mdx_query':{'string':'MDX Query','type':'text'},
|
||||||
'measure':{'string':'Measure','type':'text'},
|
'mdx_query_output':{'string':'MDX Query Output','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"?>
|
query_builder_fetch_form = """<?xml version="1.0"?>
|
||||||
<form string="Cube Fetcher">
|
<form string="Cube Fetcher">
|
||||||
|
@ -185,10 +183,8 @@ def _execute_mdx(self, cr, uid, data, context):
|
||||||
ok = True
|
ok = True
|
||||||
if not ok:
|
if not ok:
|
||||||
continue
|
continue
|
||||||
#print ' '*COLSPAN,
|
|
||||||
output =' '*COLSPAN
|
output =' '*COLSPAN
|
||||||
log.add(output)
|
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]))
|
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)
|
log.add(output)
|
||||||
|
|
||||||
|
@ -197,23 +193,18 @@ def _execute_mdx(self, cr, uid, data, context):
|
||||||
print "--------------------------------------",x
|
print "--------------------------------------",x
|
||||||
temp=(axis[0].pop(0)[1])
|
temp=(axis[0].pop(0)[1])
|
||||||
print "--------------------------------------",temp
|
print "--------------------------------------",temp
|
||||||
# print ('%-'+str(COLSPAN)+'s')% (' '*(len(axis[0][0][0])-1)*2 + (temp),),
|
|
||||||
output =('%-'+str(COLSPAN)+'s')% (str(x)+str(temp))
|
output =('%-'+str(COLSPAN)+'s')% (str(x)+str(temp))
|
||||||
log.add("\n")
|
log.add("\n")
|
||||||
log.add(output)
|
log.add(output)
|
||||||
#output=(temp)
|
|
||||||
|
|
||||||
for row in col:
|
for row in col:
|
||||||
if row==[False]:
|
if row==[False]:
|
||||||
# print ('%-'+str(ROWSPAN)+'s')%('',),
|
|
||||||
output=('%-'+str(ROWSPAN)+'s')%('')
|
output=('%-'+str(ROWSPAN)+'s')%('')
|
||||||
log.add(output)
|
log.add(output)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
# print ('%-'+str(ROWSPAN)+'s')%(row,),
|
|
||||||
output=('%-'+str(ROWSPAN)+'s')%(row)
|
output=('%-'+str(ROWSPAN)+'s')%(row)
|
||||||
log.add(output)
|
log.add(output)
|
||||||
#print
|
|
||||||
log.add("\n")
|
log.add("\n")
|
||||||
return {'mdx_query_output':log()}
|
return {'mdx_query_output':log()}
|
||||||
|
|
||||||
|
|
|
@ -456,7 +456,7 @@ Measures
|
||||||
<field name="table_name">crm_case</field>
|
<field name="table_name">crm_case</field>
|
||||||
<field name="agregator">sum</field>
|
<field name="agregator">sum</field>
|
||||||
</record>
|
</record>
|
||||||
d
|
|
||||||
</data>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
||||||
|
|
|
@ -103,15 +103,15 @@ class wizard_olap_extract(wizard.interface):
|
||||||
self.zipper(_modulename, "__init__.py","w")
|
self.zipper(_modulename, "__init__.py","w")
|
||||||
|
|
||||||
_init_files = {
|
_init_files = {
|
||||||
"1":"olap.fact.database.csv",
|
"1":"olap.fact.database.csv",
|
||||||
"2":"olap.schema.csv",
|
"2":"olap.schema.csv",
|
||||||
"5":"olap.cube.table.csv",
|
"5":"olap.cube.table.csv",
|
||||||
"6":"olap.cube.csv",
|
"6":"olap.cube.csv",
|
||||||
"7":"olap.dimension.csv",
|
"7":"olap.dimension.csv",
|
||||||
"8":"olap.hierarchy.csv",
|
"8":"olap.hierarchy.csv",
|
||||||
"9":"olap.level.csv",
|
"9":"olap.level.csv",
|
||||||
"10":"olap.measure.csv"
|
"10":"olap.measure.csv"
|
||||||
}
|
}
|
||||||
_init_xml = """"%(1)s",
|
_init_xml = """"%(1)s",
|
||||||
"%(2)s",
|
"%(2)s",
|
||||||
"%(5)s",
|
"%(5)s",
|
||||||
|
|
|
@ -105,15 +105,7 @@ cube table and cube table line
|
||||||
<field name="primary_key">True</field>
|
<field name="primary_key">True</field>
|
||||||
<field name="active">True</field>
|
<field name="active">True</field>
|
||||||
</record>
|
</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">
|
<record model="olap.database.columns" id="columns_product_template_id">
|
||||||
<field name="name">id</field>
|
<field name="name">id</field>
|
||||||
<field name="column_db_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>
|
<field name="active">True</field>
|
||||||
</record>
|
</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">
|
<record model="olap.database.columns" id="columns_sale_order_line_order_id">
|
||||||
<field name="name">order_id</field>
|
<field name="name">order_id</field>
|
||||||
<field name="column_db_name">order_id</field>
|
<field name="column_db_name">order_id</field>
|
||||||
|
@ -388,16 +370,6 @@ cube table and cube table line
|
||||||
<field name="active">True</field>
|
<field name="active">True</field>
|
||||||
</record>
|
</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">
|
<record model="olap.database.columns" id="columns_sale_order_line_product_uom_qty">
|
||||||
<field name="name">product_uom_qty</field>
|
<field name="name">product_uom_qty</field>
|
||||||
<field name="column_db_name">product_uom_qty</field>
|
<field name="column_db_name">product_uom_qty</field>
|
||||||
|
|
|
@ -33,7 +33,7 @@ based on geolocalization.
|
||||||
'data': [
|
'data': [
|
||||||
'res_partner_view.xml',
|
'res_partner_view.xml',
|
||||||
'crm_lead_view.xml',
|
'crm_lead_view.xml',
|
||||||
],
|
],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'active': False,
|
'active': False,
|
||||||
'certificate': False,
|
'certificate': False,
|
||||||
|
|
|
@ -63,7 +63,6 @@ Main features :
|
||||||
'wizard/pos_scan_product_view.xml',
|
'wizard/pos_scan_product_view.xml',
|
||||||
'wizard/pos_return_view.xml',
|
'wizard/pos_return_view.xml',
|
||||||
'pos_report.xml',
|
'pos_report.xml',
|
||||||
# 'pos_wizard.xml',
|
|
||||||
'pos_view.xml',
|
'pos_view.xml',
|
||||||
'report/report_pos_order_view.xml',
|
'report/report_pos_order_view.xml',
|
||||||
'report/report_cash_register_view.xml',
|
'report/report_cash_register_view.xml',
|
||||||
|
@ -76,7 +75,6 @@ Main features :
|
||||||
'statement_data.xml',
|
'statement_data.xml',
|
||||||
],
|
],
|
||||||
'demo_xml': ['pos_demo.xml','singer_statement_demo.xml','multi_company_stock_data.xml'],
|
'demo_xml': ['pos_demo.xml','singer_statement_demo.xml','multi_company_stock_data.xml'],
|
||||||
# 'test':['test/pos_test.yml',],
|
|
||||||
'installable': True,
|
'installable': True,
|
||||||
}
|
}
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# 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),
|
'pickings': fields.one2many('stock.picking', 'pos_order', 'Picking', readonly=True),
|
||||||
'picking_id': fields.many2one('stock.picking', 'Last Output Picking', readonly=True),
|
'picking_id': fields.many2one('stock.picking', 'Last Output Picking', readonly=True),
|
||||||
'first_name': fields.char('First Name', size=64),
|
'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'),
|
'note': fields.text('Internal Notes'),
|
||||||
'nb_print': fields.integer('Number of Print', readonly=True),
|
'nb_print': fields.integer('Number of Print', readonly=True),
|
||||||
'sale_journal': fields.many2one('account.journal', 'Journal', required=True, states={'draft': [('readonly', False)]}, 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,
|
'sale_manager': lambda self, cr, uid, context: uid,
|
||||||
'state': lambda *a: 'draft',
|
'state': lambda *a: 'draft',
|
||||||
'price_type': lambda *a: 'tax_excluded',
|
'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'),
|
'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_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'),
|
'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',
|
'invoice_state': 'none',
|
||||||
'auto_picking': True,
|
'auto_picking': True,
|
||||||
'pos_order': order.id,
|
'pos_order': order.id,
|
||||||
})
|
})
|
||||||
self.write(cr, uid, [order.id], {'picking_id': picking_id})
|
self.write(cr, uid, [order.id], {'picking_id': picking_id})
|
||||||
else:
|
else:
|
||||||
picking_id = order.picking_id.id
|
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))
|
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()
|
res=cr.fetchone()
|
||||||
location_id=res and res[0] or None
|
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
|
stock_dest_id = val.id
|
||||||
if line.qty < 0:
|
if line.qty < 0:
|
||||||
location_id, stock_dest_id = stock_dest_id, location_id
|
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!'))
|
raise osv.except_osv(_('Error'), _('You don\'t have enough access to validate this sale!'))
|
||||||
return True
|
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):
|
def cancel_order(self, cr, uid, ids, context=None):
|
||||||
|
|
||||||
""" Changes order state to cancel
|
""" Changes order state to cancel
|
||||||
|
@ -601,11 +576,9 @@ class pos_order(osv.osv):
|
||||||
if not order.num_sale and data['num_sale']:
|
if not order.num_sale and data['num_sale']:
|
||||||
self.write(cr,uid,order_id,{'num_sale': data['num_sale']})
|
self.write(cr,uid,order_id,{'num_sale': data['num_sale']})
|
||||||
ids_new=[]
|
ids_new=[]
|
||||||
# if order.invoice_wanted and not order.partner_id:
|
|
||||||
# raise osv.except_osv(_('Error'), _('Cannot create invoice without a partner.'))
|
|
||||||
args = {
|
args = {
|
||||||
'amount': data['amount'],
|
'amount': data['amount'],
|
||||||
}
|
}
|
||||||
if 'payment_date' in data.keys():
|
if 'payment_date' in data.keys():
|
||||||
args['date'] = data['payment_date']
|
args['date'] = data['payment_date']
|
||||||
if 'payment_name' in data.keys():
|
if 'payment_name' in data.keys():
|
||||||
|
@ -660,7 +633,7 @@ class pos_order(osv.osv):
|
||||||
'product_id': product_id,
|
'product_id': product_id,
|
||||||
'qty': qty,
|
'qty': qty,
|
||||||
'price_unit': price,
|
'price_unit': price,
|
||||||
})
|
})
|
||||||
wf_service = netsvc.LocalService("workflow")
|
wf_service = netsvc.LocalService("workflow")
|
||||||
wf_service.trg_write(uid, 'pos.order', order_id, cr)
|
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 st in stat_l.move_ids:
|
||||||
for s in st.line_id:
|
for s in st.line_id:
|
||||||
if s.credit:
|
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, {
|
account_move_line_obj.copy(cr, uid, s.id, {
|
||||||
'statement_id': False,
|
'debit': s.credit,
|
||||||
'account_id':order_account
|
'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'})
|
self.write(cr,uid,order.id,{'state':'done'})
|
||||||
return True
|
return True
|
||||||
|
@ -1019,7 +994,7 @@ pos_order()
|
||||||
|
|
||||||
class account_bank_statement(osv.osv):
|
class account_bank_statement(osv.osv):
|
||||||
_inherit = 'account.bank.statement'
|
_inherit = 'account.bank.statement'
|
||||||
_columns={
|
_columns= {
|
||||||
'user_id': fields.many2one('res.users',ondelete='cascade',string='User', readonly=True),
|
'user_id': fields.many2one('res.users',ondelete='cascade',string='User', readonly=True),
|
||||||
}
|
}
|
||||||
_defaults = {
|
_defaults = {
|
||||||
|
@ -1034,7 +1009,7 @@ class account_bank_statement_line(osv.osv):
|
||||||
for line in self.browse(cr, uid, ids):
|
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
|
res[line.id] = line.statement_id and line.statement_id.journal_id and line.statement_id.journal_id.name or None
|
||||||
return res
|
return res
|
||||||
_columns={
|
_columns= {
|
||||||
'journal_id': fields.function(_get_statement_journal, method=True,store=True, string='Journal', type='char', size=64),
|
'journal_id': fields.function(_get_statement_journal, method=True,store=True, string='Journal', type='char', size=64),
|
||||||
'am_out':fields.boolean("To count"),
|
'am_out':fields.boolean("To count"),
|
||||||
'is_acc':fields.boolean("Is accompte"),
|
'is_acc':fields.boolean("Is accompte"),
|
||||||
|
@ -1169,7 +1144,7 @@ class pos_order_line(osv.osv):
|
||||||
'discount': fields.float('Discount (%)', digits=(16, 2)),
|
'discount': fields.float('Discount (%)', digits=(16, 2)),
|
||||||
'order_id': fields.many2one('pos.order', 'Order Ref', ondelete='cascade'),
|
'order_id': fields.many2one('pos.order', 'Order Ref', ondelete='cascade'),
|
||||||
'create_date': fields.datetime('Creation Date', readonly=True),
|
'create_date': fields.datetime('Creation Date', readonly=True),
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'name': lambda obj, cr, uid, context: obj.pool.get('ir.sequence').get(cr, uid, 'pos.order.line'),
|
'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,
|
'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={}):
|
def create(self, cr, user, vals, context={}):
|
||||||
if vals.get('product_id'):
|
if vals.get('product_id'):
|
||||||
return super(pos_order_line, self).create(cr, user, vals, context)
|
return super(pos_order_line, self).create(cr, user, vals, context)
|
||||||
|
@ -1230,7 +1194,7 @@ class pos_order_line(osv.osv):
|
||||||
'qty': qty,
|
'qty': qty,
|
||||||
'name': product_name,
|
'name': product_name,
|
||||||
'order_id': order,
|
'order_id': order,
|
||||||
}
|
}
|
||||||
line_id = self.create(cr, uid, vals)
|
line_id = self.create(cr, uid, vals)
|
||||||
if not line_id:
|
if not line_id:
|
||||||
raise osv.except_osv(_('Error'), _('Create line failed !'))
|
raise osv.except_osv(_('Error'), _('Create line failed !'))
|
||||||
|
@ -1245,7 +1209,13 @@ class pos_order_line(osv.osv):
|
||||||
line_id = order_line_id
|
line_id = order_line_id
|
||||||
|
|
||||||
price_line = float(qty)*float(price)
|
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()
|
pos_order_line()
|
||||||
|
|
||||||
|
@ -1346,10 +1316,10 @@ class product_product(osv.osv):
|
||||||
'expense_pdt': fields.boolean('Product for expenses'),
|
'expense_pdt': fields.boolean('Product for expenses'),
|
||||||
'am_out': fields.boolean('Controle for Outgoing Operations'),
|
'am_out': fields.boolean('Controle for Outgoing Operations'),
|
||||||
'disc_controle': fields.boolean('Discount Controle '),
|
'disc_controle': fields.boolean('Discount Controle '),
|
||||||
}
|
}
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'disc_controle': lambda *a: True,
|
'disc_controle': lambda *a: True,
|
||||||
}
|
}
|
||||||
product_product()
|
product_product()
|
||||||
|
|
||||||
class stock_picking(osv.osv):
|
class stock_picking(osv.osv):
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<form string="Sales Order POS">
|
<form string="Sales Order POS">
|
||||||
<group col="6" colspan="4">
|
<group col="6" colspan="4">
|
||||||
<!--field name="user_salesman_id" />
|
|
||||||
<field name="partner_id" on_change="onchange_partner_pricelist(partner_id)"/>
|
<field name="partner_id" on_change="onchange_partner_pricelist(partner_id)"/>
|
||||||
<field name="contract_number" groups="base.group_extended"/> -->
|
<field name="contract_number" groups="base.group_extended"/> -->
|
||||||
|
|
||||||
|
@ -23,13 +22,10 @@
|
||||||
<tree string="Order lines" editable="bottom">
|
<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="product_id" on_change="onchange_product_id(parent.pricelist_id,product_id,qty,parent.partner_id)" width="275" />
|
||||||
<field name="qty"/>
|
<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_ded" on_change="onchange_ded(price_ded, price_subtotal_incl,price_unit)" invisible="1"/>
|
||||||
<field name="price_unit" readonly="1"/>
|
<field name="price_unit" readonly="1"/>
|
||||||
<field name="discount" on_change="onchange_discount(discount,price_unit)" />
|
<field name="discount" on_change="onchange_discount(discount,price_unit)" />
|
||||||
<field name="notice" on_change="onchange_dis(qty,price_subtotal_incl,discount)"/>
|
<field name="notice" on_change="onchange_dis(qty,price_subtotal_incl,discount)"/>
|
||||||
<!--field name="serial_number"/-->
|
|
||||||
<field name="price_subtotal" />
|
<field name="price_subtotal" />
|
||||||
<field name="price_subtotal_incl" sum="Subtotal"/>
|
<field name="price_subtotal_incl" sum="Subtotal"/>
|
||||||
</tree>
|
</tree>
|
||||||
|
@ -48,21 +44,8 @@
|
||||||
<group colspan="4" col="7">
|
<group colspan="4" col="7">
|
||||||
<field name="amount_tax"/>
|
<field name="amount_tax"/>
|
||||||
<field name="amount_total"/>
|
<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>
|
||||||
|
|
||||||
<!-- <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"/>
|
<separator colspan="4" string="Actions"/>
|
||||||
<group colspan="4" col="6">
|
<group colspan="4" col="6">
|
||||||
<field name="state" />
|
<field name="state" />
|
||||||
|
@ -83,24 +66,17 @@
|
||||||
<field name="company_id" groups="base.group_multi_company"/>
|
<field name="company_id" groups="base.group_multi_company"/>
|
||||||
<field name="price_type" />
|
<field name="price_type" />
|
||||||
<field name="user_id" string="Salesman" groups="base.group_extended"/>
|
<field name="user_id" string="Salesman" groups="base.group_extended"/>
|
||||||
<!--field name="sale_manager" /-->
|
|
||||||
</group>
|
</group>
|
||||||
<group colspan="2" col="2" name="Type">
|
<group colspan="2" col="2" name="Type">
|
||||||
<separator string="Dates" colspan="4"/>
|
<separator string="Dates" colspan="4"/>
|
||||||
<field name="date_order"/>
|
<field name="date_order"/>
|
||||||
<field name="date_validation" />
|
<field name="date_validation" />
|
||||||
<field name="date_payment" groups="base.group_extended"/>
|
<field name="date_payment" groups="base.group_extended"/>
|
||||||
<!-- <field name="type_rec" colspan="4"/>-->
|
|
||||||
</group>
|
</group>
|
||||||
<group colspan="4">
|
<group colspan="4">
|
||||||
<!-- <separator string="Invoicing" colspan="4"/>-->
|
|
||||||
<field name="partner_id" on_change="onchange_partner_pricelist(partner_id)" invisible="1"/>
|
<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="sale_journal" domain="[('type','=','sale')]" widget="selection" invisible="1"/>
|
||||||
<field name="pricelist_id" 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>
|
</group>
|
||||||
|
|
||||||
<field name="statement_ids" colspan="4" nolabel="1">
|
<field name="statement_ids" colspan="4" nolabel="1">
|
||||||
|
@ -800,8 +776,6 @@
|
||||||
id="products_for_output_operations"
|
id="products_for_output_operations"
|
||||||
groups="base.group_system"/>
|
groups="base.group_system"/>
|
||||||
|
|
||||||
<!-- <menuitem name="Register Management" parent="menu_point_root"-->
|
|
||||||
<!-- id="menu_point_config" sequence="4"/>-->
|
|
||||||
<menuitem
|
<menuitem
|
||||||
name="Input Operations" parent="menu_point_of_sale"
|
name="Input Operations" parent="menu_point_of_sale"
|
||||||
string="Refloat"
|
string="Refloat"
|
||||||
|
@ -866,40 +840,6 @@
|
||||||
|
|
||||||
<!-- Miscelleanous Operations/Reporting -->
|
<!-- 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="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 -->
|
<!-- Invoice -->
|
||||||
|
|
||||||
<record model="ir.actions.act_window" id="action_pos_invoice">
|
<record model="ir.actions.act_window" id="action_pos_invoice">
|
||||||
|
@ -910,41 +850,9 @@
|
||||||
<field name="view_mode">tree,form</field>
|
<field name="view_mode">tree,form</field>
|
||||||
<field name="domain">[('origin','like','POS')]</field>
|
<field name="domain">[('origin','like','POS')]</field>
|
||||||
</record>
|
</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"
|
<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"/>
|
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"
|
<menuitem icon="STOCK_PRINT" action="action_report_pos_details"
|
||||||
id="menu_pos_details" parent="menu_point_rep" sequence="6" />
|
id="menu_pos_details" parent="menu_point_rep" sequence="6" />
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,6 @@
|
||||||
<field name="act_from" ref="act_paid"/>
|
<field name="act_from" ref="act_paid"/>
|
||||||
<field name="act_to" ref="act_done"/>
|
<field name="act_to" ref="act_done"/>
|
||||||
<field name="signal">done</field>
|
<field name="signal">done</field>
|
||||||
<!-- <field name="role_id" ref="role_pos"/-->
|
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="workflow.transition" id="trans_paid_invoice">
|
<record model="workflow.transition" id="trans_paid_invoice">
|
||||||
|
|
|
@ -29,9 +29,9 @@ class account_statement(report_sxw.rml_parse):
|
||||||
super(account_statement, self).__init__(cr, uid, name, context)
|
super(account_statement, self).__init__(cr, uid, name, context)
|
||||||
self.total = 0.0
|
self.total = 0.0
|
||||||
self.localcontext.update({
|
self.localcontext.update({
|
||||||
'time': time,
|
'time': time,
|
||||||
'get_total':self._get_total,
|
'get_total':self._get_total,
|
||||||
})
|
})
|
||||||
def _get_total(self, statement_line_ids):
|
def _get_total(self, statement_line_ids):
|
||||||
total = 0.0
|
total = 0.0
|
||||||
for line in statement_line_ids:
|
for line in statement_line_ids:
|
||||||
|
|
|
@ -37,7 +37,7 @@ class all_closed_cashbox_of_the_day(report_sxw.rml_parse):
|
||||||
'get_user':self._get_user,
|
'get_user':self._get_user,
|
||||||
'get_sub_total':self._get_sub_total,
|
'get_sub_total':self._get_sub_total,
|
||||||
'get_net_total_starting':self._get_net_total_starting,
|
'get_net_total_starting':self._get_net_total_starting,
|
||||||
})
|
})
|
||||||
def _get_user(self,line_ids):
|
def _get_user(self,line_ids):
|
||||||
sql = "select name from res_users where id = %d"%(line_ids['create_uid'])
|
sql = "select name from res_users where id = %d"%(line_ids['create_uid'])
|
||||||
self.cr.execute(sql)
|
self.cr.execute(sql)
|
||||||
|
|
|
@ -148,10 +148,8 @@ class report_sales_by_margin_pos(osv.osv):
|
||||||
_description = "Sales by margin"
|
_description = "Sales by margin"
|
||||||
_auto = False
|
_auto = False
|
||||||
_columns = {
|
_columns = {
|
||||||
# 'pos_name': fields.char('POS Order', size=64, readonly=True),
|
|
||||||
'product_name':fields.char('Product Name', size=64, readonly=True),
|
'product_name':fields.char('Product Name', size=64, readonly=True),
|
||||||
'date_order': fields.date('Order Date',required=True, select=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),
|
'user_id': fields.many2one('res.users', 'User', readonly=True, select=True),
|
||||||
'qty': fields.float('Qty', 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),
|
'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"
|
_description = "Sales by margin monthly"
|
||||||
_auto = False
|
_auto = False
|
||||||
_columns = {
|
_columns = {
|
||||||
|
|
||||||
'product_name':fields.char('Product Name', size=64, readonly=True),
|
'product_name':fields.char('Product Name', size=64, readonly=True),
|
||||||
'date_order': fields.date('Order Date',required=True, select=True),
|
'date_order': fields.date('Order Date',required=True, select=True),
|
||||||
'user_id': fields.many2one('res.users', 'User', readonly=True, select=True),
|
'user_id': fields.many2one('res.users', 'User', readonly=True, select=True),
|
||||||
'qty': fields.float('Qty', 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),
|
'net_margin_per_qty':fields.float('Net margin per Qty', readonly=True, select=True),
|
||||||
'total':fields.float('Margin', readonly=True, select=True),
|
'total':fields.float('Margin', readonly=True, select=True),
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def init(self, cr):
|
def init(self, cr):
|
||||||
|
|
|
@ -96,17 +96,6 @@ class pos_details(report_sxw.rml_parse):
|
||||||
self.total_paid=res3[0]
|
self.total_paid=res3[0]
|
||||||
return res3[0] or False
|
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):
|
def _get_sum_discount(self, objects):
|
||||||
#code for the sum of discount value
|
#code for the sum of discount value
|
||||||
return reduce(lambda acc, object:
|
return reduce(lambda acc, object:
|
||||||
|
@ -119,18 +108,6 @@ class pos_details(report_sxw.rml_parse):
|
||||||
0.0)
|
0.0)
|
||||||
|
|
||||||
def _get_payments(self, form,user, ignore_gift=False):
|
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")
|
statement_line_obj = self.pool.get("account.bank.statement.line")
|
||||||
gift_journal_id = None
|
gift_journal_id = None
|
||||||
if ignore_gift:
|
if ignore_gift:
|
||||||
|
@ -200,13 +177,6 @@ class pos_details(report_sxw.rml_parse):
|
||||||
temp.update({'amount':temp2})
|
temp.update({'amount':temp2})
|
||||||
return [temp] or False
|
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):
|
def _get_period(self, form):
|
||||||
return form['date_start']
|
return form['date_start']
|
||||||
|
|
||||||
|
|
|
@ -29,9 +29,9 @@ class pos_lines(report_sxw.rml_parse):
|
||||||
super(pos_lines, self).__init__(cr, uid, name, context)
|
super(pos_lines, self).__init__(cr, uid, name, context)
|
||||||
self.total = 0.0
|
self.total = 0.0
|
||||||
self.localcontext.update({
|
self.localcontext.update({
|
||||||
'time': time,
|
'time': time,
|
||||||
'total_quantity': self.__total_quantity__,
|
'total_quantity': self.__total_quantity__,
|
||||||
'taxes':self.__taxes__,
|
'taxes':self.__taxes__,
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
@ -28,10 +28,10 @@ class pos_payment_report(report_sxw.rml_parse):
|
||||||
super(pos_payment_report, self).__init__(cr, uid, name, context)
|
super(pos_payment_report, self).__init__(cr, uid, name, context)
|
||||||
self.total = 0.0
|
self.total = 0.0
|
||||||
self.localcontext.update({
|
self.localcontext.update({
|
||||||
'time': time,
|
'time': time,
|
||||||
'pos_payment': self._pos_payment,
|
'pos_payment': self._pos_payment,
|
||||||
'pos_payment_total':self._pos_payment_total,
|
'pos_payment_total':self._pos_payment_total,
|
||||||
})
|
})
|
||||||
|
|
||||||
def _pos_payment(self,obj):
|
def _pos_payment(self,obj):
|
||||||
data={}
|
data={}
|
||||||
|
@ -58,12 +58,6 @@ class pos_payment_report(report_sxw.rml_parse):
|
||||||
|
|
||||||
|
|
||||||
def _pos_payment_total(self,o):
|
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
|
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)
|
super(pos_payment_report_date, self).__init__(cr, uid, name, context)
|
||||||
self.total = 0.0
|
self.total = 0.0
|
||||||
self.localcontext.update({
|
self.localcontext.update({
|
||||||
'time': time,
|
'time': time,
|
||||||
'pos_payment_date': self.__pos_payment_date__,
|
'pos_payment_date': self.__pos_payment_date__,
|
||||||
'pos_payment_date_total':self.__pos_payment_date__total__,
|
'pos_payment_date_total':self.__pos_payment_date__total__,
|
||||||
})
|
})
|
||||||
|
|
||||||
def __pos_payment_date__(self,form):
|
def __pos_payment_date__(self,form):
|
||||||
dt1 = form['date_start'] + ' 00:00:00'
|
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)
|
super(pos_payment_report_user, self).__init__(cr, uid, name, context)
|
||||||
self.total = 0.0
|
self.total = 0.0
|
||||||
self.localcontext.update({
|
self.localcontext.update({
|
||||||
'time': time,
|
'time': time,
|
||||||
'pos_payment_user': self.__pos_payment_user__,
|
'pos_payment_user': self.__pos_payment_user__,
|
||||||
'pos_payment_user_total':self.__pos_payment_user__total__,
|
'pos_payment_user_total':self.__pos_payment_user__total__,
|
||||||
})
|
})
|
||||||
|
|
||||||
def __pos_payment_user__(self,form):
|
def __pos_payment_user__(self,form):
|
||||||
data={}
|
data={}
|
||||||
|
|
|
@ -28,10 +28,10 @@ class pos_sales_user(report_sxw.rml_parse):
|
||||||
super(pos_sales_user, self).__init__(cr, uid, name, context)
|
super(pos_sales_user, self).__init__(cr, uid, name, context)
|
||||||
self.total = 0.0
|
self.total = 0.0
|
||||||
self.localcontext.update({
|
self.localcontext.update({
|
||||||
'time': time,
|
'time': time,
|
||||||
'get_data':self._get_data,
|
'get_data':self._get_data,
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
def _get_data(self,form):
|
def _get_data(self,form):
|
||||||
dt1 = form['date_start'] + ' 00:00:00'
|
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)
|
super(pos_sales_user_today, self).__init__(cr, uid, name, context)
|
||||||
self.total = 0.0
|
self.total = 0.0
|
||||||
self.localcontext.update({
|
self.localcontext.update({
|
||||||
'time': time,
|
'time': time,
|
||||||
'get_data':self._get_data,
|
'get_data':self._get_data,
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
def _get_data(self,form):
|
def _get_data(self,form):
|
||||||
data={}
|
data={}
|
||||||
|
|
|
@ -29,12 +29,12 @@ class pos_sales_user_today_current_user(report_sxw.rml_parse):
|
||||||
self.total = 0.0
|
self.total = 0.0
|
||||||
self.qty = 0.0
|
self.qty = 0.0
|
||||||
self.localcontext.update({
|
self.localcontext.update({
|
||||||
'time': time,
|
'time': time,
|
||||||
'get_user':self._get_user,
|
'get_user':self._get_user,
|
||||||
'get_data_current_user':self._get_data_current_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_tot':self._get_data_current_user_tot,
|
||||||
'get_data_current_user_qty':self._get_data_current_user_qty,
|
'get_data_current_user_qty':self._get_data_current_user_qty,
|
||||||
})
|
})
|
||||||
|
|
||||||
def _get_user(self, user):
|
def _get_user(self, user):
|
||||||
pos_user={}
|
pos_user={}
|
||||||
|
@ -58,15 +58,6 @@ class pos_sales_user_today_current_user(report_sxw.rml_parse):
|
||||||
return data
|
return data
|
||||||
|
|
||||||
def _get_data_current_user_tot(self, user):
|
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
|
return self.total
|
||||||
|
|
||||||
def _get_data_current_user_qty(self, user):
|
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)
|
super(pos_user_product, self).__init__(cr, uid, name, context)
|
||||||
self.total = 0.0
|
self.total = 0.0
|
||||||
self.localcontext.update({
|
self.localcontext.update({
|
||||||
'time': time,
|
'time': time,
|
||||||
'get_data':self._get_data,
|
'get_data':self._get_data,
|
||||||
'get_user':self._get_user,
|
'get_user':self._get_user,
|
||||||
'get_total':self._get_total,
|
'get_total':self._get_total,
|
||||||
|
|
||||||
})
|
})
|
||||||
def _get_data(self,o):
|
def _get_data(self,o):
|
||||||
data={}
|
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)
|
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,7 +25,7 @@ class report_cash_register(osv.osv):
|
||||||
_name = "report.cash.register"
|
_name = "report.cash.register"
|
||||||
_description = "Point of Sale Cash Register Analysis"
|
_description = "Point of Sale Cash Register Analysis"
|
||||||
_auto = False
|
_auto = False
|
||||||
_columns ={
|
_columns = {
|
||||||
'date': fields.date('Create Date', readonly=True),
|
'date': fields.date('Create Date', readonly=True),
|
||||||
'year': fields.char('Year', size=4),
|
'year': fields.char('Year', size=4),
|
||||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
||||||
|
|
|
@ -26,7 +26,7 @@ class report_pos_order(osv.osv):
|
||||||
_name = "report.pos.order"
|
_name = "report.pos.order"
|
||||||
_description = "Point of Sale Orders Statistics"
|
_description = "Point of Sale Orders Statistics"
|
||||||
_auto = False
|
_auto = False
|
||||||
_columns ={
|
_columns = {
|
||||||
'date': fields.date('Date Order', readonly=True),
|
'date': fields.date('Date Order', readonly=True),
|
||||||
'year': fields.char('Year', size=4, readonly=True),
|
'year': fields.char('Year', size=4, readonly=True),
|
||||||
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
'month':fields.selection([('01','January'), ('02','February'), ('03','March'), ('04','April'),
|
||||||
|
@ -39,8 +39,6 @@ class report_pos_order(osv.osv):
|
||||||
('advance','Advance'),
|
('advance','Advance'),
|
||||||
('paid', 'Paid'), ('done', 'Done'), ('invoiced', 'Invoiced'), ('cancel', 'Cancel')],
|
('paid', 'Paid'), ('done', 'Done'), ('invoiced', 'Invoiced'), ('cancel', 'Cancel')],
|
||||||
'State'),
|
'State'),
|
||||||
# 'state_2': fields.function([('to_verify', 'To Verify'), ('accepted', 'Accepted'),
|
|
||||||
# ('refused', 'Refused')], string='State'),
|
|
||||||
'user_id':fields.many2one('res.users', 'Salesman', readonly=True),
|
'user_id':fields.many2one('res.users', 'Salesman', readonly=True),
|
||||||
'price_total':fields.float('Total Price', readonly=True),
|
'price_total':fields.float('Total Price', readonly=True),
|
||||||
'total_discount':fields.float('Total Discount', 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'}"/>
|
<filter string="Customer" icon="terp-personal" context="{'group_by':'partner_id'}"/>
|
||||||
<separator orientation="vertical"/>
|
<separator orientation="vertical"/>
|
||||||
<filter string="Product" icon="terp-accessories-archiver" context="{'group_by':'product_id'}"/>
|
<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"/>
|
<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="Day" icon="terp-go-today" context="{'group_by':'day'}"/>
|
||||||
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
|
<filter string="Month" icon="terp-go-month" context="{'group_by':'month'}"/>
|
||||||
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
|
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
|
||||||
|
|
|
@ -1,21 +1,6 @@
|
||||||
<openerp>
|
<openerp>
|
||||||
<data>
|
<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"
|
<menuitem icon="STOCK_PRINT"
|
||||||
action="action_report_all_closed_cashbox_of_the_day"
|
action="action_report_all_closed_cashbox_of_the_day"
|
||||||
id="menu_all_closed_cashbox_of_the_day"
|
id="menu_all_closed_cashbox_of_the_day"
|
||||||
|
|
|
@ -49,9 +49,9 @@ class all_closed_cashbox_of_the_day(osv.osv_memory):
|
||||||
datas['form'] = res
|
datas['form'] = res
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'type' : 'ir.actions.report.xml',
|
'type' : 'ir.actions.report.xml',
|
||||||
'report_name':'all.closed.cashbox.of.the.day',
|
'report_name':'all.closed.cashbox.of.the.day',
|
||||||
'datas' : datas,
|
'datas' : datas,
|
||||||
}
|
}
|
||||||
|
|
||||||
all_closed_cashbox_of_the_day()
|
all_closed_cashbox_of_the_day()
|
||||||
|
|
|
@ -71,16 +71,16 @@ class pos_box_entries(osv.osv_memory):
|
||||||
|
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'name': fields.char('Description', size=32, required=True),
|
'name': fields.char('Description', size=32, required=True),
|
||||||
'journal_id': fields.selection(get_journal, "Register", required=True),
|
'journal_id': fields.selection(get_journal, "Register", required=True),
|
||||||
'product_id': fields.selection(_get_income_product, "Operation", required=True),
|
'product_id': fields.selection(_get_income_product, "Operation", required=True),
|
||||||
'amount': fields.float('Amount', digits=(16, 2)),
|
'amount': fields.float('Amount', digits=(16, 2)),
|
||||||
'ref': fields.char('Ref', size=32),
|
'ref': fields.char('Ref', size=32),
|
||||||
}
|
}
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'journal_id': lambda *a: 1,
|
'journal_id': lambda *a: 1,
|
||||||
'product_id': lambda *a: 1,
|
'product_id': lambda *a: 1,
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_in(self, cr, uid, ids, context):
|
def get_in(self, cr, uid, ids, context):
|
||||||
"""
|
"""
|
||||||
|
@ -109,11 +109,12 @@ class pos_box_entries(osv.osv_memory):
|
||||||
if statement_id:
|
if statement_id:
|
||||||
statement_id = statement_id[0]
|
statement_id = statement_id[0]
|
||||||
if not statement_id:
|
if not statement_id:
|
||||||
statement_id = statement_obj.create(cr, uid, {'date': time.strftime('%Y-%m-%d 00:00:00'),
|
statement_id = statement_obj.create(cr, uid, {
|
||||||
'journal_id': data['journal_id'],
|
'date': time.strftime('%Y-%m-%d 00:00:00'),
|
||||||
'company_id': curr_company,
|
'journal_id': data['journal_id'],
|
||||||
'user_id': uid,
|
'company_id': curr_company,
|
||||||
})
|
'user_id': uid,
|
||||||
|
})
|
||||||
|
|
||||||
args['statement_id'] = statement_id
|
args['statement_id'] = statement_id
|
||||||
args['journal_id'] = data['journal_id']
|
args['journal_id'] = data['journal_id']
|
||||||
|
|
|
@ -49,16 +49,16 @@ class pos_box_out(osv.osv_memory):
|
||||||
return res
|
return res
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'name': fields.char('Description', size=32, required=True),
|
'name': fields.char('Description', size=32, required=True),
|
||||||
'journal_id': fields.selection(pos_box_entries.get_journal, "Register", required=True),
|
'journal_id': fields.selection(pos_box_entries.get_journal, "Register", required=True),
|
||||||
'product_id': fields.selection(_get_expense_product, "Operation", required=True),
|
'product_id': fields.selection(_get_expense_product, "Operation", required=True),
|
||||||
'amount': fields.float('Amount', digits=(16, 2)),
|
'amount': fields.float('Amount', digits=(16, 2)),
|
||||||
'ref': fields.char('Ref', size=32),
|
'ref': fields.char('Ref', size=32),
|
||||||
}
|
}
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'journal_id': lambda *a: 1,
|
'journal_id': lambda *a: 1,
|
||||||
'product_id': lambda *a: 1,
|
'product_id': lambda *a: 1,
|
||||||
}
|
}
|
||||||
def get_out(self, cr, uid, ids, context):
|
def get_out(self, cr, uid, ids, context):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
|
@ -102,11 +102,12 @@ class pos_box_out(osv.osv_memory):
|
||||||
if statement_id:
|
if statement_id:
|
||||||
statement_id = statement_id[0]
|
statement_id = statement_id[0]
|
||||||
if not statement_id:
|
if not statement_id:
|
||||||
statement_id = statement_obj.create(cr, uid, {'date': time.strftime('%Y-%m-%d 00:00:00'),
|
statement_id = statement_obj.create(cr, uid, {
|
||||||
'journal_id': data['journal_id'],
|
'date': time.strftime('%Y-%m-%d 00:00:00'),
|
||||||
'company_id': curr_company,
|
'journal_id': data['journal_id'],
|
||||||
'user_id': uid,
|
'company_id': curr_company,
|
||||||
})
|
'user_id': uid,
|
||||||
|
})
|
||||||
args['statement_id'] = statement_id
|
args['statement_id'] = statement_id
|
||||||
args['journal_id'] = data['journal_id']
|
args['journal_id'] = data['journal_id']
|
||||||
if acc_id:
|
if acc_id:
|
||||||
|
|
|
@ -14,7 +14,6 @@
|
||||||
<field name="journal_id"/>
|
<field name="journal_id"/>
|
||||||
<field name="product_id"/>
|
<field name="product_id"/>
|
||||||
<field name="amount"/>
|
<field name="amount"/>
|
||||||
<!-- <field name="ref"/>-->
|
|
||||||
<group colspan="4" col="2">
|
<group colspan="4" col="2">
|
||||||
<button icon='gtk-cancel' special="cancel"
|
<button icon='gtk-cancel' special="cancel"
|
||||||
string="Close" />
|
string="Close" />
|
||||||
|
|
|
@ -61,13 +61,14 @@ class pos_close_statement(osv.osv_memory):
|
||||||
if id3:
|
if id3:
|
||||||
id3 = data_obj.browse(cr, uid, id3, context=context).res_id
|
id3 = data_obj.browse(cr, uid, id3, context=context).res_id
|
||||||
return {
|
return {
|
||||||
'domain': "[('id','in'," + str(list_statement) + ")]",
|
'domain': "[('id','in'," + str(list_statement) + ")]",
|
||||||
'name': 'Close Statements',
|
'name': 'Close Statements',
|
||||||
'view_type': 'form',
|
'view_type': 'form',
|
||||||
'view_mode': 'tree,form',
|
'view_mode': 'tree,form',
|
||||||
'res_model': 'account.bank.statement',
|
'res_model': 'account.bank.statement',
|
||||||
'views': [(id2, 'tree'),(id3, 'form')],
|
'views': [(id2, 'tree'),(id3, 'form')],
|
||||||
'type': 'ir.actions.act_window'}
|
'type': 'ir.actions.act_window'
|
||||||
|
}
|
||||||
|
|
||||||
pos_close_statement()
|
pos_close_statement()
|
||||||
|
|
||||||
|
|
|
@ -101,29 +101,6 @@ class pos_discount(osv.osv_memory):
|
||||||
order_line_ref.write(cr, uid, [line.id], res_new, context=context)
|
order_line_ref.write(cr, uid, [line.id], res_new, context=context)
|
||||||
return {}
|
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()
|
pos_discount()
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# 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], {
|
order = proxy_pick.write(cr, uid, [this.picking_id.id], {
|
||||||
'invoice_state': 'none',
|
'invoice_state': 'none',
|
||||||
'pos_order': record_id
|
'pos_order': record_id
|
||||||
})
|
})
|
||||||
|
|
||||||
for line in pick.move_lines:
|
for line in pick.move_lines:
|
||||||
proxy_order_line.create(cr, uid, {
|
proxy_order_line.create(cr, uid, {
|
||||||
|
|
|
@ -96,7 +96,7 @@ class pos_open_statement(osv.osv_memory):
|
||||||
'res_model': 'account.bank.statement',
|
'res_model': 'account.bank.statement',
|
||||||
'views': [(id2, 'tree'),(id3, 'form')],
|
'views': [(id2, 'tree'),(id3, 'form')],
|
||||||
'type': 'ir.actions.act_window'
|
'type': 'ir.actions.act_window'
|
||||||
}
|
}
|
||||||
pos_open_statement()
|
pos_open_statement()
|
||||||
|
|
||||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
||||||
|
|
|
@ -137,11 +137,6 @@ class pos_make_payment(osv.osv_memory):
|
||||||
invoice_wanted = data['invoice_wanted']
|
invoice_wanted = data['invoice_wanted']
|
||||||
# Todo need to check ...
|
# 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.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)
|
order_obj.add_payment(cr, uid, active_id, data, context=context)
|
||||||
|
@ -180,9 +175,9 @@ class pos_make_payment(osv.osv_memory):
|
||||||
datas = {'ids': active_ids}
|
datas = {'ids': active_ids}
|
||||||
datas['form'] = {}
|
datas['form'] = {}
|
||||||
return {
|
return {
|
||||||
'type' : 'ir.actions.report.xml',
|
'type' : 'ir.actions.report.xml',
|
||||||
'report_name':'pos.invoice',
|
'report_name':'pos.invoice',
|
||||||
'datas' : datas,
|
'datas' : datas,
|
||||||
}
|
}
|
||||||
|
|
||||||
def print_report(self, cr, uid, ids, context=None):
|
def print_report(self, cr, uid, ids, context=None):
|
||||||
|
|
|
@ -43,19 +43,19 @@ class pos_payment_report_date(osv.osv_memory):
|
||||||
datas['form'] = res
|
datas['form'] = res
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'type': 'ir.actions.report.xml',
|
'type': 'ir.actions.report.xml',
|
||||||
'report_name': 'pos.payment.report.date',
|
'report_name': 'pos.payment.report.date',
|
||||||
'datas': datas,
|
'datas': datas,
|
||||||
}
|
}
|
||||||
|
|
||||||
_columns = {
|
_columns = {
|
||||||
'date_start': fields.date('Start Date', required=True),
|
'date_start': fields.date('Start Date', required=True),
|
||||||
'date_end': fields.date('End 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')
|
'user_id': fields.many2many('res.users', 'res_user_sale', 'user_id', 'sale_id', 'Salesman')
|
||||||
}
|
}
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'date_start': 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'),
|
'date_end': lambda *a: time.strftime('%Y-%m-%d'),
|
||||||
}
|
}
|
||||||
|
|
||||||
pos_payment_report_date()
|
pos_payment_report_date()
|
||||||
|
|
|
@ -42,13 +42,13 @@ class pos_payment_report_user(osv.osv_memory):
|
||||||
datas['form'] = res
|
datas['form'] = res
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'type': 'ir.actions.report.xml',
|
'type': 'ir.actions.report.xml',
|
||||||
'report_name': 'pos.payment.report.user',
|
'report_name': 'pos.payment.report.user',
|
||||||
'datas': datas,
|
'datas': datas,
|
||||||
}
|
}
|
||||||
|
|
||||||
_columns = {
|
_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()
|
pos_payment_report_user()
|
||||||
|
|
|
@ -28,13 +28,6 @@
|
||||||
<field name="view_mode">form</field>
|
<field name="view_mode">form</field>
|
||||||
<field name="target">new</field>
|
<field name="target">new</field>
|
||||||
</record>
|
</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>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
|
@ -40,10 +40,6 @@ class pos_receipt(osv.osv_memory):
|
||||||
@return: New arch of view with new columns.
|
@return: New arch of view with new columns.
|
||||||
"""
|
"""
|
||||||
order_lst = self. pool.get('pos.order').browse(cr, uid, context['active_id'])
|
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):
|
def print_report(self, cr, uid, ids, context=None):
|
||||||
|
|
||||||
|
|
|
@ -109,13 +109,13 @@ class pos_return(osv.osv_memory):
|
||||||
for line in order.lines:
|
for line in order.lines:
|
||||||
quantity=line.qty
|
quantity=line.qty
|
||||||
_line_fields.update({
|
_line_fields.update({
|
||||||
'return%s'%(line.id) : {
|
'return%s'%(line.id) : {
|
||||||
'string': line.product_id.name,
|
'string': line.product_id.name,
|
||||||
'type' : 'float',
|
'type' : 'float',
|
||||||
'required': True,
|
'required': True,
|
||||||
'default':quantity
|
'default':quantity
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
_moves_arch_lst += """
|
_moves_arch_lst += """
|
||||||
<field name="return%s"/>
|
<field name="return%s"/>
|
||||||
<newline/>
|
<newline/>
|
||||||
|
@ -148,15 +148,15 @@ class pos_return(osv.osv_memory):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
return {
|
return {
|
||||||
'name': _('Add Product'),
|
'name': _('Add Product'),
|
||||||
'view_type': 'form',
|
'view_type': 'form',
|
||||||
'view_mode': 'form',
|
'view_mode': 'form',
|
||||||
'res_model': 'pos.add.product',
|
'res_model': 'pos.add.product',
|
||||||
'view_id': False,
|
'view_id': False,
|
||||||
'target':'new',
|
'target':'new',
|
||||||
'views': False,
|
'views': False,
|
||||||
'context': context,
|
'context': context,
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
}
|
}
|
||||||
def create_returns2(self, cr, uid, ids, context):
|
def create_returns2(self, cr, uid, ids, context):
|
||||||
active_id = context.get('active_id', False)
|
active_id = context.get('active_id', False)
|
||||||
|
@ -197,7 +197,7 @@ class pos_return(osv.osv_memory):
|
||||||
qty = data['return%s' %line.id]
|
qty = data['return%s' %line.id]
|
||||||
except :
|
except :
|
||||||
qty = line.qty
|
qty = line.qty
|
||||||
new_move = stock_move_obj.create(cr, uid,{
|
new_move = stock_move_obj.create(cr, uid, {
|
||||||
'product_qty': qty ,
|
'product_qty': qty ,
|
||||||
'product_uos_qty': uom_obj._compute_qty(cr, uid, qty ,line.product_id.uom_id.id),
|
'product_uos_qty': uom_obj._compute_qty(cr, uid, qty ,line.product_id.uom_id.id),
|
||||||
'picking_id': new_picking,
|
'picking_id': new_picking,
|
||||||
|
@ -207,7 +207,8 @@ class pos_return(osv.osv_memory):
|
||||||
'location_dest_id': stock_dest_id,
|
'location_dest_id': stock_dest_id,
|
||||||
'name': '%s (return)' %order_id.name,
|
'name': '%s (return)' %order_id.name,
|
||||||
'date': date_cur,
|
'date': date_cur,
|
||||||
'date_planned': date_cur,})
|
'date_planned': date_cur
|
||||||
|
})
|
||||||
line_obj.copy(cr, uid, line.id, {'qty': -qty, 'order_id': new_order})
|
line_obj.copy(cr, uid, line.id, {'qty': -qty, 'order_id': new_order})
|
||||||
order_obj.write(cr,uid, [active_id,new_order], {'state': 'done'})
|
order_obj.write(cr,uid, [active_id,new_order], {'state': 'done'})
|
||||||
wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
|
wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
|
||||||
|
@ -271,13 +272,14 @@ class add_product(osv.osv_memory):
|
||||||
stock_dest_id = val.id
|
stock_dest_id = val.id
|
||||||
|
|
||||||
prod_id=prod_obj.browse(cr, uid, prod)
|
prod_id=prod_obj.browse(cr, uid, prod)
|
||||||
new_picking=picking_obj.create(cr, uid,{
|
new_picking=picking_obj.create(cr, uid, {
|
||||||
'name':'%s (Added)' %order_id.name,
|
'name':'%s (Added)' %order_id.name,
|
||||||
'move_lines':[],
|
'move_lines':[],
|
||||||
'state':'draft',
|
'state':'draft',
|
||||||
'type':'out',
|
'type':'out',
|
||||||
'date':date_cur, })
|
'date':date_cur
|
||||||
new_move=stock_move_obj.create(cr, uid,{
|
})
|
||||||
|
new_move=stock_move_obj.create(cr, uid, {
|
||||||
'product_qty': qty,
|
'product_qty': qty,
|
||||||
'product_uos_qty': uom_obj._compute_qty(cr, uid, prod_id.uom_id.id, qty, prod_id.uom_id.id),
|
'product_uos_qty': uom_obj._compute_qty(cr, uid, prod_id.uom_id.id, qty, prod_id.uom_id.id),
|
||||||
'picking_id':new_picking,
|
'picking_id':new_picking,
|
||||||
|
@ -287,7 +289,8 @@ class add_product(osv.osv_memory):
|
||||||
'location_dest_id':stock_dest_id,
|
'location_dest_id':stock_dest_id,
|
||||||
'name':'%s (return)' %order_id.name,
|
'name':'%s (return)' %order_id.name,
|
||||||
'date':date_cur,
|
'date':date_cur,
|
||||||
'date_planned':date_cur,})
|
'date_planned':date_cur
|
||||||
|
})
|
||||||
|
|
||||||
wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
|
wf_service.trg_validate(uid, 'stock.picking', new_picking, 'button_confirm', cr)
|
||||||
picking_obj.force_assign(cr, uid, [new_picking], context)
|
picking_obj.force_assign(cr, uid, [new_picking], context)
|
||||||
|
@ -295,16 +298,16 @@ class add_product(osv.osv_memory):
|
||||||
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'name': _('Add Product'),
|
'name': _('Add Product'),
|
||||||
'view_type': 'form',
|
'view_type': 'form',
|
||||||
'view_mode': 'form',
|
'view_mode': 'form',
|
||||||
'res_model': 'pos.add.product',
|
'res_model': 'pos.add.product',
|
||||||
'view_id': False,
|
'view_id': False,
|
||||||
'target':'new',
|
'target':'new',
|
||||||
'context':context,
|
'context':context,
|
||||||
'views': False,
|
'views': False,
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
}
|
}
|
||||||
|
|
||||||
def close_action(self, cr, uid, ids, context):
|
def close_action(self, cr, uid, ids, context):
|
||||||
active_ids=context.get('active_ids', False)
|
active_ids=context.get('active_ids', False)
|
||||||
|
@ -334,15 +337,16 @@ class add_product(osv.osv_memory):
|
||||||
order_obj.write(cr,uid,[order_id.id],{'type_rec':'Exchange'})
|
order_obj.write(cr,uid,[order_id.id],{'type_rec':'Exchange'})
|
||||||
if order_id.invoice_id:
|
if order_id.invoice_id:
|
||||||
invoice_obj.refund(cr, uid, [order_id.invoice_id.id], time.strftime('%Y-%m-%d'), False, order_id.name)
|
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,{
|
new_picking=picking_obj.create(cr, uid, {
|
||||||
'name':'%s (return)' %order_id.name,
|
'name':'%s (return)' %order_id.name,
|
||||||
'move_lines':[], 'state':'draft',
|
'move_lines':[], 'state':'draft',
|
||||||
'type':'in',
|
'type':'in',
|
||||||
'date':date_cur})
|
'date':date_cur
|
||||||
|
})
|
||||||
for line in order_id.lines:
|
for line in order_id.lines:
|
||||||
key=('return%s') %line.id
|
key=('return%s') %line.id
|
||||||
if line.id and data.has_key(key):
|
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_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),
|
'product_uos_qty': uom_obj._compute_qty(cr, uid, data['return%s' %line.id], line.product_id.uom_id.id),
|
||||||
'picking_id':new_picking,
|
'picking_id':new_picking,
|
||||||
|
@ -352,10 +356,12 @@ class add_product(osv.osv_memory):
|
||||||
'location_dest_id':stock_dest_id,
|
'location_dest_id':stock_dest_id,
|
||||||
'name':'%s (return)' %order_id.name,
|
'name':'%s (return)' %order_id.name,
|
||||||
'date':date_cur,
|
'date':date_cur,
|
||||||
'date_planned':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)
|
|
||||||
})
|
})
|
||||||
|
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)
|
wf_service.trg_validate(uid, 'stock.picking',new_picking,'button_confirm', cr)
|
||||||
picking_obj.force_assign(cr, uid, [new_picking], context)
|
picking_obj.force_assign(cr, uid, [new_picking], context)
|
||||||
obj=order_obj.browse(cr,uid, active_ids[0])
|
obj=order_obj.browse(cr,uid, active_ids[0])
|
||||||
|
@ -363,16 +369,15 @@ class add_product(osv.osv_memory):
|
||||||
|
|
||||||
if obj.amount_total != obj.amount_paid:
|
if obj.amount_total != obj.amount_paid:
|
||||||
return {
|
return {
|
||||||
'name': _('Make Payment'),
|
'name': _('Make Payment'),
|
||||||
'context ':context,
|
'context ':context,
|
||||||
'view_type': 'form',
|
'view_type': 'form',
|
||||||
'view_mode': 'form',
|
'view_mode': 'form',
|
||||||
'res_model': 'pos.make.payment',
|
'res_model': 'pos.make.payment',
|
||||||
'view_id': False,
|
'view_id': False,
|
||||||
'target': 'new',
|
'target': 'new',
|
||||||
'views': False,
|
'views': False,
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
|
|
||||||
}
|
}
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
|
@ -31,13 +31,6 @@
|
||||||
<field name="view_mode">form</field>
|
<field name="view_mode">form</field>
|
||||||
<field name="target">new</field>
|
<field name="target">new</field>
|
||||||
</record>
|
</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>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
|
@ -37,7 +37,10 @@
|
||||||
'website': 'http://www.openerp.com',
|
'website': 'http://www.openerp.com',
|
||||||
'depends': ['base'],
|
'depends': ['base'],
|
||||||
'init_xml': [],
|
'init_xml': [],
|
||||||
'update_xml': ['security/ir.model.access.csv', 'process_view.xml'],
|
'update_xml': [
|
||||||
|
'security/ir.model.access.csv',
|
||||||
|
'process_view.xml'
|
||||||
|
],
|
||||||
'demo_xml': [],
|
'demo_xml': [],
|
||||||
'installable': True,
|
'installable': True,
|
||||||
'active': False,
|
'active': False,
|
||||||
|
|
|
@ -28,10 +28,10 @@ class company(osv.osv):
|
||||||
help="This is the time frame analysed by the scheduler when "\
|
help="This is the time frame analysed by the scheduler when "\
|
||||||
"computing procurements. All procurements that are not between "\
|
"computing procurements. All procurements that are not between "\
|
||||||
"today and today+range are skipped for futur computation."),
|
"today and today+range are skipped for futur computation."),
|
||||||
}
|
}
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'schedule_range': 80.0,
|
'schedule_range': 80.0,
|
||||||
}
|
}
|
||||||
|
|
||||||
company()
|
company()
|
||||||
|
|
||||||
|
|
|
@ -263,12 +263,5 @@
|
||||||
res_model="stock.warehouse.orderpoint"
|
res_model="stock.warehouse.orderpoint"
|
||||||
src_model="procurement.order"/>
|
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>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -259,7 +259,7 @@ class procurement_order(osv.osv):
|
||||||
'act_from': user_id,
|
'act_from': user_id,
|
||||||
'act_to': user_id,
|
'act_to': user_id,
|
||||||
'body': '\n'.join(report)
|
'body': '\n'.join(report)
|
||||||
})
|
})
|
||||||
if use_new_cursor:
|
if use_new_cursor:
|
||||||
cr.commit()
|
cr.commit()
|
||||||
cr.close()
|
cr.close()
|
||||||
|
|
|
@ -49,8 +49,8 @@ class make_procurement(osv.osv_memory):
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults = {
|
_defaults = {
|
||||||
'date_planned': lambda *args: time.strftime('%Y-%m-%d'),
|
'date_planned': lambda *args: time.strftime('%Y-%m-%d'),
|
||||||
'qty': lambda *args: 1.0,
|
'qty': lambda *args: 1.0,
|
||||||
}
|
}
|
||||||
|
|
||||||
def make_procurement(self, cr, uid, ids, context=None):
|
def make_procurement(self, cr, uid, ids, context=None):
|
||||||
|
@ -92,12 +92,12 @@ class make_procurement(osv.osv_memory):
|
||||||
id3 = data_obj.browse(cr, uid, id3, context=context).res_id
|
id3 = data_obj.browse(cr, uid, id3, context=context).res_id
|
||||||
|
|
||||||
return {
|
return {
|
||||||
'view_type': 'form',
|
'view_type': 'form',
|
||||||
'view_mode': 'tree,form',
|
'view_mode': 'tree,form',
|
||||||
'res_model': 'procurement.order',
|
'res_model': 'procurement.order',
|
||||||
'res_id' : procure_id,
|
'res_id' : procure_id,
|
||||||
'views': [(id3,'form'),(id2,'tree')],
|
'views': [(id3,'form'),(id2,'tree')],
|
||||||
'type': 'ir.actions.act_window',
|
'type': 'ir.actions.act_window',
|
||||||
}
|
}
|
||||||
|
|
||||||
def default_get(self, cr, uid, fields, context=None):
|
def default_get(self, cr, uid, fields, context=None):
|
||||||
|
|
|
@ -32,7 +32,6 @@ class procurement_compute(osv.osv_memory):
|
||||||
proc_obj._procure_confirm(cr, uid, use_new_cursor=cr.dbname, context=context)
|
proc_obj._procure_confirm(cr, uid, use_new_cursor=cr.dbname, context=context)
|
||||||
finally:
|
finally:
|
||||||
pass
|
pass
|
||||||
#cr.close()
|
|
||||||
return {}
|
return {}
|
||||||
|
|
||||||
def procure_calculation(self, cr, uid, ids, context):
|
def procure_calculation(self, cr, uid, ids, context):
|
||||||
|
|
|
@ -22,13 +22,5 @@
|
||||||
</field>
|
</field>
|
||||||
</record>
|
</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>
|
</data>
|
||||||
</openerp>
|
</openerp>
|
||||||
|
|
|
@ -31,7 +31,7 @@ class procurement_compute_all(osv.osv_memory):
|
||||||
'automatic': fields.boolean('Automatic orderpoint',help='Triggers an automatic procurement for all products that have a virtual stock under 0. You should probably not use this option, we suggest using a MTO configuration on products.'),
|
'automatic': fields.boolean('Automatic orderpoint',help='Triggers an automatic procurement for all products that have a virtual stock under 0. You should probably not use this option, we suggest using a MTO configuration on products.'),
|
||||||
}
|
}
|
||||||
|
|
||||||
_defaults ={
|
_defaults = {
|
||||||
'automatic': lambda *a: False,
|
'automatic': lambda *a: False,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue