Merge with openobject-addons

bzr revid: ruchakpatel@gmail.com-20080917114446-29unqnjx5mke7pfn
This commit is contained in:
Rucha Patel
2008-09-17 17:14:46 +05:30
120 changed files with 3217 additions and 2435 deletions
+17
View File
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>addons</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.python.pydev.PyDevBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.python.pydev.pythonNature</nature>
</natures>
</projectDescription>
+17 -2
View File
@@ -1758,7 +1758,7 @@ class wizard_multi_charts_accounts(osv.osv_memory):
'company_id':fields.many2one('res.company','Company',required=True),
'chart_template_id': fields.many2one('account.chart.template','Chart Template',required=True),
'bank_accounts_id': fields.one2many('account.bank.accounts.wizard', 'bank_account_id', 'Bank Accounts',required=True),
'code_digits':fields.integer('No. of Digits for Account Code',required=True),
'code_digits':fields.integer('# of Digits',required=True,help="No. of Digits to use for account code"),
}
def action_create(self, cr, uid, ids, context=None):
@@ -1980,7 +1980,22 @@ class wizard_multi_charts_accounts(osv.osv_memory):
#create the property
property_obj.create(cr, uid, vals)
return {}
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.module.module.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
def action_cancel(self,cr,uid,ids,conect=None):
return {
'view_type': 'form',
"view_mode": 'form',
'res_model': 'ir.module.module.configuration.wizard',
'type': 'ir.actions.act_window',
'target':'new',
}
wizard_multi_charts_accounts()
+33 -15
View File
@@ -3,8 +3,8 @@
<data>
<!--
Invoices
-->
Invoices
-->
<record id="view_invoice_line_calendar" model="ir.ui.view">
<field name="name">account.invoice.calendar</field>
@@ -17,17 +17,17 @@
</calendar>
</field>
</record>
<record model="ir.ui.view" id="view_invoice_graph">
<field name="name">account.invoice.graph</field>
<field name="model">account.invoice</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Invoices" type="bar">
<field name="partner_id"/>
<field name="amount_total" operator="+"/>
</graph>
</field>
</record>
<record model="ir.ui.view" id="view_invoice_graph">
<field name="name">account.invoice.graph</field>
<field name="model">account.invoice</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Invoices" type="bar">
<field name="partner_id"/>
<field name="amount_total" operator="+"/>
</graph>
</field>
</record>
<record id="view_invoice_line_tree" model="ir.ui.view">
<field name="name">account.invoice.line.tree</field>
<field name="model">account.invoice.line</field>
@@ -209,7 +209,16 @@
<field colspan="4" name="comment" nolabel="1"/>
</page>
<page string="Payments">
<field name="move_lines" colspan="4"/>
<field name="payment_ids" colspan="4" nolabel="1">
<tree string="Payments">
<field name="date"/>
<field name="ref"/>
<field name="name"/>
<field name="journal_id"/>
<field name="debit"/>
<field name="credit"/>
</tree>
</field>
</page>
</notebook>
</form>
@@ -283,7 +292,16 @@
<field colspan="4" name="comment" nolabel="1"/>
</page>
<page string="Payments">
<field name="move_lines" colspan="4" nolabel="1"/>
<field name="payment_ids" colspan="4" nolabel="1">
<tree string="Payments">
<field name="date"/>
<field name="ref"/>
<field name="name"/>
<field name="journal_id"/>
<field name="debit"/>
<field name="credit"/>
</tree>
</field>
</page>
</notebook>
</form>
+15 -12
View File
@@ -1336,7 +1336,7 @@
<field name="date2"/>
<separator string="" colspan="4"/>
<label string="" colspan="2"/>
<group col="4" colspan="4">
<group col="2" colspan="2">
<button icon="gtk-cancel" special="cancel" string="Don't Create" name="action_cancel" type="object"/>
<button icon="gtk-ok" name="action_create" string="Create" type="object"/>
</group>
@@ -1525,13 +1525,13 @@
</field>
</record>
<record id="action_account_tax_template_form" model="ir.actions.act_window">
<field name="name">Account Tax Templates</field>
<field name="name">Tax Templates</field>
<field name="res_model">account.tax.template</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem action="action_account_tax_template_form" id="menu_action_account_tax_template_form" parent="next_id_27"/>
<menuitem action="action_account_tax_template_form" id="menu_action_account_tax_template_form" parent="next_id_27" sequence="13"/>
<!-- Account Tax Code Templates -->
<record id="view_tax_code_template_tree" model="ir.ui.view">
@@ -1565,26 +1565,27 @@
</record>
<record id="action_account_tax_code_template_form" model="ir.actions.act_window">
<field name="name">Account Tax Code Templates</field>
<field name="name">Tax Code Templates</field>
<field name="res_model">account.tax.code.template</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem action="action_account_tax_code_template_form" id="menu_action_account_tax_code_template_form" parent="next_id_27"/>
<menuitem action="action_account_tax_code_template_form" id="menu_action_account_tax_code_template_form" parent="next_id_27" sequence="14"/>
<!-- Wizard for Multi Charts of Accounts -->
<record id="view_wizard_multi_chart" model="ir.ui.view">
<field name="name">Create Multiple Charts of Accounts</field>
<field name="name">Generate Chart of Accounts from a Chart Template</field>
<field name="model">wizard.multi.charts.accounts</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Create Multiple Charts of Accounts">
<form string="Generate Chart of Accounts from a Chart Template">
<separator col="4" colspan="4" string="Generate Chart of Accounts from a Chart Template"/>
<field name="company_id" />
<field name="chart_template_id" />
<field name ="code_digits" />
<field colspan="4" mode="tree" name="bank_accounts_id" nolabel="1" widget="one2many_list">
<field name ="code_digits" />
<field name="chart_template_id" colspan="4"/>
<field colspan="4" mode="tree" name="bank_accounts_id" nolabel="1" widget="one2many_list">
<form string="Bank Information">
<field name="acc_no"/>
<field name="currency_id"/>
@@ -1594,8 +1595,10 @@
<field name="currency_id"/>
</tree>
</field>
<group col="4" colspan="4">
<button icon="gtk-cancel" special="cancel" type="object" string="Cancel"/>
<separator string="" colspan="4"/>
<label string="" colspan="2"/>
<group col="2" colspan="2">
<button icon="gtk-cancel" special="cancel" type="object" name="action_cancel" string="Cancel"/>
<button icon="gtk-ok" name="action_create" string="Create" type="object"/>
</group>
</form>
+21 -1
View File
@@ -126,6 +126,26 @@ class account_invoice(osv.osv):
l = map(lambda x: x.id, ids_line)
res[id]=[x for x in l if x <> line.id]
return res
def _compute_lines(self, cr, uid, ids, name, args, context={}):
result = {}
print 'ICI 0'
for invoice in self.browse(cr, uid, ids, context):
moves = self.move_line_id_payment_get(cr, uid, [invoice.id])
src = []
print 'ICI 1'
lines = []
for m in self.pool.get('account.move.line').browse(cr, uid, moves, context):
print 'ICI 2'
if m.reconcile_id:
lines += map(lambda x: x.id, m.reconcile_id.line_id)
elif m.reconcile_partial_id:
lines += map(lambda x: x.id, m.reconcile_partial_id.line_partial_ids)
src.append(m.id)
print 'ICI 3'
lines = filter(lambda x: x not in src, lines)
result[invoice.id] = lines
return result
_name = "account.invoice"
_description = 'Invoice'
@@ -182,7 +202,7 @@ class account_invoice(osv.osv):
help='The bank account to pay to or to be paid from'),
'move_lines':fields.function(_get_lines , method=True,type='many2many' , relation='account.move.line',string='Move Lines'),
'residual': fields.function(_amount_residual, method=True, digits=(16,2),string='Residual', store=True),
'payment_ids': fields.function(_compute_lines, method=True, relation='account.move.line', type="many2many", string='Payments'),
}
_defaults = {
'type': _get_type,
+4 -4
View File
@@ -9,8 +9,8 @@
<field name="arch" type="xml">
<notebook position="inside">
<page string="Accounting">
<separator string="Sales" colspan="2"/>
<separator string="Purchases" colspan="2"/>
<separator string="Sales Properties" colspan="2"/>
<separator string="Purchases Properties" colspan="2"/>
<field name="property_account_income"/>
<field name="property_account_expense"/>
@@ -31,8 +31,8 @@
<field name="arch" type="xml">
<notebook position="inside">
<page string="Accounting">
<separator string="Sales" colspan="2"/>
<separator string="Purchases" colspan="2"/>
<separator string="Sales Properties" colspan="2"/>
<separator string="Purchases Properties" colspan="2"/>
<field name="property_account_income"/>
<field name="property_account_expense"/>
<field name="supplier_taxes_id"/>
@@ -69,7 +69,8 @@ class wizard_account_chart(wizard.interface):
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
result = act_obj.read(cr, uid, [id])[0]
result['context'] = str({'fiscalyear': data['form']['fiscalyear'],'target_move':data['form']['target_move']})
result['name']+=':'+pooler.get_pool(cr.dbname).get('account.fiscalyear').read(cr,uid,[data['form']['fiscalyear']])[0]['code']
if data['form']['fiscalyear']:
result['name']+=':'+pooler.get_pool(cr.dbname).get('account.fiscalyear').read(cr,uid,[data['form']['fiscalyear']])[0]['code']
return result
states = {
@@ -147,7 +147,7 @@ class PopulateStatementFromInv(wizard.interface):
'fields':START_FIELD,
'state': [
('end', '_Cancel'),
('customer', 'C_ustomer invoices', '', True),
('customer', '_Customer invoices', '', True),
('supplier', '_Supplier invoices', '', True)
]
},
+46 -37
View File
@@ -39,45 +39,54 @@ class account_move_line(osv.osv):
_description = "Entry lines"
def _query_get(self, cr, uid, obj='l', context={}):
if not 'fiscalyear' in context:
context['fiscalyear'] = self.pool.get('account.fiscalyear').find(cr, uid, exception=False)
strQuery = ""
if context.get('periods', False):
ids = ','.join([str(x) for x in context['periods']])
if not 'period_manner' in context:
strQuery = obj+".active AND "+obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id=%d)" % (context['fiscalyear'],)
else:
if context['period_manner']=='actual':
strQuery = obj+".active AND "+obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id=%d AND id in (%s))" % (context['fiscalyear'], ids)
else:
# p_id="in (SELECT id from account_period WHERE fiscalyear_id=%d AND id in (%s)))" % (context['fiscalyear'], ids)
strQuery = obj+".active AND "+obj+".state<>'draft' AND("
p_id=self.pool.get('account.period').search(cr,uid,[('fiscalyear_id','=',context['fiscalyear']),('id','in',context['periods'])])
periods = self.pool.get('account.period').read(cr,uid,p_id,['date_start','date_stop'])
count=1
len_periods=len(p_id)
for period in periods:
strQuery += "("+obj+".create_date between to_date('" + period['date_start'] + "','yyyy-mm-dd') and to_date('" + period['date_stop'] + "','yyyy-mm-dd'))"
if len_periods!=1 and count!=len_periods:
strQuery+=" OR "
count=count+1
if p_id==[]:
strQuery+=obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id=%d))" % (context['fiscalyear'],)
query = super(account_move_line, self)._query_get(cr, uid, obj, context)
if 'period_manner' in context:
if context['period_manner'] == 'created':
if 'periods' in context:
#the query have to be build with no reference to periods but thanks to the creation date
if context['periods']:
#if one or more period are given, use them
p_ids = self.pool.get('account.period').search(cr,uid,[('id','in',context['periods'])])
else:
strQuery+=")"
else:
strQuery = obj+".active AND "+obj+".state<>'draft' AND "+obj+".period_id in (SELECT id from account_period WHERE fiscalyear_id=%d)" % (context['fiscalyear'],)
#else we have to consider all the periods of the selected fiscal year(s)
fiscalyear_obj = self.pool.get('account.fiscalyear')
if not context.get('fiscalyear', False):
return strQuery
#if there is no fiscal year, take all the fiscal years
fiscalyear_ids = fiscalyear_obj.search(cr, uid, [('state', '=', 'draft')])
else:
fiscalyear_ids = [context['fiscalyear']]
p_ids = self.pool.get('account.period').search(cr,uid,[('fiscalyear_id','in',fiscalyear_ids)])
if p_ids == []:
return query
#remove from the old query the clause related to the period selection
res = ''
count = 1
clause_list = query.split('AND')
ref_string = ' '+obj+'.period_id in'
for clause in clause_list:
if count != 1 and not clause.startswith(ref_string):
res += "AND"
if not clause.startswith(ref_string):
res += clause
count += 1
#add to 'res' a new clause containing the creation date criterion
count = 1
res += " AND ("
periods = self.pool.get('account.period').read(cr,uid,p_ids,['date_start','date_stop'])
for period in periods:
if count != 1:
res += " OR "
#creation date criterion: the creation date of the move_line has to be
# between the date_start and the date_stop of the selected periods
res += "("+obj+".create_date between to_date('" + period['date_start'] + "','yyyy-mm-dd') and to_date('" + period['date_stop'] + "','yyyy-mm-dd'))"
count += 1
res += ")"
return res
return query
account_move_line()
@@ -396,7 +396,7 @@ class account_balance(report_sxw.rml_parse):
ctx['fiscalyear'] = id
ctx['periods'] = form['periods'][0][2]
ctx['period_manner']=form['select_periods']
ctx['period_manner']=form['period_manner']
tmp = self.pool.get('account.account').browse(self.cr, self.uid, ids, ctx.copy())
if len(tmp):
@@ -454,7 +454,7 @@ class account_balance(report_sxw.rml_parse):
ctx['fiscalyear'] = id
ctx['periods'] = form['periods'][0][2]
ctx['period_manner']=form['select_periods']
ctx['period_manner']=form['period_manner']
tmp1 = self.pool.get('account.account').browse(self.cr, self.uid, ids,ctx.copy())
@@ -55,7 +55,7 @@ dates_form = '''<?xml version="1.0"?>
</page>
<page string="Select Period">
<field name="select_periods" colspan="4"/>
<field name="period_manner" colspan="4"/>
<separator string="Select Period(s)" colspan="4"/>
<field name="periods" colspan="4" nolabel="1"/>
</page>
@@ -70,18 +70,18 @@ dates_fields = {
'landscape': {'string': 'Show Report in Landscape Form', 'type': 'boolean'},
'format_perc': {'string': 'Show Comparision in %', 'type': 'boolean'},
'compare_pattern':{'string':"Compare Selected Years In Terms Of",'type':'selection','selection':[('bal_cash','Cash'),('bal_perc','Percentage'),('none','Don'+ "'" +'t Compare')]},
'select_periods':{'string':"Select Invoices Based on Their",'type':'selection','selection':[('actual','Actual Period (Duration)'),('created','Creation Date')]},
'period_manner':{'string':"Entries Selection Based on",'type':'selection','selection':[('actual','Financial Period'),('created','Creation Date')]},
'periods': {'string': 'Periods', 'type': 'many2many', 'relation': 'account.period', 'help': 'All periods if empty'}
}
back_form='''<?xml version="1.0"?>
<form string="Notification">
<separator string="You might have done following mistakes.Please correct them and try again." colspan="4"/>
<separator string="You might have done following mistakes. Please correct them and try again." colspan="4"/>
<separator string="1. You have selected more than 3 years in any case." colspan="4"/>
<separator string="2. You have not selected 'Percentage' option,but you have selected more than 2 years." colspan="4"/>
<label string="You can select maximum 3 years.Please check again." colspan="4"/>
<separator string="3. You have selected 'Percentage' option with more than 2 years,but you have not selected landscape format." colspan="4"/>
<label string="You have to select 'Landscape' option.Please Check it." colspan="4"/>
<separator string="2. You have not selected 'Percentage' option, but you have selected more than 2 years." colspan="4"/>
<label string="You can select maximum 3 years. Please check again." colspan="4"/>
<separator string="3. You have selected 'Percentage' option with more than 2 years, but you have not selected landscape format." colspan="4"/>
<label string="You have to select 'Landscape' option. Please Check it." colspan="4"/>
</form>'''
back_fields={
@@ -146,7 +146,7 @@ class wizard_report(wizard.interface):
# data['form']['periods']=p_ids
data['form']['compare_pattern']='none'
data['form']['account_choice']='moves'
data['form']['select_periods']='actual'
data['form']['period_manner']='actual'
return data['form']
+7 -5
View File
@@ -104,11 +104,13 @@ class account_move_line(osv.osv):
line2bank[line.id] = line.invoice.partner_bank.id
elif line.partner_id:
if not line.partner_id.bank_ids:
raise osv.except_osv(_('Error !'), _('Partner '+ line.partner_id.name+ ' has no bank account defined'))
for bank in line.partner_id.bank_ids:
if bank.state in bank_type:
line2bank[line.id] = bank.id
break
#raise osv.except_osv(_('Error !'), _('Partner '+ line.partner_id.name+ ' has no bank account defined'))
line2bank[line.id] = False
else:
for bank in line.partner_id.bank_ids:
if bank.state in bank_type:
line2bank[line.id] = bank.id
break
if line.id not in line2bank and line.partner_id.bank_ids:
line2bank[line.id] = line.partner_id.bank_ids[0].id
else:
+1 -1
View File
@@ -97,7 +97,7 @@
<field name="currency" nolabel="1"/>
</group>
<field name="partner_id" on_change="onchange_partner(partner_id,parent.mode)" select="1"/>
<field domain="[('partner_id','=',partner_id)]" name="bank_id" required="1"/>
<field domain="[('partner_id','=',partner_id)]" name="bank_id"/>
<separator colspan="2" string="Owner Account"/>
<separator colspan="2" string="Desitination Account"/>
<field colspan="2" name="info_owner" nolabel="1"/>
@@ -75,7 +75,7 @@ def search_entries(self, cr, uid, data, context):
<field name="entries" colspan="4" height="300" width="800" nolabel="1"
domain="[('id', 'in', [%s])]" %s/>
</form>''' % (','.join([str(x) for x in line_ids]), ctx)
return {'entries': line_ids}
return {}
def create_payment(self, cr, uid, data, context):
line_ids= data['form']['entries'][0][2]
@@ -88,7 +88,7 @@ def create_payment(self, cr, uid, data, context):
payment = order_obj.browse(cr, uid, data['id'],
context=context)
t = payment.mode and payment.mode.type.id or None
line2bank= pool.get('account.move.line').line2bank(cr, uid,
line2bank = pool.get('account.move.line').line2bank(cr, uid,
line_ids, t, context)
## Finally populate the current payment with new lines:
@@ -0,0 +1,4 @@
# -*- encoding: utf-8 -*-
import analytic_journal_billing_rate
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,25 @@
# -*- encoding: utf-8 -*-
{
"name" : "Analytic Journal Billing Rate",
"version" : "1.0",
"depends" : ["analytic_user_function", "account", "hr_timesheet_invoice"],
"author" : "Tiny",
"description": """
This module allows you to define what is the defaut invoicing rate for a specific journal on a given account. This is mostly used when a user encode his timesheet: the values are retrieved and the fields are auto-filled... but the possibility to change these values is still available.
Obviously if no data has been recorded for the current account, the default value is given as usual by the account data so that this module is perfectly compatible with older configurations.
""",
"website" : "http://tinyerp.com/",
"category" : "Generic Modules/Others",
"init_xml" : [],
"demo_xml" : [],
"update_xml" : [
"analytic_journal_billing_rate_view.xml",
],
"active": False,
"installable": True
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,103 @@
# -*- encoding: utf-8 -*-
from osv import fields,osv
from osv import orm
class analytic_journal_rate_grid(osv.osv):
_name="analytic_journal_rate_grid"
_description= "Relation table between journals and billing rates"
_columns={
'journal_id': fields.many2one('account.analytic.journal', 'Analytic Journal',required=True,),
'account_id': fields.many2one("account.analytic.account", "Analytic Account",required=True,),
'rate_id': fields.many2one("hr_timesheet_invoice.factor", "Invoicing Rate",),
}
analytic_journal_rate_grid()
class account_analytic_account(osv.osv):
_inherit = "account.analytic.account"
_columns = {
'journal_rate_ids' : fields.one2many('analytic_journal_rate_grid', 'account_id', 'Invoicing Rate per Journal'),
}
account_analytic_account()
class hr_analytic_timesheet(osv.osv):
_inherit = "hr.analytic.timesheet"
def on_change_account_id(self, cr, uid, ids,user_id, account_id, journal_id,unit_amount=0):
res = {}
if not (account_id):
#avoid a useless call to super
return res
if not (journal_id):
return super(hr_analytic_timesheet, self).on_change_account_id(cr, uid, ids,user_id, account_id, unit_amount)
#get the browse record related to journal_id and account_id
temp = self.pool.get('analytic_journal_rate_grid').search(cr, uid, [('journal_id', '=', journal_id),('account_id', '=', account_id) ])
if not temp:
#if there isn't any record for this journal_id and account_id
return super(hr_analytic_timesheet, self).on_change_account_id(cr, uid, ids,user_id, account_id, unit_amount)
else:
#get the old values from super and add the value from the new relation analytic_journal_rate_grid
r = self.pool.get('analytic_journal_rate_grid').browse(cr, uid, temp)[0]
res.setdefault('value',{})
res['value']= super(hr_analytic_timesheet, self).on_change_account_id(cr, uid, ids,user_id, account_id,unit_amount)['value']
if r.rate_id.id:
res['value']['to_invoice'] = r.rate_id.id
return res
def on_change_journal_id(self, cr, uid, ids,journal_id, account_id):
res = {}
if not (journal_id and account_id):
return res
#get the browse record related to journal_id and account_id
temp = self.pool.get('analytic_journal_rate_grid').search(cr, uid, [('journal_id', '=', journal_id),('account_id', '=', account_id) ])
if temp:
#add the value from the new relation analytic_user_funct_grid
r = self.pool.get('analytic_journal_rate_grid').browse(cr, uid, temp)[0]
res.setdefault('value',{})
if r.rate_id.id:
res['value']['to_invoice'] = r.rate_id.id
return res
to_invoice = self.pool.get('account.analytic.account').read(cr, uid, [account_id], ['to_invoice'])[0]['to_invoice']
if to_invoice:
res.setdefault('value',{})
res['value']['to_invoice'] = to_invoice[0]
return res
hr_analytic_timesheet()
class account_invoice(osv.osv):
_inherit = "account.invoice"
def _get_analityc_lines(self, cr, uid, id):
iml = super(account_invoice, self)._get_analityc_lines(cr, uid, id)
inv = self.browse(cr, uid, [id])[0]
for il in iml:
if il['account_analytic_id']:
#get the browse record related to journal_id and account_id
journal_id = il['analytic_lines'][0][2]['journal_id']
account_id = il['analytic_lines'][0][2]['account_id']
if journal_id and account_id:
temp = self.pool.get('analytic_journal_rate_grid').search(cr, uid, [('journal_id', '=', journal_id),('account_id', '=', account_id) ])
if temp:
r = self.pool.get('analytic_journal_rate_grid').browse(cr, uid, temp)[0]
il['analytic_lines'][0][2]['to_invoice'] = r.rate_id.id
return iml
account_invoice()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,83 @@
<?xml version="1.0" ?>
<openerp>
<data>
<!-- analytic_journal_rate_grid views -->
<record model="ir.ui.view" id="analytic_journal_rate_grid_tree">
<field name="name">analytic_journal_rate_grid.tree</field>
<field name="model">analytic_journal_rate_grid</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Billing Rate per Journal for this Analytic Account" editable="bottom">
<field name="journal_id" required="1"/>
<field name="rate_id" />
</tree>
</field>
</record>
<record model="ir.ui.view" id="analytic_journal_rate_grid_form">
<field name="name">analytic_journal_rate_grid.form</field>
<field name="model">analytic_journal_rate_grid</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Billing Rate per Journal for this Analytic Account" editable="bottom">
<field name="journal_id" required="1"/>
<field name="rate_id" />
</form>
</field>
</record>
<!-- account.analytic.account inherited view -->
<record model="ir.ui.view" id="view_account_analytic_account_form_inherit">
<field name="name">account.analytic.account.form</field>
<field name="model">account.analytic.account</field>
<field name="type">form</field>
<field name="inherit_id" ref="account.view_account_analytic_account_form"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='to_invoice']" position="after">
<!--<field name="to_invoice" string="Default Invoicing Percentage"/>-->
<field name="journal_rate_ids" colspan="4"/>
</xpath>
</field>
</record>
<!-- hr_timesheet_sheet.sheet inherited view -->
<record model="ir.ui.view" id="hr_timesheet_sheet_form_inherit">
<field name="name">hr.timesheet.sheet.form</field>
<field name="model">hr_timesheet_sheet.sheet</field>
<field name="type">form</field>
<field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='timesheet_ids']/tree/field[@name='account_id']" position="replace">
<field name="account_id" domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" on_change="on_change_account_id(user_id, account_id, journal_id, unit_amount)"/>
</xpath>
</field>
</record>
<!-- hr.analytic.timesheet inherited views -->
<record model="ir.ui.view" id="hr_timesheet_line_form_inherit">
<field name="name">hr.analytic.timesheet.form</field>
<field name="model">hr.analytic.timesheet</field>
<field name="type">form</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
<field name="arch" type="xml">
<xpath expr="/form/field[@name='account_id']" position="replace">
<field name="account_id" domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" on_change="on_change_account_id(user_id, account_id, journal_id, unit_amount)" select="1"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="hr_timesheet_line_form_inherit_2">
<field name="name">hr.analytic.timesheet.form</field>
<field name="model">hr.analytic.timesheet</field>
<field name="type">form</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
<field name="arch" type="xml">
<xpath expr="/form/field[@name='journal_id']" position="replace">
<field name="journal_id" select="1" required="1" on_change="on_change_journal_id(journal_id, account_id)"/>
</xpath>
</field>
</record>
</data>
</openerp>
@@ -0,0 +1,5 @@
# -*- encoding: utf-8 -*-
import analytic_user_function
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+25
View File
@@ -0,0 +1,25 @@
# -*- encoding: utf-8 -*-
{
"name" : "Analytic User Function",
"version" : "1.0",
"depends" : ["hr_timesheet_sheet"],
"author" : "Tiny",
"description": """
This module allows you to define what is the defaut function of a specific user on a given account. This is mostly used when a user encode his timesheet: the values are retrieved and the fields are auto-filled... but the possibility to change these values is still available.
Obviously if no data has been recorded for the current account, the default value is given as usual by the employee data so that this module is perfectly compatible with older configurations.
""",
"website" : "http://tinyerp.com/",
"category" : "Generic Modules/Others",
"init_xml" : [],
"demo_xml" : [],
"update_xml" : [
"analytic_user_function_view.xml",
],
"active": False,
"installable": True
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,123 @@
# -*- encoding: utf-8 -*-
from osv import fields,osv
from osv import orm
class analytic_user_funct_grid(osv.osv):
_name="analytic_user_funct_grid"
_description= "Relation table between users and products on a analytic account"
_columns={
'user_id': fields.many2one("res.users","User",required=True,),
'product_id': fields.many2one("product.product","Product",required=True,),
'account_id': fields.many2one("account.analytic.account", "Analytic Account",required=True,),
}
analytic_user_funct_grid()
class account_analytic_account(osv.osv):
_inherit = "account.analytic.account"
_columns = {
'user_product_ids' : fields.one2many('analytic_user_funct_grid', 'account_id', 'Users/Products Rel.'),
}
account_analytic_account()
class hr_analytic_timesheet(osv.osv):
_inherit = "hr.analytic.timesheet"
# Look in account, if no value for the user => look in parent until there is no more parent to look
# Take the first found... if nothing found => return False
def _get_related_user_account_recursiv(self,cr,uid,user_id,account_id):
temp=self.pool.get('analytic_user_funct_grid').search(cr, uid, [('user_id', '=', user_id),('account_id', '=', account_id) ])
account=self.pool.get('account.analytic.account').browse(cr,uid,account_id)
if temp:
return temp
else:
if account.parent_id:
return self._get_related_user_account_recursiv(cr,uid,user_id,account.parent_id.id)
else:
return False
def on_change_account_id(self, cr, uid, ids,user_id, account_id, unit_amount=0):
#{'value': {'to_invoice': False, 'amount': (-162.0,), 'product_id': 7, 'general_account_id': (5,)}}
res = {}
if not (account_id):
#avoid a useless call to super
return res
if not (user_id):
return super(hr_analytic_timesheet, self).on_change_account_id(cr, uid, ids,account_id)
#get the browse record related to user_id and account_id
temp = self._get_related_user_account_recursiv(cr,uid,user_id,account_id)
# temp = self.pool.get('analytic_user_funct_grid').search(cr, uid, [('user_id', '=', user_id),('account_id', '=', account_id) ])
if not temp:
#if there isn't any record for this user_id and account_id
return super(hr_analytic_timesheet, self).on_change_account_id(cr, uid, ids,account_id)
else:
#get the old values from super and add the value from the new relation analytic_user_funct_grid
r = self.pool.get('analytic_user_funct_grid').browse(cr, uid, temp)[0]
res.setdefault('value',{})
res['value']= super(hr_analytic_timesheet, self).on_change_account_id(cr, uid, ids,account_id)['value']
res['value']['product_id'] = r.product_id.id
res['value']['product_uom_id'] = r.product_id.product_tmpl_id.uom_id.id
#the change of product has to impact the amount, uom and general_account_id
a = r.product_id.product_tmpl_id.property_account_expense.id
if not a:
a = r.product_id.categ_id.property_account_expense_categ.id
if not a:
raise osv.except_osv('Error !',
'There is no expense account define ' \
'for this product: "%s" (id:%d)' % \
(r.product_id.name, r.product_id.id,))
amount = unit_amount * r.product_id.uom_id._compute_price(cr, uid,
r.product_id.uom_id.id, r.product_id.standard_price, False)
res ['value']['amount']= - round(amount, 2)
res ['value']['general_account_id']= a
return res
def on_change_user_id(self, cr, uid, ids,user_id, account_id, unit_amount=0):
res = {}
if not (user_id):
#avoid a useless call to super
return res
#get the old values from super
res = super(hr_analytic_timesheet, self).on_change_user_id(cr, uid, ids,user_id)
if account_id:
#get the browse record related to user_id and account_id
# temp = self.pool.get('analytic_user_funct_grid').search(cr, uid, [('user_id', '=', user_id),('account_id', '=', account_id) ])
temp = self._get_related_user_account_recursiv(cr,uid,user_id,account_id)
if temp:
#add the value from the new relation analytic_user_funct_grid
r = self.pool.get('analytic_user_funct_grid').browse(cr, uid, temp)[0]
res['value']['product_id'] = r.product_id.id
#the change of product has to impact the amount, uom and general_account_id
a = r.product_id.product_tmpl_id.property_account_expense.id
if not a:
a = r.product_id.categ_id.property_account_expense_categ.id
if not a:
raise osv.except_osv('Error !',
'There is no expense account define ' \
'for this product: "%s" (id:%d)' % \
(r.product_id.name, r.product_id.id,))
amount = unit_amount * r.product_id.uom_id._compute_price(cr, uid,
r.product_id.uom_id.id, r.product_id.standard_price, False)
res ['value']['amount']= - round(amount, 2)
res ['value']['general_account_id']= a
return res
hr_analytic_timesheet()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,109 @@
<?xml version="1.0" ?>
<openerp>
<data>
<!-- analytic_user_funct_grid views -->
<record model="ir.ui.view" id="analytic_user_funct_grid_tree">
<field name="name">analytic_user_funct_grid.tree</field>
<field name="model">analytic_user_funct_grid</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="User's Product for this Analytic Account" editable="bottom">
<field name="user_id" required="1"/>
<field name="product_id" required="1" />
</tree>
</field>
</record>
<record model="ir.ui.view" id="analytic_user_funct_grid_form">
<field name="name">analytic_user_funct_grid.form</field>
<field name="model">analytic_user_funct_grid</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="User's Product for this Analytic Account">
<field name="user_id" required="1"/>
<field name="product_id" required="1"/>
</form>
</field>
</record>
<!-- account.analytic.account inherited view -->
<record model="ir.ui.view" id="view_account_analytic_account_form_inherit">
<field name="name">account.analytic.account.form</field>
<field name="model">account.analytic.account</field>
<field name="type">form</field>
<field name="inherit_id" ref="account.view_account_analytic_account_form"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page" position="after">
<page string="Users/Products Rel.">
<field name="user_product_ids" colspan="4" nolabel="1"/>
</page>
</xpath>
</field>
</record>
<!-- hr_timesheet_sheet.sheet inherited view -->
<record model="ir.ui.view" id="hr_timesheet_sheet_form_inherit">
<field name="name">hr.timesheet.sheet.form</field>
<field name="model">hr_timesheet_sheet.sheet</field>
<field name="type">form</field>
<field name="priority" eval="18"/>
<field name="inherit_id" ref="hr_timesheet_sheet.hr_timesheet_sheet_form"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page/field[@name='timesheet_ids']/tree/field[@name='account_id']" position="replace">
<field name="account_id" domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" on_change="on_change_account_id(user_id, account_id, unit_amount)"/>
</xpath>
</field>
</record>
<!-- hr.analytic.timesheet inherited views -->
<record model="ir.ui.view" id="hr_timesheet_line_form_inherit">
<field name="name">hr.analytic.timesheet.form</field>
<field name="model">hr.analytic.timesheet</field>
<field name="type">form</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
<field name="arch" type="xml">
<xpath expr="/form/field[@name='account_id']" position="replace">
<field name="account_id" domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" on_change="on_change_account_id(user_id, account_id, unit_amount)" select="1"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="hr_timesheet_line_form_inherit_2">
<field name="name">hr.analytic.timesheet.form</field>
<field name="model">hr.analytic.timesheet</field>
<field name="type">form</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_form"/>
<field name="arch" type="xml">
<xpath expr="/form/field[@name='user_id']" position="replace">
<field name="user_id" select="1" required="1" on_change="on_change_user_id(user_id, account_id, unit_amount)"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="hr_timesheet_line_tree_inherit">
<field name="name">hr.analytic.timesheet.tree</field>
<field name="model">hr.analytic.timesheet</field>
<field name="type">tree</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
<field name="arch" type="xml">
<xpath expr="/tree/field[@name='account_id']" position="replace">
<field name="account_id" domain="[('type','=','normal'),('state', '&lt;&gt;', 'close')]" on_change="on_change_account_id(user_id, account_id, unit_amount)" select="1"/>
</xpath>
</field>
</record>
<record model="ir.ui.view" id="hr_timesheet_line_tree_inherit_2">
<field name="name">hr.analytic.timesheet.tree</field>
<field name="model">hr.analytic.timesheet</field>
<field name="type">tree</field>
<field name="inherit_id" ref="hr_timesheet.hr_timesheet_line_tree"/>
<field name="arch" type="xml">
<xpath expr="/tree/field[@name='user_id']" position="replace">
<field name="user_id" select="1" required="1" on_change="on_change_user_id(user_id, account_id, unit_amount)"/>
</xpath>
</field>
</record>
</data>
</openerp>
+2 -2
View File
@@ -8,8 +8,8 @@
"description": """Simplification of the interface for associations.""",
"depends" : ["hr","crm_configuration","event"],
"init_xml" : [],
"demo_xml" : ["crm_fund_data.xml"],
"update_xml" : ["crm_fund_demo.xml",
"demo_xml" : [],
"update_xml" : [
"aso_data.xml",
"aso_vertical_view.xml",
],
+5
View File
@@ -0,0 +1,5 @@
# -*- encoding: utf-8 -*-
import audittrail
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+20
View File
@@ -0,0 +1,20 @@
# -*- encoding: utf-8 -*-
#
# you must set the depends variable on modules you plan to audit !
#
{
"name" : "Audit Trail",
"version" : "1.0",
"depends" : ["base","account","purchase","mrp"],
"website" : "http://tinyerp.com",
"author" : "Tiny",
"init_xml" : [],
"description": "Allows the administrator to track every user operations on all objects of the system.",
"category" : "Generic Modules/Others",
"update_xml" : ["audittrail_view.xml"],
"demo_xml" : ["audittrail_demo.xml"],
"active" : False,
"installable": True
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+281
View File
@@ -0,0 +1,281 @@
# -*- encoding: utf-8 -*-
from osv import osv, fields
import time, pooler, copy
import ir
class audittrail_rule(osv.osv):
_name = 'audittrail.rule'
_columns = {
"name": fields.char("Rule Name", size=32, required=True),
"object_id": fields.many2one('ir.model', 'Object', required=True),
"user_id": fields.many2many('res.users', 'audittail_rules_users', 'user_id', 'rule_id', 'Users'),
"log_read": fields.boolean("Log reads"),
"log_write": fields.boolean("Log writes"),
"log_unlink": fields.boolean("Log deletes"),
"log_create": fields.boolean("Log creates"),
"state": fields.selection((("draft", "Draft"),("subscribed", "Subscribed")), "State", required=True),
"action_id":fields.many2one('ir.actions.act_window',"Action ID"),
}
_defaults = {
'state': lambda *a: 'draft',
'log_create': lambda *a: 1,
'log_unlink': lambda *a: 1,
'log_write': lambda *a: 1,
}
_sql_constraints = [
('model_uniq', 'unique (object_id)', """There is a rule defined on this object\n You can not define other on the same!""")
]
__functions = {}
def __init__(self,pool,cr=None):
for obj_name in pool.obj_list():
obj=pool.get(obj_name)
for field in ('read','write','create','unlink'):
setattr(obj, field, self.logging_fct(getattr(obj,field), obj))
super(audittrail_rule, self).__init__(pool,cr)
def subscribe(self, cr, uid, ids, *args):
for thisrule in self.browse(cr, uid, ids):
obj = self.pool.get(thisrule.object_id.model)
if not obj:
raise osv.except_osv(
'WARNING:audittrail is not part of the pool',
'Change audittrail depends -- Setting rule as DRAFT')
self.write(cr, uid, [thisrule.id], {"state": "draft"})
val={
"name":'View Log',
"res_model":'audittrail.log',
"src_model":thisrule.object_id.model,
"domain":"[('res_id', '=', active_id)]"
}
id=self.pool.get('ir.actions.act_window').create(cr, uid, val)
self.write(cr, uid, ids, {"state": "subscribed","action_id":id})
keyword = 'client_action_relate'
value = 'ir.actions.act_window,'+str(id)
res=self.pool.get('ir.model.data').ir_set(cr, uid, 'action', keyword,'View_log_'+thisrule.object_id.model, [thisrule.object_id.model], value, replace=True, isobject=True, xml_id=False)
return True
def logging_fct(self, fct_src, obj):
object_name=obj._name
object=None
logged_uids = []
def get_value_text(cr, uid, field_name,values,object, context={}):
f_id= self.pool.get('ir.model.fields').search(cr, uid,[('name','=',field_name),('model_id','=',object.id)])
if f_id:
field=self.pool.get('ir.model.fields').read(cr, uid,f_id)[0]
model=field['relation']
if field['ttype']=='many2one':
if values:
if type(values)==tuple:
values=values[0]
val=self.pool.get(model).read(cr,uid,[values],['name'])
if len(val):
return val[0]['name']
elif field['ttype'] == 'many2many':
value=[]
if values:
for id in values:
val=self.pool.get(model).read(cr,uid,[id],['name'])
if len(val):
value.append(val[0]['name'])
return value
elif field['ttype'] == 'one2many':
if values:
value=[]
for id in values:
val=self.pool.get(model).read(cr,uid,[id],['name'])
if len(val):
value.append(val[0]['name'])
return value
return values
def create_log_line(cr,uid,id,object,lines=[]):
for line in lines:
f_id= self.pool.get('ir.model.fields').search(cr, uid,[('name','=',line['name']),('model_id','=',object.id)])
if len(f_id):
fields=self.pool.get('ir.model.fields').read(cr, uid,f_id)
old_value='old_value' in line and line['old_value'] or ''
new_value='new_value' in line and line['new_value'] or ''
old_value_text='old_value_text' in line and line['old_value_text'] or ''
new_value_text='new_value_text' in line and line['new_value_text'] or ''
if fields[0]['ttype']== 'many2one':
if type(old_value)==tuple:
old_value=old_value[0]
if type(new_value)==tuple:
new_value=new_value[0]
self.pool.get('audittrail.log.line').create(cr, uid, {"log_id": id, "field_id": f_id[0] ,"old_value":old_value ,"new_value":new_value,"old_value_text":old_value_text ,"new_value_text":new_value_text,"field_description":fields[0]['field_description']})
return True
def my_fct( cr, uid, *args, **args2):
obj_ids= self.pool.get('ir.model').search(cr, uid,[('model','=',object_name)])
if not len(obj_ids):
return fct_src(cr, uid, *args, **args2)
object=self.pool.get('ir.model').browse(cr,uid,obj_ids)[0]
rule_ids=self.search(cr, uid, [('object_id','=',obj_ids[0]),('state','=','subscribed')])
if not len(rule_ids):
return fct_src(cr, uid, *args, **args2)
field=fct_src.__name__
for thisrule in self.browse(cr, uid, rule_ids):
if not getattr(thisrule, 'log_'+field):
return fct_src(cr, uid, *args, **args2)
self.__functions.setdefault(thisrule.id, [])
self.__functions[thisrule.id].append( (obj,field, getattr(obj,field)) )
for user in thisrule.user_id:
logged_uids.append(user.id)
if fct_src.__name__ in ('create'):
res_id =fct_src( cr, uid, *args, **args2)
new_value=self.pool.get(object.model).read(cr,uid,[res_id],args[0].keys())[0]
if 'id' in new_value:
del new_value['id']
if not len(logged_uids) or uid in logged_uids:
id=self.pool.get('audittrail.log').create(cr, uid, {"method": fct_src.__name__, "object_id": object.id, "user_id": uid, "res_id": res_id,"name": "%s %s %s" % (fct_src.__name__, object.id, time.strftime("%Y-%m-%d %H:%M:%S"))})
lines=[]
for field in new_value:
if new_value[field]:
line={
'name':field,
'new_value':new_value[field],
'new_value_text':get_value_text(cr,uid,field,new_value[field],object)
}
lines.append(line)
create_log_line(cr,uid,id,object,lines)
return res_id
if fct_src.__name__ in ('write'):
res_ids=args[0]
for res_id in res_ids:
old_values=self.pool.get(object.model).read(cr,uid,res_id,args[1].keys())
old_values_text={}
for field in args[1].keys():
old_values_text[field]=get_value_text(cr,uid,field,old_values[field],object)
res =fct_src( cr, uid, *args, **args2)
if res:
new_values=self.pool.get(object.model).read(cr,uid,res_ids,args[1].keys())[0]
if not len(logged_uids) or uid in logged_uids:
id=self.pool.get('audittrail.log').create(cr, uid, {"method": fct_src.__name__, "object_id": object.id, "user_id": uid, "res_id": res_id,"name": "%s %s %s" % (fct_src.__name__, object.id, time.strftime("%Y-%m-%d %H:%M:%S"))})
lines=[]
for field in args[1].keys():
if args[1].keys():
line={
'name':field,
'new_value':field in new_values and new_values[field] or '',
'old_value':field in old_values and old_values[field] or '',
'new_value_text':get_value_text(cr,uid,field,new_values[field],object),
'old_value_text':old_values_text[field]
}
lines.append(line)
create_log_line(cr,uid,id,object,lines)
return res
if fct_src.__name__ in ('read'):
res_ids=args[0]
old_values={}
res =fct_src( cr, uid,*args, **args2)
if type(res)==list:
for v in res:
old_values[v['id']]=v
else:
old_values[res['id']]=res
for res_id in old_values:
if not len(logged_uids) or uid in logged_uids:
id=self.pool.get('audittrail.log').create(cr, uid, {"method": fct_src.__name__, "object_id": object.id, "user_id": uid, "res_id": res_id,"name": "%s %s %s" % (fct_src.__name__, object.id, time.strftime("%Y-%m-%d %H:%M:%S"))})
lines=[]
for field in old_values[res_id]:
if old_values[res_id][field]:
line={
'name':field,
'old_value':old_values[res_id][field],
'old_value_text':get_value_text(cr,uid,field,old_values[res_id][field],object)
}
lines.append(line)
create_log_line(cr,uid,id,object,lines)
return res
if fct_src.__name__ in ('unlink'):
res_ids=args[0]
old_values={}
for res_id in res_ids:
old_values[res_id]=self.pool.get(object.model).read(cr,uid,res_id,[])
for res_id in res_ids:
if not len(logged_uids) or uid in logged_uids:
id=self.pool.get('audittrail.log').create(cr, uid, {"method": fct_src.__name__, "object_id": object.id, "user_id": uid, "res_id": res_id,"name": "%s %s %s" % (fct_src.__name__, object.id, time.strftime("%Y-%m-%d %H:%M:%S"))})
lines=[]
for field in old_values[res_id]:
if old_values[res_id][field]:
line={
'name':field,
'old_value':old_values[res_id][field],
'old_value_text':get_value_text(cr,uid,field,old_values[res_id][field],object)
}
lines.append(line)
create_log_line(cr,uid,id,object,lines)
res =fct_src( cr, uid,*args, **args2)
return res
return my_fct
def unsubscribe(self, cr, uid, ids, *args):
for thisrule in self.browse(cr, uid, ids):
if thisrule.id in self.__functions :
for function in self.__functions[thisrule.id]:
setattr(function[0], function[1], function[2])
w_id=self.pool.get('ir.actions.act_window').search(cr, uid, [('name','=','View Log'),('res_model','=','audittrail.log'),('src_model','=',thisrule.object_id.model)])
self.pool.get('ir.actions.act_window').unlink(cr, uid,w_id )
val_obj=self.pool.get('ir.values')
value="ir.actions.act_window"+','+str(w_id[0])
val_id=val_obj.search(cr, uid, [('model','=',thisrule.object_id.model),('value','=',value)])
if val_id:
res = ir.ir_del(cr, uid, val_id[0])
self.write(cr, uid, ids, {"state": "draft"})
return True
audittrail_rule()
class audittrail_log(osv.osv):
_name = 'audittrail.log'
_columns = {
"name": fields.char("Name", size=32),
"object_id": fields.many2one('ir.model', 'Object'),
"user_id": fields.many2one('res.users', 'User'),
"method": fields.selection((('read', 'Read'), ('write', 'Write'), ('unlink', 'Delete'), ('create', 'Create')), "Method"),
"timestamp": fields.datetime("Date"),
"res_id":fields.integer('Resource Id'),
"line_ids":fields.one2many('audittrail.log.line','log_id','Log lines')
}
_defaults = {
"timestamp": lambda *a: time.strftime("%Y-%m-%d %H:%M:%S")
}
audittrail_log()
class audittrail_log_line(osv.osv):
_name='audittrail.log.line'
_columns={
'field_id': fields.many2one('ir.model.fields','Fields', required=True),
'log_id':fields.many2one('audittrail.log','Log'),
'log':fields.integer("Log ID"),
'old_value':fields.text("Old Value"),
'new_value':fields.text("New Value"),
'old_value_text':fields.text('Old value Text' ),
'new_value_text':fields.text('New value Text' ),
'field_description':fields.char('Field Description' ,size=64),
}
audittrail_log_line()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+10
View File
@@ -0,0 +1,10 @@
<?xml version="1.0" ?>
<openerp>
<data noupdate="1">
<record model="audittrail.rule" id="demo_audittrail_rule">
<field name="name">Audit on Partners</field>
<field name="object_id" search="[('model','=','res.partner')]"/>
<field name="user_id" search="[]"/>
</record>
</data>
</openerp>
+126
View File
@@ -0,0 +1,126 @@
<?xml version="1.0" ?>
<openerp>
<data>
<record model="ir.ui.view" id="view_audittrail_rule_form">
<field name="name">audittrail.rule.form</field>
<field name="model">audittrail.rule</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="AuditTrail Rule">
<field name="name" select="1" required="1"/>
<field name="object_id" select="1"/>
<field name="log_read" />
<field name="log_write" />
<field name="log_unlink" />
<field name="log_create" />
<field name="action_id" colspan="4" readonly="1"/>
<field name="user_id" select="1" colspan="4"/>
<field name="state" select="1" readonly="1" />
<group colspan="2" col="2">
<button string="Subscribe" name="subscribe" type="object" states="draft"/>
<button string="UnSubscribe" name="unsubscribe" type="object" states="subscribed"/>
</group>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_audittrail_rule_tree">
<field name="name">audittrail.rule.tree</field>
<field name="model">audittrail.rule</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="AuditTrail Rules">
<field name="name" />
<field name="object_id"/>
<field name="user_id" />
<field name="log_read" />
<field name="log_write" />
<field name="log_unlink" />
<field name="log_create" />
<field name="state" />
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_audittrail_rule_tree">
<field name="res_model">audittrail.rule</field>
<field name="type">ir.actions.act_window</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<!--<field name="view_id" ref="view_audittrail_rule_form" />-->
</record>
<menuitem name="Audittrails" id="menu_action_audittrail" parent="base.menu_administration"/>
<menuitem name="Rules" id="menu_action_audittrail_rule_tree" action="action_audittrail_rule_tree" parent="menu_action_audittrail"/>
<record model="ir.actions.act_window" id="action_audittrail_rule_tree_sub">
<field name="res_model">audittrail.rule</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','subscribed')]</field>
</record>
<menuitem name="Subscribed Rules" id="menu_action_audittrail_rule_tree_sub" action="action_audittrail_rule_tree_sub" parent="menu_action_audittrail_rule_tree"/>
<record model="ir.ui.view" id="view_audittrail_log_form">
<field name="name">audittrail.log.form</field>
<field name="model">audittrail.log</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="AuditTrail Logs">
<field name="timestamp" select="1" required="1" readonly="1"/>
<field name="object_id" select="1" readonly="1"/>
<field name="method" select="1" readonly="1"/>
<field name="user_id" select="1" readonly="1"/>
<field name="res_id" readonly="1" colspan="4"/>
<field name="line_ids" colspan="4" mode="tree,form" widget="one2many_list" readonly="1">
<form string="Log Lines">
<field name="field_id" colspan="4" readonly="1"/>
<newline/>
<field name="field_description" colspan="4" readonly="1"/>
<newline/>
<separator string="Old Value : " colspan="2" readonly="1"/>
<separator string="New Value : " colspan="2" readonly="1"/>
<newline/>
<field name="old_value" nolabel="1" colspan="2" readonly="1"/>
<field name="new_value" nolabel="1" colspan="2" readonly="1"/>
<newline/>
<separator string="Old Value Text : " colspan="2" readonly="1"/>
<separator string="New Value Text: " colspan="2" readonly="1"/>
<newline/>
<field name="old_value_text" nolabel="1" colspan="2" readonly="1"/>
<field name="new_value_text" nolabel="1" colspan="2" readonly="1"/>
</form>
<tree string="Log Lines">
<field name="field_description" />
<field name="old_value_text" />
<field name="new_value_text" />
</tree>
</field>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_audittrail_log_tree">
<field name="name">audittrail.log.tree</field>
<field name="model">audittrail.log</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="AuditTrail Logs">
<field name="timestamp" />
<field name="object_id" />
<field name="method" />
<field name="user_id" />
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_audittrail_log_tree">
<field name="res_model">audittrail.log</field>
<field name="view_type">form</field>
</record>
<menuitem name="Logs" id="menu_action_audittrail_log_tree" action="action_audittrail_log_tree" parent="menu_action_audittrail"/>
<wizard string="View log" menu="False" model="audittrail.log" name="audittrail.view.log" id="wizard_audittrail_log"/>
<menuitem name="View Logs" id="menu_action_log_tree2" action="wizard_audittrail_log" type="wizard" parent="menu_action_audittrail"/>
</data>
</openerp>
+4
View File
@@ -0,0 +1,4 @@
# -*- encoding: utf-8 -*-
import wizard_view_log
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,61 @@
# -*- encoding: utf-8 -*-
import wizard
import pooler
import time
class wizard_view_log(wizard.interface):
form1 = '''<?xml version="1.0"?>
<form string="Audit Logs">
<field name="from" colspan="4"/>
<newline/>
<field name="to" colspan="4"/>
</form>'''
form1_fields = {
'from': {
'string': 'Log From',
'type': 'datetime',
},
'to': {
'string': 'Log To',
'type': 'datetime',
'default': lambda *a: time.strftime("%Y-%m-%d %H:%M:%S"),
'required':True
},
}
def _log_open_window(self, cr, uid, data, context):
mod_obj = pooler.get_pool(cr.dbname).get('ir.model.data')
act_obj = pooler.get_pool(cr.dbname).get('ir.actions.act_window')
result = mod_obj._get_id(cr, uid, 'audittrail', 'action_audittrail_log_tree')
id = mod_obj.read(cr, uid, [result], ['res_id'])[0]['res_id']
result = act_obj.read(cr, uid, [id])[0]
log_obj= pooler.get_pool(cr.dbname).get(result['res_model'])
log_id = log_obj.search(cr, uid, [])
log_model=log_obj.read(cr, uid,log_id,['object_id'])
if not data['form']['from']:
if data['form']['to'] <> time.strftime("%Y-%m-%d %H:%M:%S"):
result['domain'] = str([('timestamp', '<',data['form']['to'])])
else:
pass
else:
result['domain'] = str([('timestamp', '>',data['form']['from']),('timestamp', '<',data['form']['to'])])
return result
states = {
'init': {
'actions': [],
'result': {'type': 'form', 'arch':form1, 'fields':form1_fields, 'state': [('end', 'Cancel'), ('open', 'Open Logs')]}
},
'open': {
'actions': [],
'result': {'type': 'action', 'action':_log_open_window, 'state':'end'}
}
}
wizard_view_log('audittrail.view.log')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+10
View File
@@ -102,6 +102,15 @@ class res_partner_job(osv.osv):
res[id.id] = id.address_id.partner_id.id
return res
def search(self, cr, user, args, offset=0, limit=None, order=None,
context=None, count=False):
for arg in args:
if arg[0]=='address_id':
self._order = 'sequence_partner'
if arg[0]=='contact_id':
self._order = 'sequence_contact'
return super(res_partner_job,self).search(cr, user, args, offset, limit, order, context, count)
_name = 'res.partner.job'
_description ='Contact Function'
_order = 'sequence_contact'
@@ -111,6 +120,7 @@ class res_partner_job(osv.osv):
'contact_id':fields.many2one('res.partner.contact','Contact', required=True),
'function_id': fields.many2one('res.partner.function','Function', required=True),
'sequence_contact':fields.integer('Sequence (Contact)',help='order of importance of this address in the list of addresses of the linked contact'),
'sequence_partner':fields.integer('Sequence (Partner)',help='order of importance of this function in the list of functions of the linked partner'),
'email': fields.char('E-Mail', size=240),
'phone': fields.char('Phone', size=64),
}
@@ -112,12 +112,14 @@
<newline/>
<field name="job_ids" mode="tree, form" colspan="4">
<tree string="Contacts" editable="top">
<field name="sequence_partner"/>
<field name="contact_id"/>
<field name="function_id"/>
<field name="phone"/>
<field name="email"/>
</tree>
<form string="Contacts">
<field name="sequence_partner"/>
<field name="contact_id"/>
<field name="function_id"/>
<field name="phone"/>
@@ -277,6 +279,7 @@
<field name="email" select="2"/>
<field name="phone" select="2"/>
<field name="sequence_contact" select="2"/>
<field name="sequence_partner" select="2"/>
</page>
</notebook>
</form>
+2 -4
View File
@@ -4,12 +4,10 @@
"version":"1.0",
"author":"Tiny",
"category":"Board/Document",
"depends":["board","document", "report_document"],
"depends":["board","document2", "report_document"],
"demo_xml":["board_document_demo.xml"],
"update_xml":["board_document_view.xml"],
"description": """
This module implements a dashboard for Document
""",
"description": """ This module implements a dashboard for Document """,
"active":False,
"installable":True,
}
+146
View File
@@ -0,0 +1,146 @@
<?xml version="1.0" ?>
<openerp>
<data noupdate="1">
<record id="crm_case_helpingstreetchildren0" model="crm.case">
<field eval="0.5" name="probability"/>
<field name="partner_address_id" ref="base.res_partner_address_1"/>
<field eval="1" name="active"/>
<field name="category2_id" ref="association_vertical.categ2_fund3"/>
<field eval="3.0" name="duration"/>
<field name="partner_id" ref="base.res_partner_9"/>
<field eval="&quot;3&quot;" name="priority"/>
<field name="user_id" ref="base.user_demo"/>
<field eval="&quot;open&quot;" name="state"/>
<field eval="250000.0" name="planned_cost"/>
<field name="section_id" ref="association_vertical.section_support4"/>
<field eval="time.strftime('%Y-%m-01 10:35:50')" name="date"/>
<field name="categ_id" ref="association_vertical.categ_fund1"/>
<field eval="&quot;Helping Street Children&quot;" name="name"/>
<field eval="&quot;info@opensides.be&quot;" name="email_from"/>
</record>
</data>
<data noupdate="1">
<record id="crm_case_helpingearthquakevictims0" model="crm.case">
<field eval="0.8" name="probability"/>
<field name="partner_address_id" ref="base.main_address"/>
<field eval="1" name="active"/>
<field name="category2_id" ref="association_vertical.categ2_fund4"/>
<field name="partner_id" ref="base.main_partner"/>
<field eval="&quot;3&quot;" name="priority"/>
<field name="user_id" ref="base.user_root"/>
<field eval="&quot;draft&quot;" name="state"/>
<field eval="2000000.0" name="planned_cost"/>
<field name="section_id" ref="association_vertical.section_support4"/>
<field eval="time.strftime('%Y-%m-05 12:35:50')" name="date"/>
<field eval="8.0" name="duration"/>
<field name="categ_id" ref="association_vertical.categ_fund1"/>
<field eval="&quot;Helping earthquake victims&quot;" name="name"/>
</record>
</data>
<data noupdate="1">
<record id="crm_case_donatingbookstoschoollibraries0" model="crm.case">
<field name="partner_address_id" ref="base.res_partner_address_zen"/>
<field eval="1" name="active"/>
<field name="category2_id" ref="association_vertical.categ2_fund1"/>
<field eval="5.0" name="duration"/>
<field name="partner_id" ref="base.res_partner_3"/>
<field eval="&quot;3&quot;" name="priority"/>
<field name="user_id" ref="base.user_root"/>
<field eval="&quot;open&quot;" name="state"/>
<field eval="500000.0" name="planned_cost"/>
<field name="section_id" ref="association_vertical.section_support4"/>
<field eval="time.strftime('%Y-%m-07 13:50:50')" name="date"/>
<field name="categ_id" ref="association_vertical.categ_fund2"/>
<field eval="&quot;Donating books to school libraries&quot;" name="name"/>
</record>
</data>
<data noupdate="1">
<record id="crm_case_renovatinggovernmentschools0" model="crm.case">
<field name="partner_address_id" ref="base.res_partner_address_7"/>
<field eval="1" name="active"/>
<field name="category2_id" ref="association_vertical.categ2_fund2"/>
<field eval="3.0" name="duration"/>
<field name="partner_id" ref="base.res_partner_4"/>
<field eval="&quot;3&quot;" name="priority"/>
<field name="user_id" ref="base.user_demo"/>
<field eval="&quot;draft&quot;" name="state"/>
<field eval="1000000.0" name="planned_cost"/>
<field name="section_id" ref="association_vertical.section_support4"/>
<field eval="time.strftime('%Y-%m-12 15:10:50')" name="date"/>
<field name="categ_id" ref="association_vertical.categ_fund2"/>
<field eval="4.3" name="duration"/>
<field eval="&quot;Renovating government schools&quot;" name="name"/>
</record>
</data>
<data noupdate="1">
<record id="crm_case_donatingambulancestohospitals0" model="crm.case">
<field name="partner_address_id" ref="base.res_partner_address_13"/>
<field eval="1" name="active"/>
<field name="category2_id" ref="association_vertical.categ2_fund4"/>
<field name="partner_id" ref="base.res_partner_14"/>
<field eval="&quot;3&quot;" name="priority"/>
<field name="user_id" ref="base.user_root"/>
<field eval="&quot;open&quot;" name="state"/>
<field eval="5000000.0" name="planned_cost"/>
<field name="section_id" ref="association_vertical.section_support4"/>
<field eval="time.strftime('%Y-%m-17 19:00:15')" name="date"/>
<field eval="3" name="duration"/>
<field name="categ_id" ref="association_vertical.categ_fund3"/>
<field eval="&quot;Donating ambulances to hospitals&quot;" name="name"/>
</record>
</data>
<data noupdate="1">
<record id="crm_case_donatinghospitalequipments0" model="crm.case">
<field name="partner_address_id" ref="base.res_partner_address_2"/>
<field eval="1" name="active"/>
<field name="category2_id" ref="association_vertical.categ2_fund3"/>
<field name="partner_id" ref="base.res_partner_10"/>
<field eval="&quot;3&quot;" name="priority"/>
<field name="user_id" ref="base.user_root"/>
<field eval="&quot;done&quot;" name="state"/>
<field eval="10000000.0" name="planned_cost"/>
<field name="section_id" ref="association_vertical.section_support4"/>
<field eval="time.strftime('%Y-%m-27 09:00:15')" name="date"/>
<field eval="12" name="duration"/>
<field name="categ_id" ref="association_vertical.categ_fund3"/>
<field eval="&quot;Donating hospital equipments&quot;" name="name"/>
<field eval="&quot;contact@tecsas.fr&quot;" name="email_from"/>
</record>
</data>
<data noupdate="1">
<record id="crm_case_encouragingarts0" model="crm.case">
<field name="partner_address_id" ref="base.res_partner_address_14"/>
<field eval="1" name="active"/>
<field name="category2_id" ref="association_vertical.categ2_fund2"/>
<field eval="7.0" name="duration"/>
<field name="partner_id" ref="base.res_partner_15"/>
<field eval="&quot;3&quot;" name="priority"/>
<field name="user_id" ref="base.user_demo"/>
<field eval="&quot;draft&quot;" name="state"/>
<field eval="10000.0" name="planned_cost"/>
<field name="section_id" ref="association_vertical.section_support4"/>
<field eval="time.strftime('%Y-%m-01 10:00:15')" name="date"/>
<field name="categ_id" ref="association_vertical.categ_fund4"/>
<field eval="&quot;Encouraging arts&quot;" name="name"/>
</record>
</data>
<data noupdate="1">
<record id="crm_case_promotingculturalprogramsandpreservingdyingartforms0" model="crm.case">
<field eval="1.0" name="probability"/>
<field name="partner_address_id" ref="base.res_partner_address_1"/>
<field eval="1" name="active"/>
<field name="category2_id" ref="association_vertical.categ2_fund1"/>
<field eval="6.0" name="duration"/>
<field name="partner_id" ref="base.res_partner_9"/>
<field eval="&quot;3&quot;" name="priority"/>
<field name="user_id" ref="base.user_root"/>
<field eval="&quot;open&quot;" name="state"/>
<field eval="800000.0" name="planned_cost"/>
<field name="section_id" ref="association_vertical.section_support4"/>
<field eval="time.strftime('%Y-%m-24 22:00:15')" name="date"/>
<field name="categ_id" ref="association_vertical.categ_fund4"/>
<field eval="&quot;Promoting cultural programs and preserving dying art forms&quot;" name="name"/>
<field eval="&quot;info@opensides.be&quot;" name="email_from"/>
</record>
</data>
</openerp>
+243
View File
@@ -0,0 +1,243 @@
<?xml version="1.0"?>
<openerp>
<data noupdate="1">
<record model="crm.case.section" id="section_support4">
<field name="name">Fund Raising</field>
<field name="code">funds</field>
</record>
<!-- CASE CATEGORY(categ_id) -->
<record model="crm.case.categ" id="categ_fund1">
<field name="name">Social Rehabilitation And Rural Upliftment</field>
<field name="section_id" ref="section_support4"/>
</record>
<record model="crm.case.categ" id="categ_fund2">
<field name="name">Learning And Education</field>
<field name="section_id" ref="section_support4"/>
</record>
<record model="crm.case.categ" id="categ_fund3">
<field name="name">Healthcare</field>
<field name="section_id" ref="section_support4"/>
</record>
<record model="crm.case.categ" id="categ_fund4">
<field name="name">Arts And Culture</field>
<field name="section_id" ref="section_support4"/>
</record>
<!-- CASE CATEGORY2(category2_id) -->
<record model="crm.case.category2" id="categ2_fund1">
<field name="name">Cash</field>
<field name="section_id" ref="section_support4"/>
</record>
<record model="crm.case.category2" id="categ2_fund2">
<field name="name">Cheque</field>
<field name="section_id" ref="section_support4"/>
</record>
<record model="crm.case.category2" id="categ2_fund3">
<field name="name">Credit Card</field>
<field name="section_id" ref="section_support4"/>
</record>
<record model="crm.case.category2" id="categ2_fund4">
<field name="name">Demand Draft</field>
<field name="section_id" ref="section_support4"/>
</record>
<!-- MENU -->
<menuitem name="Fund Raising" id="menu_crm_case_fund_raise" parent="crm.menu_crm"/>
<record model="ir.actions.act_window" id="crm_case_category_act_fund1">
<field name="name">Funds</field>
<field name="res_model">crm.case</field>
<field name="view_mode">form,graph</field>
<field name="view_id" ref="crm_configuration.crm_case_form_view_fund"/>
<field name="domain" eval="'[(\'section_id\',\'=\','+str(section_support4)+')]'"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_view_fund1">
<field name="sequence" eval="2"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="crm_configuration.crm_case_graph_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund1"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_form_view_fund1">
<field name="sequence" eval="1"/>
<field name="view_mode">form</field>
<field name="view_id" ref="crm_configuration.crm_case_form_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund1"/>
</record>
<menuitem name="New Fund Opportunity" id="menu_crm_case_categ0_act_fund" action="crm_case_category_act_fund1" parent="menu_crm_case_fund_raise"/>
<!-- My Funds -->
<record model="ir.actions.act_window" id="crm_case_category_act_fund_my1">
<field name="name">My Funds</field>
<field name="res_model">crm.case</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="crm_configuration.crm_case_tree_view_fund"/>
<field name="domain" eval="'[(\'section_id\',\'=\','+str(section_support4)+'),(\'user_id\',\'=\',uid)]'"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_view_fund_my1">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="crm_configuration.crm_case_tree_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund_my1"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_graph_view_fund_my1">
<field name="sequence" eval="3"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="crm_configuration.crm_case_graph_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund_my1"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_form_view_fund_my1">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="crm_configuration.crm_case_form_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund_my1"/>
</record>
<menuitem name="My Funds" id="menu_crm_case_category_act_fund_my1" action="crm_case_category_act_fund_my1" parent="menu_crm_case_fund_raise"/>
<record model="ir.actions.act_window" id="crm_case_category_act_fund_my2">
<field name="name">My Funds Waiting Validation</field>
<field name="res_model">crm.case</field>
<field name="view_mode">tree,form,graph</field>
<field name="view_id" ref="crm_configuration.crm_case_tree_view_fund"/>
<field name="domain" eval="'[(\'section_id\',\'=\','+str(section_support4)+'),(\'user_id\',\'=\',uid),(\'state\',\'=\',\'draft\')]'"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_view_fund_my2">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="crm_configuration.crm_case_tree_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund_my2"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_form_view_fund_my2">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="crm_configuration.crm_case_form_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund_my2"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_graph_view_fund_my2">
<field name="sequence" eval="3"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="crm_configuration.crm_case_graph_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund_my2"/>
</record>
<menuitem name="My Funds Waiting Validation" id="menu_crm_case_categ0_act_fund_my2" action="crm_case_category_act_fund_my2" parent="menu_crm_case_category_act_fund_my1"/>
<record model="ir.actions.act_window" id="crm_case_category_act_fund_my3">
<field name="name">My Funds To Be Processed</field>
<field name="res_model">crm.case</field>
<field name="view_mode">tree,form,graph</field>
<field name="view_id" ref="crm_configuration.crm_case_tree_view_fund"/>
<field name="domain" eval="'[(\'section_id\',\'=\','+str(section_support4)+'),(\'user_id\',\'=\',uid),(\'state\',\'=\',\'open\')]'"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_view_fund_my3">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="crm_configuration.crm_case_tree_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund_my3"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_form_view_fund_my3">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="crm_configuration.crm_case_form_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund_my3"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_graph_view_fund_my3">
<field name="sequence" eval="3"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="crm_configuration.crm_case_graph_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund_my3"/>
</record>
<menuitem name="My Funds To Be Processed" id="menu_crm_case_categ0_act_fund_my3" action="crm_case_category_act_fund_my3" parent="menu_crm_case_category_act_fund_my1"/>
<!-- All Funds -->
<record model="ir.actions.act_window" id="crm_case_category_act_fund_all1">
<field name="name">All Funds</field>
<field name="res_model">crm.case</field>
<field name="view_mode">tree,form,graph</field>
<field name="view_id" ref="crm_configuration.crm_case_tree_view_fund"/>
<field name="domain" eval="'[(\'section_id\',\'=\','+str(section_support4)+')]'"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_view_fund_all1">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="crm_configuration.crm_case_tree_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund_all1"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_form_view_fund_all1">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="crm_configuration.crm_case_form_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund_all1"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_graph_view_fund_all1">
<field name="sequence" eval="3"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="crm_configuration.crm_case_graph_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund_all1"/>
</record>
<menuitem name="All Funds" id="menu_crm_case_categ0_act_fund_all1" action="crm_case_category_act_fund_all1" parent="menu_crm_case_fund_raise"/>
<record model="ir.actions.act_window" id="crm_case_category_act_fund_all2">
<field name="name">All Funds Waiting Validation</field>
<field name="res_model">crm.case</field>
<field name="view_mode">tree,form,graph</field>
<field name="view_id" ref="crm_configuration.crm_case_tree_view_fund"/>
<field name="domain" eval="'[(\'section_id\',\'=\','+str(section_support4)+'),(\'state\',\'=\',\'draft\')]'"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_view_fund_all2">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="crm_configuration.crm_case_tree_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund_all2"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_form_view_fund_all2">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="crm_configuration.crm_case_form_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund_all2"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_graph_view_fund_all2">
<field name="sequence" eval="3"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="crm_configuration.crm_case_graph_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund_all2"/>
</record>
<menuitem name="All Funds Waiting Validation" id="menu_crm_case_categ0_act_fund_all2" action="crm_case_category_act_fund_all2" parent="menu_crm_case_categ0_act_fund_all1"/>
<record model="ir.actions.act_window" id="crm_case_category_act_fund_all3">
<field name="name">All Funds To Be Processed</field>
<field name="res_model">crm.case</field>
<field name="view_mode">tree,form,graph</field>
<field name="view_id" ref="crm_configuration.crm_case_tree_view_fund"/>
<field name="domain" eval="'[(\'section_id\',\'=\','+str(section_support4)+'),(\'state\',\'=\',\'open\')]'"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_tree_view_fund_all3">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="crm_configuration.crm_case_tree_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund_all3"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_form_view_fund_all3">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="crm_configuration.crm_case_form_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund_all3"/>
</record>
<record model="ir.actions.act_window.view" id="action_crm_tag_graph_view_fund_all3">
<field name="sequence" eval="3"/>
<field name="view_mode">graph</field>
<field name="view_id" ref="crm_configuration.crm_case_graph_view_fund"/>
<field name="act_window_id" ref="crm_case_category_act_fund_all3"/>
</record>
<menuitem name="All Funds To Be Processed" id="menu_crm_case_categ0_act_fund_all3" action="crm_case_category_act_fund_all3" parent="menu_crm_case_categ0_act_fund_all1"/>
</data>
</openerp>
@@ -400,5 +400,12 @@
<field name="act_window_id" ref="crm_case_categ0_act_alljobs"/>
</record>
<menuitem parent="menu_crm_case_categ0_act111" id="menu_crm_case_categ0_act_myjobs_alljobs" action="crm_case_categ0_act_alljobs"/>
<!-- short cut -->
<record id="ir_ui_view_sc_myjobsrequests0" model="ir.ui.view_sc">
<field ref="crm_configuration.menu_crm_case_categ0_act11" name="res_id"/>
<field eval="&quot;ir.ui.menu&quot;" name="resource"/>
<field eval="&quot;My Jobs Requests&quot;" name="name"/>
<field name="user_id" ref="base.user_root"/>
</record>
</data>
</openerp>
@@ -551,5 +551,12 @@
</record>
<menuitem name="Cases by Section, Category and Category2" parent="menu_action_report_crm_case_lead" action="action_report_crm_case_lead_categ_categ2" id="menu_action_report_crm_case_lead_categ_categ2"/>
<!-- short cut -->
<record id="ir_ui_view_sc_myleads0" model="ir.ui.view_sc">
<field ref="crm_configuration.menu_crm_case_categ0_act_leads_my" name="res_id"/>
<field eval="&quot;ir.ui.menu&quot;" name="resource"/>
<field eval="&quot;My Leads&quot;" name="name"/>
<field name="user_id" ref="base.user_root"/>
</record>
</data>
</openerp>
@@ -276,5 +276,13 @@
<field name="act_window_id" ref="crm_case_category_act_meetall3"/>
</record>
<menuitem name="Next Deadlines" parent="menu_crm_case_categ_meet" id="menu_crm_case_categ0_act_meetall3" action="crm_case_category_act_meetall3"/>
<!-- short cut -->
<record id="ir_ui_view_sc_mymeetings0" model="ir.ui.view_sc">
<field ref="crm_configuration.menu_crm_case_categ_meet_my" name="res_id"/>
<field eval="&quot;ir.ui.menu&quot;" name="resource"/>
<field eval="&quot;My Meetings&quot;" name="name"/>
<field name="user_id" ref="base.user_root"/>
</record>
</data>
</openerp>
@@ -313,6 +313,13 @@
<field name="domain" eval="'[(\'section_id\',\'=\','+str(section_support3)+')]'"/>
</record>
<menuitem name="Cases by Section, Category and Category2" parent="menu_action_report_crm_case_oppor" action="action_report_crm_case_oppor_categ_categ2" id="menu_action_report_crm_case_oppor_categ_categ2"/>
<!-- short cut -->
<record id="ir_ui_view_sc_openopportunities0" model="ir.ui.view_sc">
<field ref="crm_configuration.menu_crm_case_categ0_act_oppor1" name="res_id"/>
<field eval="&quot;ir.ui.menu&quot;" name="resource"/>
<field eval="&quot;Open Opportunities&quot;" name="name"/>
<field name="user_id" ref="base.user_root"/>
</record>
</data>
</openerp>
+1 -1
View File
@@ -9,7 +9,7 @@
"depends" : ["crm_configuration"],
"init_xml" : [ ],
"demo_xml" : [ ],
"update_xml" : ["crm_vertical_view.xml","crm_vertical_shortcuts.xml"],
"update_xml" : ["crm_vertical_view.xml"],
"installable": True
}
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -1,35 +0,0 @@
<?xml version="1.0" ?>
<openerp>
<data noupdate="1">
<record id="ir_ui_view_sc_mymeetings0" model="ir.ui.view_sc">
<field ref="crm_configuration.menu_crm_case_categ_meet_my" name="res_id"/>
<field eval="&quot;ir.ui.menu&quot;" name="resource"/>
<field eval="&quot;My Meetings&quot;" name="name"/>
<field name="user_id" ref="base.user_root"/>
</record>
</data>
<data noupdate="1">
<record id="ir_ui_view_sc_myleads0" model="ir.ui.view_sc">
<field ref="crm_configuration.menu_crm_case_categ0_act_leads_my" name="res_id"/>
<field eval="&quot;ir.ui.menu&quot;" name="resource"/>
<field eval="&quot;My Leads&quot;" name="name"/>
<field name="user_id" ref="base.user_root"/>
</record>
</data>
<data noupdate="1">
<record id="ir_ui_view_sc_myjobsrequests0" model="ir.ui.view_sc">
<field ref="crm_configuration.menu_crm_case_categ0_act11" name="res_id"/>
<field eval="&quot;ir.ui.menu&quot;" name="resource"/>
<field eval="&quot;My Jobs Requests&quot;" name="name"/>
<field name="user_id" ref="base.user_root"/>
</record>
</data>
<data noupdate="1">
<record id="ir_ui_view_sc_openopportunities0" model="ir.ui.view_sc">
<field ref="crm_configuration.menu_crm_case_categ0_act_oppor1" name="res_id"/>
<field eval="&quot;ir.ui.menu&quot;" name="resource"/>
<field eval="&quot;Open Opportunities&quot;" name="name"/>
<field name="user_id" ref="base.user_root"/>
</record>
</data>
</openerp>
+4 -4
View File
@@ -8,10 +8,10 @@
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="arch" type="xml">
<page string="Sales &amp; Purchases" position="inside">
<group colspan="2" col="2">
<separator string="Deliveries" colspan="4"/>
<field name="property_delivery_carrier"/>
</group>
<group colspan="2" col="2">
<separator string="Deliveries Properties" colspan="4"/>
<field name="property_delivery_carrier"/>
</group>
</page>
</field>
</record>
+1 -1
View File
@@ -69,7 +69,7 @@
"mrp_view.xml",
"mrp_wizard.xml",
"mrp_report.xml",
"company_view.xml"
"company_view.xml",
],
"active": False,
"installable": True
+8 -8
View File
@@ -318,7 +318,7 @@ class mrp_production(osv.osv):
'location_src_id': fields.many2one('stock.location', 'Raw Products Location', required=True),
'location_dest_id': fields.many2one('stock.location', 'Finnished Products Location', required=True),
'date_planned': fields.date('Scheduled date', required=True),
'date_planned': fields.datetime('Scheduled date', required=True, select=1),
'date_start': fields.datetime('Start Date'),
'date_finnished': fields.datetime('End Date'),
@@ -337,7 +337,7 @@ class mrp_production(osv.osv):
_defaults = {
'priority': lambda *a: '1',
'state': lambda *a: 'draft',
'date_planned': lambda *a: time.strftime('%Y-%m-%d'),
'date_planned': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
'product_qty': lambda *a: 1.0,
'name': lambda x,y,z,c: x.pool.get('ir.sequence').get(y,z,'mrp.production') or '/',
}
@@ -664,8 +664,8 @@ class mrp_procurement(osv.osv):
'name': fields.char('Name', size=64, required=True),
'origin': fields.char('Origin', size=64),
'priority': fields.selection([('0','Not urgent'),('1','Normal'),('2','Urgent'),('3','Very Urgent')], 'Priority', required=True),
'date_planned': fields.date('Scheduled date', required=True),
'date_close': fields.date('Date Closed'),
'date_planned': fields.datetime('Scheduled date', required=True),
'date_close': fields.datetime('Date Closed'),
'product_id': fields.many2one('product.product', 'Product', required=True),
'product_qty': fields.float('Quantity', required=True),
'product_uom': fields.many2one('product.uom', 'Product UoM', required=True),
@@ -690,7 +690,7 @@ class mrp_procurement(osv.osv):
_defaults = {
'state': lambda *a: 'draft',
'priority': lambda *a: '1',
'date_planned': lambda *a: time.strftime('%Y-%m-%d'),
'date_planned': lambda *a: time.strftime('%Y-%m-%d %H:%M:%S'),
'close_move': lambda *a: 0,
'procure_method': lambda *a: 'make_to_order',
}
@@ -872,7 +872,7 @@ class mrp_procurement(osv.osv):
for procurement in self.browse(cr, uid, ids):
res_id = procurement.move_id.id
loc_id = procurement.location_id.id
newdate = DateTime.strptime(procurement.date_planned, '%Y-%m-%d') - DateTime.RelativeDateTime(days=procurement.product_id.product_tmpl_id.produce_delay or 0.0)
newdate = DateTime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S') - DateTime.RelativeDateTime(days=procurement.product_id.product_tmpl_id.produce_delay or 0.0)
newdate = newdate - DateTime.RelativeDateTime(days=company.manufacturing_lead)
produce_id = self.pool.get('mrp.production').create(cr, uid, {
'origin': procurement.origin,
@@ -912,7 +912,7 @@ class mrp_procurement(osv.osv):
price = self.pool.get('product.pricelist').price_get(cr, uid, [pricelist_id], procurement.product_id.id, qty, False, {'uom': uom_id})[pricelist_id]
newdate = DateTime.strptime(procurement.date_planned, '%Y-%m-%d') - DateTime.RelativeDateTime(days=procurement.product_id.product_tmpl_id.seller_delay or 0.0)
newdate = DateTime.strptime(procurement.date_planned, '%Y-%m-%d %H:%M:%S') - DateTime.RelativeDateTime(days=procurement.product_id.product_tmpl_id.seller_delay or 0.0)
newdate = newdate - DateTime.RelativeDateTime(days=company.po_lead)
line = {
'name': procurement.product_id.name,
@@ -920,7 +920,7 @@ class mrp_procurement(osv.osv):
'product_id': procurement.product_id.id,
'product_uom': uom_id,
'price_unit': price,
'date_planned': newdate.strftime('%Y-%m-%d'),
'date_planned': newdate.strftime('%Y-%m-%d %H:%M:%S'),
'taxes_id': [(6, 0, [x.id for x in procurement.product_id.product_tmpl_id.supplier_taxes_id])],
'move_dest_id': res_id,
}
+8 -1
View File
@@ -29,6 +29,13 @@
<field eval="'ir.actions.wizard,%d'%wizard_price" name="value"/>
<field eval="True" name="object"/>
</record>
<wizard
string="Create Procurement"
model="product.product"
name="product.product.procurement"
keyword="client_action_multi"
id="product_procurement_wizard"/>
</data>
</openerp>
+1
View File
@@ -34,6 +34,7 @@ import wizard_schedulers_all
import wizard_price
import wizard_workcenter_load
import wizard_track_prod
import make_procurement
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+108
View File
@@ -0,0 +1,108 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2007 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import wizard
import pooler
import netsvc
import time
def _get_default(obj, cr, uid, data, context=None):
pool = pooler.get_pool(cr.dbname)
product = pool.get('product.product').browse(cr, uid, data['id'], context)
return {'product_id': product.id, 'uom_id':product.uom_id.id, 'qty':1.0}
def make_procurement(obj, cr, uid, data, context=None):
'''Create procurement'''
pool = pooler.get_pool(cr.dbname)
wh = pool.get('stock.warehouse').browse(cr, uid, data['form']['warehouse_id'], context)
user = pool.get('res.users').browse(cr, uid, uid, context)
procure_id = pool.get('mrp.procurement').create(cr, uid, {
'name':'INT:'+str(user.login),
'date_planned':data['form']['date_planned'],
'product_id':data['form']['product_id'],
'product_qty':data['form']['qty'],
'product_uom':data['form']['uom_id'],
'location_id':wh.lot_stock_id.id,
'procure_method':'make_to_order',
}, context=context)
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'mrp.procurement', procure_id, 'button_confirm', cr)
return {}
class MakeProcurement(wizard.interface):
'''Wizard that create a procurement from a product form'''
done_form = """<?xml version="1.0"?>
<form string="Make Procurement">
<label string="Your procurement request has been sent !"/>
</form>"""
procurement_form = """<?xml version="1.0"?>
<form string="Make Procurement">
<field name="product_id"/>
<field name="warehouse_id"/>
<field name="qty"/>
<field name="uom_id"/>
<field name="date_planned"/>
</form>"""
procurement_fields = {
'qty': {'string': 'Quantity', 'type': 'float', 'digits':(16,2), 'required': True},
'product_id': {'string': 'product', 'type': 'many2one', 'relation': 'product.product', 'required': True, 'readonly':1},
'uom_id': {'string': 'Unit of Measure', 'type': 'many2one', 'relation': 'product.uom', 'required':True},
'warehouse_id': {'string': 'Location', 'type': 'many2one', 'relation':'stock.warehouse', 'required':True},
'date_planned': {'string': 'Planned Date', 'type': 'date', 'required':True, 'default': lambda *args: time.strftime('%Y-%m-%d')}
}
states = {
'init': {
'actions': [_get_default],
'result': {'type': 'form', 'arch': procurement_form, 'fields': procurement_fields,
'state': [
('end', 'Cancel'),
('create', 'Ask New Products')
]
}
},
'done': {
'actions': [],
'result': {'type': 'form', 'arch': done_form, 'fields': {},
'state': [
('end', 'Close'),
]
}
},
'create': {
'actions': [],
'result': {'type': 'action', 'action': make_procurement, 'state': 'done'}
}
}
MakeProcurement('product.product.procurement')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+3 -3
View File
@@ -10,11 +10,11 @@ This module allows you to manage your process for the end-users.
""",
"depends" : ["base", "sale"],
"init_xml" : [],
"demo_xml" : ['process_data.xml'],
"demo_xml" : [],
"update_xml" : [
"security/ir.model.access.csv",
'process_view.xml',
"process_report.xml"],
'process_view.xml'
],
"active": False,
"installable": True
}
Binary file not shown.
+19 -37
View File
@@ -45,12 +45,9 @@ class process_process(osv.osv):
}
def graph_get(self, cr, uid, id, res_model, res_id, scale, context):
pool = pooler.get_pool(cr.dbname)
process = pool.get('process.process').browse(cr, uid, [id])[0]
current_object = pool.get(res_model).browse(cr, uid, [res_id])[0]
nodes = {}
start = []
transitions = {}
@@ -59,12 +56,12 @@ class process_process(osv.osv):
data = {}
data['name'] = node.name
data['menu'] = node.menu_id.name
data['model'] = node.model_id.model
data['menu'] = (node.menu_id or None) and node.menu_id.name
data['model'] = (node.model_id or None) and node.model_id.model
data['kind'] = node.kind
data['active'] = 0
if node.kind == "state" and node.model_id.model == res_model:
if node.kind == "state" and node.model_id and node.model_id.model == res_model:
states = node.model_states
states = (states or []) and states.split(',')
data['active'] = (states and current_object.state in states) or not states
@@ -78,57 +75,46 @@ class process_process(osv.osv):
pass
nodes[node.id] = data
if node.flow_start:
start.append(node.id)
for tr in node.transition_out:
data = {}
data['name'] = tr.name
data['source'] = tr.node_from_id.id
data['target'] = tr.node_to_id.id
data['source'] = tr.source_node_id.id
data['target'] = tr.target_node_id.id
data['buttons'] = buttons = []
for b in tr.action_ids:
button = {}
button['name'] = b.name
buttons.append(button)
data['roles'] = roles = []
for r in tr.transition_ids:
role = {}
role['name'] = r.role_id.name
roles.append(role)
if r.role_id:
role = {}
role['name'] = r.role_id.name
roles.append(role)
transitions[tr.id] = data
g = tools.graph(nodes.keys(), map(lambda x: (x['source'], x['target']), transitions.values()))
g.process(start)
#g.scale(100, 100, 180, 120)
g.scale(*scale)
graph = g.result_get()
miny = -1
for k,v in nodes.items():
x = graph[k]['y']
y = graph[k]['x']
if miny == -1:
miny = y
miny = min(y, miny)
v['x'] = x
v['y'] = y
for k, v in nodes.items():
y = v['y']
v['y'] = min(y - miny + 10, y)
return dict(nodes=nodes, transitions=transitions)
process_process()
@@ -145,8 +131,8 @@ class process_node(osv.osv):
'model_id': fields.many2one('ir.model', 'Object', ondelete='set null'),
'model_states': fields.char('States Expression', size=128),
'flow_start': fields.boolean('Starting Flow'),
'transition_in': fields.one2many('process.transition', 'node_to_id', 'Starting Transitions'),
'transition_out': fields.one2many('process.transition', 'node_from_id', 'Ending Transitions'),
'transition_in': fields.one2many('process.transition', 'target_node_id', 'Starting Transitions'),
'transition_out': fields.one2many('process.transition', 'source_node_id', 'Ending Transitions'),
}
_defaults = {
'kind': lambda *args: 'state',
@@ -160,13 +146,11 @@ class process_transition(osv.osv):
_description ='Process Transitions'
_columns = {
'name': fields.char('Name', size=32, required=True),
'node_from_id': fields.many2one('process.node', 'Origin Node', required=True, ondelete='cascade'),
'node_to_id': fields.many2one('process.node', 'Destination Node', required=True, ondelete='cascade'),
'transition_ids': fields.many2many('workflow.transition', 'process_transition_ids', 'trans1_id', 'trans2_id', 'Workflow Transitions'),
'source_node_id': fields.many2one('process.node', 'Source Node', required=True, ondelete='cascade'),
'target_node_id': fields.many2one('process.node', 'Target Node', required=True, ondelete='cascade'),
'action_ids': fields.one2many('process.transition.action', 'transition_id', 'Buttons'),
'transition_ids': fields.many2many('workflow.transition', 'process_transition_ids', 'ptr_id', 'wtr_id', 'Workflow Transitions'),
'note': fields.text('Description'),
'action_ids': fields.one2many('process.transition.action', 'transition_id', 'Buttons')
}
_defaults = {
}
process_transition()
@@ -175,7 +159,10 @@ class process_transition_action(osv.osv):
_description ='Process Transitions Actions'
_columns = {
'name': fields.char('Name', size=32, required=True),
'state': fields.selection([('dummy','Dummy'),('method','Object Method'),('workflow','Workflow Trigger'),('action','Action')], 'Type', required=True),
'state': fields.selection([('dummy','Dummy'),
('method','Object Method'),
('workflow','Workflow Trigger'),
('action','Action')], 'Type', required=True),
'action': fields.char('Action ID', size=64, states={
'dummy':[('readonly',1)],
'method':[('required',1)],
@@ -189,8 +176,3 @@ class process_transition_action(osv.osv):
}
process_transition_action()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-10
View File
@@ -1,10 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<report id="report_process"
model="process.process"
name="process.process.print"
string="Print Process"/>
</data>
</openerp>
+163 -173
View File
@@ -2,186 +2,176 @@
<openerp>
<data>
<menuitem
id="menu_process"
name="Enterprise Process"
parent="base.menu_custom"/>
<menuitem
id="menu_process"
name="Enterprise Process"
parent="base.menu_custom"/>
<!-- Views for Process -->
<record model="ir.ui.view" id="view_process_form">
<field name="name">process.process.form</field>
<field name="model">process.process</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Process">
<notebook>
<page string="Process">
<field name="name" select="1"/>
<field name="active" select="2"/>
<field name="note" colspan="4"/>
</page><page string="Nodes">
<field name="node_ids" colspan="4" nolabel="1"/>
</page>
</notebook>
</form>
</field>
</record>
<!-- Views for Process -->
<record model="ir.ui.view" id="view_process_form">
<field name="name">process.process.form</field>
<field name="model">process.process</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Process">
<group colspan="4" string="Details">
<field name="name" select="1"/>
<field name="active" select="2"/>
</group>
<notebook colspan="4">
<page string="Nodes">
<field name="node_ids" colspan="4" nolabel="1">
<form string="Process Node">
<group colspan="4" string="Details">
<field name="name" select="1"/>
<field name="flow_start"/>
<newline/>
<field name="model_id" select="1"/>
<field name="menu_id" select="2"/>
<newline/>
<field name="kind" select="1"/>
<field name="model_states"/>
</group>
<notebook colspan="4">
<page string="Outgoing Transitions">
<field name="transition_out" colspan="4" nolabel="1">
<tree string="Transitions">
<field name="name"/>
<field name="target_node_id"/>
</tree>
<form string="Transition">
<group colspan="4" string="Details">
<field name="name"/>
<newline/>
<field name="target_node_id"/>
</group>
<notebook colspan="4">
<page string="Buttons">
<field name="action_ids" colspan="4" nolabel="1">
<tree string="Actions">
<field name="name"/>
<field name="state"/>
<field name="action"/>
</tree>
<form string="Actions">
<field name="name" colspan="4"/>
<newline/>
<field name="state"/>
<field name="action"/>
</form>
</field>
</page>
<page string="Roles Required">
<field name="transition_ids" colspan="4" nolabel="1"/>
</page>
<page string="Extra Information">
<field name="note" colspan="4" nolabel="1"/>
</page>
</notebook>
</form>
</field>
</page>
<page string="Extra Information">
<field name="note" nolabel="1" colspan="4"/>
</page>
</notebook>
</form>
</field>
</page>
<page string="Extra Information">
<field name="note" colspan="4" nolabel="1"/>
</page>
</notebook>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_process_tree">
<field name="name">process.process.tree</field>
<field name="model">process.process</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Process">
<field name="name"/>
<field name="active"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_process_tree">
<field name="name">process.process.tree</field>
<field name="model">process.process</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Process">
<field name="name"/>
<field name="active"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_process_form">
<field name="name">Process</field>
<field name="res_model">process.process</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem
id="menu_process_form"
action="action_process_form"
parent="menu_process"/>
<record model="ir.actions.act_window" id="action_process_form">
<field name="name">Process</field>
<field name="res_model">process.process</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem
id="menu_process_form"
action="action_process_form"
parent="menu_process"/>
<!-- Views for Process Nodes -->
<!-- Transitions -->
<record model="ir.ui.view" id="view_process_node_tree">
<field name="name">process.node.tree</field>
<field name="model">process.node</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Process Node">
<field name="name"/>
<field name="process_id"/>
<field name="flow_start"/>
<field name="kind"/>
<field name="model_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_process_transition_tree">
<field name="name">process.transition.tree</field>
<field name="model">process.transition</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Process Transition">
<field name="name"/>
<field name="source_node_id"/>
<field name="target_node_id"/>
</tree>
</field>
</record>
<record model="ir.ui.view" id="view_process_node_form">
<field name="name">process.node.form</field>
<field name="model">process.node</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Process Node">
<notebook>
<page string="Node Description">
<field name="name" select="1"/>
<newline/>
<field name="process_id" select="1"/>
<field name="flow_start"/>
<field name="kind" select="1"/>
<field name="model_id" select="1"/>
<field name="model_states"/>
<newline/>
<field name="menu_id" select="2"/>
<separator string="Outgoing Transitions" colspan="4"/>
<field name="transition_out" colspan="4" nolabel="1">
<tree string="Outgoing Transitions">
<field name="name"/>
<field name="node_to_id"/>
</tree>
<form string="Outgoing Transitions">
<notebook>
<page string="Description">
<field name="name"/>
<newline/>
<field name="node_from_id"/>
<field name="node_to_id"/>
<field name="note" colspan="4"/>
</page><page string="Transitions">
<field name="action_ids" colspan="4"/>
<field name="transition_ids" colspan="4"/>
</page>
</notebook>
</form>
</field>
</page>
<page string="Extra Information">
<field name="note" nolabel="1" colspan="4"/>
</page>
</notebook>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_process_transition_form">
<field name="name">process.transition.form</field>
<field name="model">process.transition</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Process Transition">
<group string="Details">
<field name="name" select="1"/>
<newline/>
<field name="source_node_id" select="1"/>
<field name="target_node_id" select="1"/>
</group>
<notebook colspan="4">
<page string="Actions">
<field name="action_ids" nolabel="1" colspan="4">
<tree string="Actions">
<field name="name"/>
<field name="state"/>
<field name="action"/>
</tree>
<form string="Actions">
<field name="name" colspan="4"/>
<newline/>
<field name="state"/>
<field name="action"/>
</form>
</field>
</page>
<page string="Roles">
<field name="transition_ids" nolabel="1" colspan="4"/>
</page><page string="Notes">
<field name="note" nolabel="1" colspan="4"/>
</page>
</notebook>
</form>
</field>
</record>
<record model="ir.actions.act_window" id="action_process_node_form">
<field name="name">Process Node</field>
<field name="res_model">process.node</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem
action="action_process_node_form"
parent="menu_process"
id="menu_partner_address_form"/>
<!-- Views for Partners -->
<record model="ir.ui.view" id="view_transition_form">
<field name="name">Process Transitions</field>
<field name="model">process.transition</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Transitions">
<notebook>
<page string="Description">
<field name="name"/>
<newline/>
<field name="node_from_id"/>
<field name="node_to_id"/>
<field name="note" colspan="4"/>
</page><page string="Transitions">
<field name="action_ids" colspan="4">
<tree string="Actions">
<field name="name"/>
<field name="state"/>
<field name="action"/>
</tree>
<form string="Actions">
<field name="name"/>
<newline/>
<field name="state"/>
<field name="action"/>
</form>
</field>
<field name="transition_ids" colspan="4"/>
</page>
</notebook>
</form>
</field>
</record>
<record model="ir.ui.view" id="view_transition_tree">
<field name="name">Process Transitions</field>
<field name="model">process.transition</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Transitions">
<field name="name"/>
<field name="node_from_id"/>
<field name="node_to_id"/>
</tree>
</field>
</record>
<record model="ir.actions.act_window" id="action_transition_open">
<field name="name">Process Transitions</field>
<field name="res_model">process.transition</field>
<field name="view_type">form</field>
</record>
<menuitem
action="action_transition_open"
parent="menu_process"
id="menu_action_transition_open"/>
<record model="ir.actions.act_window" id="action_process_transition_form">
<field name="name">Process Transitions</field>
<field name="res_model">process.transition</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem
id="menu_process_transition_form"
action="action_process_transition_form"
parent="menu_process"/>
</data>
</openerp>
Binary file not shown.
Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 885 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1013 B

-172
View File
@@ -1,172 +0,0 @@
# -*- encoding: utf-8 -*-
import Image
import ImageDraw
import ImageFont
import math
import addons
ROUNDED = 30
BGCOLOR = (228,233,237)
TITLECOLOR = (150,70,70)
FONT = addons.get_module_resource('process', 'report/sb.ttf')
BOXSIZE = (160,120)
size = 800,600
class draw(object):
def _rounding_box(self, x, y, width, height, title=None, bgcolor=BGCOLOR):
d = ImageDraw.Draw(self.img)
DR = ROUNDED/2
d.polygon( (x+DR,y,x+width-DR,y,x+width,y+DR,x+width,y+height-DR,x+width-DR,y+height,x+DR,y+height,x,y+height-DR,x,y+DR), fill=bgcolor)
d.pieslice((x,y,x+ROUNDED,y+ROUNDED),180,270,fill=bgcolor)
d.pieslice((x+width-ROUNDED,y,x+width,y+ROUNDED),270,0,fill=title and TITLECOLOR or bgcolor)
d.pieslice((x+width-ROUNDED,y+height-ROUNDED,x+width,y+height),0,90,fill=bgcolor)
d.pieslice((x,y+height-ROUNDED,x+ROUNDED,y+height),90,180,fill=bgcolor)
if title:
d.polygon( (x+width/5, y, x+width-DR, y, x+width, y+DR, x+width, y+20, x+width/5+15, y+20), fill=TITLECOLOR)
self.draw_text(x+width/5+13, y+4, 10, title, (255,255,255), width*4/5-14)
def node(self, x, y, width, height, title=None, start_color=BGCOLOR):
self._rounding_box(x,y,BOXSIZE[0]-16,BOXSIZE[1], bgcolor=start_color)
self._rounding_box(x+12,y,BOXSIZE[0]-16,BOXSIZE[1], bgcolor=(255,255,255))
self._rounding_box(x+16,y,BOXSIZE[0]-16,BOXSIZE[1], title)
def angle(self, arrow):
if not arrow[1]-arrow[3]:
angle = 180
else:
angle = math.atan(-(arrow[2]-arrow[0]) / (arrow[1]-arrow[3])) * 180 / math.pi
angle = 270 - angle
if arrow[3]<arrow[1]:
angle = 180 + angle
return int(angle)
def arrow(self, arrow):
d = ImageDraw.Draw(self.img)
d.line(arrow, width=1, fill=(0,0,0))
angle = self.angle(arrow)
d.pieslice((arrow[2]-14,arrow[3]-14,arrow[2]+14,arrow[3]+14),angle-18,angle+18,fill=(0,0,0))
def draw_text(self, x, y, size, title, color=(155,255,255), maxlength=None, font_name=FONT, center=False):
d = ImageDraw.Draw(self.img)
font = ImageFont.truetype(font_name, size)
d.setfont(font)
size2 = d.textsize(title)
if maxlength:
fontsize = min(size, size * maxlength / size2[0])
font = ImageFont.truetype(font_name, fontsize)
d.setfont(font)
size = d.textsize(title)
if center:
x = x-size[0]/2
d.text( (x, y+(size2[1]-size[1])/2), title, color)
def arrow_role(self, node_from, node_to, role='Hello'):
d = ImageDraw.Draw(self.img)
x = (node_from[0] + node_to[0]) /2
y = (node_from[1] + node_to[1]) /2
angle = self.angle(node_from+node_to) + 105
d.pieslice((x-40,y-40,x+40,y+40),angle-5,angle+5,fill=(100,0,0))
d.pieslice((x-6,y-6,x+6,y+6),angle-7,angle+7,fill=(255,255,255))
print -180 + angle - 90
x = x + math.cos(angle * math.pi / 180) * 40
y = y + math.sin(angle * math.pi / 180) * 40
a,b = x,y
angle -= 120
x = x + math.cos(angle * math.pi / 180) * 20
y = y + math.sin(angle * math.pi / 180) * 20
d.line((a,b,x,y), width=5, fill=(100,0,0))
angle += 125
d.pieslice((x-30,y-30,x+30,y+30),angle-7,angle+7,fill=(100,0,0))
x = x + math.cos(angle * math.pi / 180) * 50
y = y + math.sin(angle * math.pi / 180) * 50
return (x,y)
def picture(self, x, y, fname):
img = Image.open(fname)
img2 = img.convert('RGBA')
self.img.paste(img2, (max(0,x-img.size[0]/2), max(0,y-img.size[1])), mask=img2)
def __init__(self, img):
self.img = img
class graph(object):
def __init__(self, img):
self.draw = draw(img)
def intersect_one(self, start, stop):
if start[0] < stop[0]:
x1 = start[0] + BOXSIZE[0]/2 + 3
else:
x1 = start[0] - BOXSIZE[0]/2 - 3
if not start[0]-stop[0]:
y1 = 99999999999999
else:
y1 = start[1] - (start[1] - stop[1]) * (start[0]-x1) / (start[0] - stop[0])
if start[1] < stop[1]:
y2 = start[1] + BOXSIZE[1]/2 + 3
else:
y2 = start[1] - BOXSIZE[1]/2 - 3
if not start[1]-stop[1]:
x2 = 99999999999999
else:
x2 = start[0] - (start[0] - stop[0]) * (start[1]-y2) / (start[1] - stop[1])
if abs(start[0]-x1)+abs(start[1]-y1)<abs(start[0]-x2)+abs(y2-start[1]):
return (x1,y1)
return (x2,y2)
def intersect(self, start, stop):
s = self.intersect_one(start,stop)
s2 = self.intersect_one(stop,start)
return s+s2
def node(self, x, y, data, start_color=False):
self.draw.node(x,y,BOXSIZE[0], BOXSIZE[1], data.get('title','Unknown'), start_color and (255,125,125) or BGCOLOR)
self.draw.picture(x+35, y+BOXSIZE[1]-5, addons.get_module_resource('process', 'report/gtk-help.png'))
if start_color:
self.draw.picture(x+65, y+BOXSIZE[1]-5, addons.get_module_resource('process', 'report/gtk-open.png'))
self.draw.picture(x+95, y+BOXSIZE[1]-5, addons.get_module_resource('process', 'report/gtk-print.png'))
y = y+25
menus = data.get('menu','').split('/')
while menus:
menu = menus.pop(0)
if menu:
if menus: menu=menu+' /'
self.draw.draw_text(x+23, y, 10, menu, color=(0,0,0), maxlength=BOXSIZE[0] - 25,
font_name=addons.get_module_resource('process', 'report/ds.ttf'))
y+=15
def arrow_role(self, node_from, node_to, role='Hello'):
start = (node_from[0]+BOXSIZE[0]/2, node_from[1]+BOXSIZE[1]/2)
stop = (node_to[0]+BOXSIZE[0]/2, node_to[1]+BOXSIZE[1]/2)
(x,y) = self.draw.arrow_role(start, stop, role)
self.draw.picture(x, y-3, addons.get_module_resource('process', 'report/role.png'))
self.draw.draw_text(x,y-3, 12, 'Salesman', color=(0,0,0), center=True)
def arrow(self, node_from, node_to):
start = (node_from[0]+BOXSIZE[0]/2, node_from[1]+BOXSIZE[1]/2)
stop = (node_to[0]+BOXSIZE[0]/2, node_to[1]+BOXSIZE[1]/2)
arrow = self.intersect(start,stop)
self.draw.arrow(arrow)
if __name__=='__main__':
img = Image.new('RGB',size,'#ffffff')
g = graph(img)
g.node(50,100,{'title':'SALE AZER ORDER', 'menu':'Sales Management/Sales Orders/My Sales Order/My Open Sales Order'}, start_color=(200,100,100))
g.node(350,150,{'title':'SALE AZER AZE ORDER', 'menu':'Sales Management/Sales Orders/My Quotations'})
g.arrow((50,100),(350,150))
g.arrow_role((50,100),(350,150))
#img.show()
img.save('a.pdf')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-105
View File
@@ -1,105 +0,0 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# $Id: print_instance.py 8595 2008-06-16 13:00:21Z stw $
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import time, os
import netsvc
import report,pooler,tools
import process_print
import Image
class report_graph_instance(object):
def __init__(self, cr, uid, ids, data):
current_object = 'sale.order'
pool = pooler.get_pool(cr.dbname)
for process in pool.get('process.process').browse(cr, uid, ids):
nodes = {}
start = []
transitions = {}
for node in process.node_ids:
nodes[node.id] = node
if node.flow_start:
start.append(node.id)
for tr in node.transition_out:
transitions[tr.id] = tr
g = tools.graph(nodes.keys(), map(lambda x: (x.node_from_id.id,x.node_to_id.id), transitions.values()))
g.process(start)
g.scale(250,250, 100, 10)
img = Image.new('RGB',(1024,768),'#ffffff')
g2 = process_print.graph(img)
positions = g.result
for name,node in positions.items():
start_color = (nodes[name].model_id.model==current_object)
g2.node(node['y'],node['x'], {
'title': nodes[name].name,
'menu': nodes[name].menu_id.complete_name
}, start_color=start_color)
for name,transition in transitions.items():
if transition.transition_ids:
g2.arrow_role((positions[transition.node_from_id.id]['y'], positions[transition.node_from_id.id]['x']),
(positions[transition.node_to_id.id]['y'], positions[transition.node_to_id.id]['x']))
g2.arrow((positions[transition.node_from_id.id]['y'], positions[transition.node_from_id.id]['x']),
(positions[transition.node_to_id.id]['y'], positions[transition.node_to_id.id]['x']))
img.save('/tmp/a.pdf')
self.result = file('/tmp/a.pdf').read()
self.done = True
def is_done(self):
return self.done
def get(self):
if self.done:
return self.result
else:
return None
class report_graph(report.interface.report_int):
def __init__(self, name, table):
report.interface.report_int.__init__(self, name)
self.table = table
def result(self):
if self.obj.is_done():
return (True, self.obj.get(), 'pdf')
else:
return (False, False, False)
def create(self, cr, uid, ids, data, context={}):
self.obj = report_graph_instance(cr, uid, ids, data)
return (self.obj.get(), 'pdf')
report_graph('report.process.process.print', 'process.process')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.
+1
View File
@@ -30,6 +30,7 @@ import product
import pricelist
import report
import partner
import wizard
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+1 -1
View File
@@ -57,7 +57,7 @@
"security/ir.model.access.csv",
"product_data.xml","product_report.xml",
"product_view.xml", "pricelist_view.xml",
"partner_view.xml"],
"partner_view.xml", "product_wizard.xml"],
"active": False,
"installable": True
}
+2 -2
View File
@@ -9,8 +9,8 @@
<field name="arch" type="xml">
<page string="Sales &amp; Purchases" position="inside">
<newline/>
<group col="2" colspan="2">
<separator string="Sales" colspan="2"/>
<group col="2" colspan="2" name="sale_list">
<separator string="Sales Properties" colspan="2"/>
<field name="property_product_pricelist"/>
</group>
</page>
+1 -1
View File
@@ -74,7 +74,7 @@
<field name="tracking"/>
</group>
<group colspan="2" col="2" name="uom">
<group colspan="2" col="2" name="uos" groups="product.group_uos">
<separator string="Second UoM" colspan="2"/>
<field name="uos_id"/>
<field name="uos_coeff"/>
+11
View File
@@ -0,0 +1,11 @@
<?xml version="1.0" ?>
<openerp>
<data>
<wizard
id="report_wizard_price"
string="Price List"
model="product.product"
name="product.price_list"
keyword="client_print_multi"/>
</data>
</openerp>
+1 -1
View File
@@ -27,7 +27,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import product_pricelist
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+127
View File
@@ -0,0 +1,127 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import datetime
from report.interface import report_rml
from report.interface import toxml
import pooler
from osv import osv
import datetime
class report_custom(report_rml):
def create_xml(self, cr, uid, ids, data, context):
pool = pooler.get_pool(cr.dbname)
price_list_id = data['form']['price_list']
product_categ_id =pool.get('product.category').search(cr,uid,[])
currency = pool.get('product.pricelist').read(cr,uid,[price_list_id],['currency_id','name'])[0]
qty =[]
for i in range(1,6):
q = 'qty%d'%i
if data['form'][q]:
qty.append(data['form'][q])
if not qty:
qty.append(1)
product_xml = []
cols = ''
cols = cols+'6cm'
title ='<title name=" Description " number="0" />'
i=1
for q in qty:
cols = cols+',2.5cm'
if q==1:
title+='<title name="%d unit" number="%d"/>'%(q,i)
else:
title+='<title name="%d units" number="%d"/>'%(q,i)
i+=1
date = datetime.date.today()
str_date=date.strftime("%d/%m/%Y")
product_xml.append('<cols>'+cols+'</cols>')
product_xml.append('<pricelist> %s </pricelist>'%currency['name'])
product_xml.append('<currency> %s </currency>'%currency['currency_id'][1])
product_xml.append('<date> %s </date>'%str_date)
product_xml.append("<product>")
for p_categ_id in product_categ_id:
product_ids = pool.get('product.product').search(cr,uid,[('id','in',ids),('categ_id','=',p_categ_id)])
if product_ids:
categ_name = pool.get('product.category').read(cr,uid,[p_categ_id],['name'])
products = pool.get('product.product').read(cr,uid,product_ids,['id','name','code'])
pro = []
i=0
pro.append('<pro name="%s" categ="true">' % (categ_name[0]['name']))
temp = []
for q in qty:
temp.append('<price name=" " />')
pro.extend(temp)
pro.append('</pro>')
for x in products:
#Replacement of special characters with their code html for allowing reporting - Edited by Hasa
x['name'] = x['name'].replace("&","&amp;")
x['name'] = x['name'].replace("\"","&quot;")
if x['code']:
pro.append('<pro name="[%s] %s" >' % (x['code'], x['name']))
else:
pro.append('<pro name="%s" >' % (x['name']))
temp = []
for q in qty:
price_dict = pool.get('product.pricelist').price_get(cr,uid,[price_list_id],x['id'],q)
if price_dict[price_list_id]:
price = price_dict[price_list_id]
else:
res = pool.get('product.product').read(cr, uid,[x['id']])
price = res[0]['list_price']
# temp.append('<price name="%s %s" />'%(price_list[i][x['id']]*q[2]['name'],currency['currency_id'][1]))
temp.append('<price name="%.2f" />'%(price))
i+=1
pro.extend(temp)
pro.append('</pro>')
# categ.extend(pro)
# categ.append('</categ>')
product_xml.extend(pro)
product_xml.append('</product>')
xml = '''<?xml version="1.0" encoding="UTF-8" ?>
<report>
%s
</report>
''' % (title+'\n'.join(product_xml))
return self.post_process_xml_data(cr, uid, xml, context)
report_custom('report.pricelist.pricelist', 'product.product','','addons/product_pricelist_print/report/product_price.xsl')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+104
View File
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<xsl:import href="../../custom/corporate_defaults.xsl" />
<xsl:template match="/">
<xsl:call-template name="rml" />
</xsl:template>
<xsl:template name="rml" match="/">
<document filename="example.pdf">
<template>
<pageTemplate id="first">
<frame id="first" x1="1cm" y1="2.5cm" width="19.0cm" height="23.0cm"/>
<pageGraphics>
<xsl:apply-imports />
</pageGraphics>
</pageTemplate>
</template>
<stylesheet>
<paraStyle name="normal" fontName="Times-Roman" fontSize="12" />
<paraStyle name="title" fontName="Times-Bold" fontSize="15" alignment="center" />
<paraStyle name="table_title" fontName="Times-Bold" fontSize="12" alignment="center" />
<paraStyle name="product1" fontName="Times-Roman" fontSize="8" />
<paraStyle name="categ" fontName="Times-Bold" fontSize="10" textColor="blue"/>
<paraStyle name="price" fontName="Times-Roman" fontSize="8" alignment="right" />
<blockTableStyle id="main_title">
<blockAlignment value="CENTER" />
<lineStyle kind="GRID" colorName="black"/>
<blockBackground colorName="#e6e6e6" />
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="product">
<blockAlignment value="LEFT" />
<xsl:for-each select="/report/title">
<xsl:variable name="col" select="attribute::number" />
<blockBackground>
<xsl:attribute name="colorName">#e6e6e6</xsl:attribute>
<xsl:attribute name="start">
<xsl:value-of select="$col" />
<xsl:text>,0</xsl:text>
</xsl:attribute>
<xsl:attribute name="stop">
<xsl:value-of select="$col" />
<xsl:text>,0</xsl:text>
</xsl:attribute>
</blockBackground>
</xsl:for-each>
<lineStyle kind="LINEABOVE" colorName="black" start="0,0" stop="-1,-1" />
<lineStyle kind="LINEBEFORE" colorName="black" start="0,0" stop="-1,-1"/>
<lineStyle kind="LINEAFTER" colorName="black" start="-1,0" stop="-1,-1"/>
<lineStyle kind="LINEBELOW" colorName="black" start="0,-1" stop="-1,-1"/>
<blockValign value="TOP"/>
</blockTableStyle>
</stylesheet >
<story>
<xsl:call-template name="story"/>
</story>
</document>
</xsl:template>
<xsl:template name="story">
<spacer length="1cm" />
<blockTable rowHeights="1cm">
<xsl:attribute name="style">main_title</xsl:attribute>
<tr> <td> <para style="title" t="1">Products Price List</para> </td> </tr>
</blockTable>
<spacer length="1cm" />
<para style="normal" t="1">Price List Name :<xsl:value-of select="report/pricelist" /></para>
<para style="normal" t="1">Currency : <xsl:value-of select="report/currency" /></para>
<para style="normal" t="1">Printing Date : <xsl:value-of select="report/date" /></para>
<spacer length="0.7cm" />
<blockTable>
<xsl:attribute name="style">product</xsl:attribute>
<xsl:attribute name="colWidths"><xsl:value-of select="report/cols" /></xsl:attribute>
<tr>
<xsl:for-each select="report/title" >
<td><para style="table_title"> <xsl:value-of select="attribute::name" /> </para></td>
</xsl:for-each>
</tr>
<xsl:for-each select="report/product/pro" >
<tr>
<xsl:choose>
<xsl:when test="@categ">
<td> <para style="categ"><xsl:value-of select="attribute::name" /> </para> </td>
</xsl:when>
<xsl:otherwise>
<td> <para style="product1"> <xsl:value-of select="attribute::name" /> </para> </td>
</xsl:otherwise>
</xsl:choose>
<xsl:for-each select="price" >
<td><para style="price"> <xsl:value-of select="attribute::name" /> </para> </td>
</xsl:for-each>
</tr>
</xsl:for-each>
</blockTable>
</xsl:template>
</xsl:stylesheet>
+156
View File
@@ -0,0 +1,156 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import time
from report import report_sxw
from osv import osv
import pooler
parents = {
'tr':1,
'li':1,
'story': 0,
'section': 0
}
class product_pricelist(report_sxw.rml_parse):
def __init__(self, cr, uid, name, context):
super(product_pricelist, self).__init__(cr, uid, name, context)
self.pricelist=False
self.quantity=[]
self.localcontext.update({
'time': time,
'get_pricelist': self._get_pricelist,
'get_currency': self._get_currency,
'get_categories': self._get_categories,
'get_price': self._get_price,
'get_quantity':self._get_quantity,
'qty_header':self._qty_header,
})
def _qty_header(self,form):
qty=[]
self.pricelist=form['price_list']
for i in range(1,6):
q = 'qty%d'%i
if form[q]:
self.quantity.append(form[q])
if form[q]==1:
qty.append('%d unit'%(form[q]))
else:
qty.append('%d units'%(form[q]))
return qty
def _get_quantity(self,form):
qty=[]
for i in range(1,6):
q = 'qty%d'%i
if form[q]:
qty.append(form[q])
return qty
def _get_pricelist(self, pricelist_id):
pool = pooler.get_pool(self.cr.dbname)
pricelist = pool.get('product.pricelist').read(self.cr,self.uid,[pricelist_id],['name'])[0]
return pricelist['name']
def _get_currency(self, pricelist_id):
pool = pooler.get_pool(self.cr.dbname)
pricelist = pool.get('product.pricelist').read(self.cr,self.uid,[pricelist_id],['currency_id'])[0]
return pricelist['currency_id'][1]
def _get_categories(self, products):
cat_ids=[]
res=[]
pool = pooler.get_pool(self.cr.dbname)
pro_ids=[]
for product in products:
pro_ids.append(product.id)
if product.categ_id.id not in cat_ids:
cat_ids.append(product.categ_id.id)
cats=pool.get('product.category').browse(self.cr,self.uid,cat_ids)
for cat in cats:
product_ids=pool.get('product.product').search(self.cr,self.uid,[('id','in',pro_ids),('categ_id','=',cat.id)])
products = []
for product in pool.get('product.product').browse(self.cr,self.uid,product_ids):
val={
'id':product.id,
'name':product.name,
'code':product.code
}
for qty in self.quantity:
val[str(qty)]=self._get_price(self.pricelist,product.id,qty)
products.append(val)
res.append({'name':cat.name,'products':products})
return res
def _get_price(self,pricelist_id, product_id,qty):
pool = pooler.get_pool(self.cr.dbname)
price_dict = pool.get('product.pricelist').price_get(self.cr,self.uid,[pricelist_id],product_id,qty)
if price_dict[pricelist_id]:
price = self.formatLang(price_dict[pricelist_id])
else:
res = pool.get('product.product').read(self.cr, self.uid,[product_id])
price = self.formatLang(res[0]['list_price'])
return price
def repeatIn(self, lst, name, nodes_parent=False,value=[],width=False,type=False):
self._node.data = ''
node = self._find_parent(self._node, nodes_parent or parents)
ns = node.nextSibling
if not lst:
lst.append(1)
for ns in node.childNodes :
if ns and ns.nodeName!='#text' and ns.tagName=='blockTable' and len(value) :
width_str = ns._attrs['colWidths'].nodeValue
ns.removeAttribute('colWidths')
if not width or width=='':
width=30
if type.lower() in ('title'):
width=width*len(value)
width_str= '%d'%(float(width_str)+width)
ns.setAttribute('colWidths',width_str)
else:
for v in value:
width_str +=',%d'%width
ns.setAttribute('colWidths',width_str)
child_list = ns.childNodes
for child in child_list:
if child.nodeName=='tr':
lc = child.childNodes[1]
t=0
for v in value:
newnode = lc.cloneNode(1)
if type.lower() in ('string'):
newnode.childNodes[1].lastChild.data="[[ %s['%s'] ]]"%(name,v)
elif type.lower() in ('label'):
newnode.childNodes[1].lastChild.data= "%s"%(v)
child.appendChild(newnode)
newnode=False
return super(product_pricelist,self).repeatIn(lst, name, nodes_parent=False)
#end
report_sxw.report_sxw('report.product.pricelist','product.product','addons/product_pricelist_print/report/product_pricelist.rml',parser=product_pricelist)
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+115
View File
@@ -0,0 +1,115 @@
<?xml version="1.0"?>
<document filename="test.pdf">
<template pageSize="(595.0,842.0)" title="Test" author="Martin Simon" allowSplitting="20">
<pageTemplate id="first">
<frame id="first" x1="57.0" y1="57.0" width="481" height="728"/>
</pageTemplate>
</template>
<stylesheet>
<blockTableStyle id="Standard_Outline">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
</blockTableStyle>
<blockTableStyle id="Table1">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<blockBackground colorName="#e6e6e6" start="0,0" stop="0,0"/>
<lineStyle kind="GRID" colorName="black"/>
</blockTableStyle>
<blockTableStyle id="Table6">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<blockBackground colorName="#e6e6e6" />
<lineStyle kind="GRID" colorName="black"/>
</blockTableStyle>
<blockTableStyle id="Table3">
<blockAlignment value="LEFT"/>
<blockValign value="TOP"/>
<lineStyle kind="GRID" colorName="black"/>
</blockTableStyle>
<initialize>
<paraStyle name="all" alignment="justify"/>
</initialize>
<paraStyle name="P1" fontName="Times-Roman" fontSize="9.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P2" fontName="Times-Roman" fontSize="9.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P3" fontName="Times-Roman" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P4" fontName="Times-Roman" alignment="CENTER"/>
<paraStyle name="P5" fontName="Times-Roman" fontSize="8.0" leading="10"/>
<paraStyle name="P6" fontName="Times-Bold" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P7" fontName="Times-Roman" alignment="LEFT"/>
<paraStyle name="P8" fontName="Times-Roman" fontSize="20.0" leading="25" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P9" fontName="Times-Roman" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P10" fontName="Times-Roman" fontSize="8.0" leading="10" alignment="RIGHT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P11" fontName="Times-Roman" fontSize="8.0" leading="10" alignment="LEFT" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="P12" fontName="Times-Roman" fontSize="11.0" leading="14" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Standard" fontName="Times-Roman" fontSize="12"/>
<paraStyle name="Text body" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="List" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Contents" fontName="Times-Roman" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Table Heading" fontName="Times-Roman" alignment="CENTER" spaceBefore="0.0" spaceAfter="6.0"/>
<paraStyle name="Caption" fontName="Times-Roman" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
<paraStyle name="Index" fontName="Times-Roman"/>
<paraStyle name="cat" fontName="Times-Bold" textColor="blue" fontSize="10.0" leading="13" spaceBefore="6.0" spaceAfter="6.0"/>
</stylesheet>
<story>
<para style="P5">
<font color="white"> </font>
</para>
<blockTable colWidths="530.0" repeatRows="1" style="Table1">
<tr>
<td>
<para style="P8">Products Price List</para>
</td>
</tr>
</blockTable>
<para style="P5">
<font color="white"> </font>
</para>
<para style="Standard">
<font color="white"> </font>
</para>
<para style="Standard">Price List Name : [[ get_pricelist (data['form']['price_list']) ]]</para>
<para style="Standard">Currency : [[ get_currency ( data['form']['price_list']) ]]</para>
<para style="Standard">Printing Date: [[ formatLang(time.strftime('%Y-%m-%d'), date=True) ]]</para>
<para style="P7">
<font color="white"> </font>
</para>
<section>
<para style="P6">[[repeatIn([],'qty_header',width=59,value=qty_header(data['form']),type='label') ]]</para>
<blockTable colWidths="227.0" style="Table6">
<tr>
<td>
<para style="P6">Description</para>
</td>
</tr>
</blockTable>
</section>
<section>
<para style="Standard">[[ repeatIn(get_categories(objects), 'c',width=59,value=get_quantity(data['form']),type='title') ]]</para>
<blockTable colWidths="227.0" style="Table3">
<tr>
<td>
<para style="cat">[[ c['name'] ]]</para>
</td>
</tr>
</blockTable>
<section>
<para style="Standard">[[repeatIn(c['products'], 'p',width=59,value=get_quantity(data['form']),type='string') ]]</para>
<blockTable colWidths="227.0" style="Table3">
<tr>
<td>
<para style="P1">[[ p['code'] and '[' + p['code'] + '] ' or '' ]] [[ p['name'] ]]</para>
</td>
</tr>
</blockTable>
</section>
</section>
<para style="P5"/>
<para style="P3">
<font color="white"> </font>
</para>
</story>
</document>
@@ -1,9 +1,8 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2004-2008 TINY SPRL. (http://tiny.be) All Rights Reserved.
#
# $Id$
# Copyright (c) 2004 TINY SPRL. (http://tiny.be) All Rights Reserved.
# Fabien Pinckaers <fp@tiny.Be>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
@@ -27,8 +26,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import report_stock
import wizard_price
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+67
View File
@@ -0,0 +1,67 @@
# -*- encoding: utf-8 -*-
##############################################################################
#
# Copyright (c) 2005-2006 TINY SPRL. (http://tiny.be) All Rights Reserved.
# Fabien Pinckaers <fp@tiny.Be>
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsability of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# garantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import wizard
qty1_form = '''<?xml version="1.0"?>
<form string="Price list">
<field name="price_list" />
<field name="qty1" colspan="2" />
<field name="qty2" colspan="2" />
<field name="qty3" colspan="2" />
<field name="qty4" colspan="2" />
<field name="qty5" colspan="2" />
</form>'''
qty1_fields = {
'price_list' : {'string' : 'PriceList', 'type' : 'many2one', 'relation' : 'product.pricelist', 'required':True },
'qty1': {'string':'Quantity-1', 'type':'integer', 'default':0},
'qty2': {'string':'Quantity-2', 'type':'integer', 'default':0},
'qty3': {'string':'Quantity-3', 'type':'integer', 'default':0},
'qty4': {'string':'Quantity-4', 'type':'integer', 'default':0},
'qty5': {'string':'Quantity-5', 'type':'integer', 'default':0},
}
class wizard_qty(wizard.interface):
states = {
'init': {
'actions': [],
'result': {'type':'form', 'arch':qty1_form, 'fields':qty1_fields, 'state':[('end','Cancel'),('price','Print')]}
},
'price': {
'actions': [],
'result': {'type':'print', 'report':'product.pricelist', 'state':'end'}
}
}
wizard_qty('product.price_list')
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -30,8 +30,8 @@ from osv import fields, osv
import pooler
class config_install_extra_modules(osv.osv_memory):
_name='config.install_extra_modules.mrp'
class profile_manufacturing_config_install_modules_wizard(osv.osv_memory):
_name='profile.manufacturing.config.install_modules_wizard'
_columns = {
'mrp_jit':fields.boolean('Just in Time Scheduling',
help="The JIT module allows you to not run the scheduler "\
@@ -94,7 +94,7 @@ class config_install_extra_modules(osv.osv_memory):
'type': 'ir.actions.act_window',
'target':'new',
}
config_install_extra_modules()
profile_manufacturing_config_install_modules_wizard()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+4 -3
View File
@@ -6,13 +6,14 @@
<field name="model">res.partner</field>
<field name="type">form</field>
<field name="inherit_id" ref="base.view_partner_form"/>
<field name="priority">36</field>
<field name="arch" type="xml">
<page string="Sales &amp; Purchases" position="inside">
<group name="sale_list" position="after">
<group colspan="2" col="2">
<separator string="Purchases" colspan="2"/>
<separator string="Purchases Properties" colspan="2"/>
<field name="property_product_pricelist_purchase"/>
</group>
</page>
</group>
</field>
</record>
+15 -3
View File
@@ -86,6 +86,18 @@ class purchase_order(osv.osv):
res[id] = cur_obj.round(cr, uid, cur, untax.get(id, 0.0) + tax.get(id, 0.0))
return res
def _set_minimum_planned_date(self, cr, uid, ids, name, value, arg, context):
if not value: return False
if type(ids)!=type([]):
ids=[ids]
for po in self.browse(cr, uid, ids, context):
cr.execute("""update purchase_order_line set
date_planned=%s
where
order_id=%d and
(date_planned=%s or date_planned<%s)""", (value,po.id,po.minimum_planned_date,value))
return True
def _minimum_planned_date(self, cr, uid, ids, field_name, arg, context):
res={}
purchase_obj=self.browse(cr, uid, ids, context=context)
@@ -166,7 +178,7 @@ class purchase_order(osv.osv):
'invoiced':fields.boolean('Invoiced & Paid', readonly=True, select=True),
'invoiced_rate': fields.function(_invoiced_rate, method=True, string='Invoiced', type='float'),
'invoice_method': fields.selection([('manual','Manual'),('order','From order'),('picking','From picking')], 'Invoicing Control', required=True),
'minimum_planned_date':fields.function(_minimum_planned_date, method=True,store=True, string='Planned Date', type='date', help="This is computed as the minimum scheduled date of all purchase order lines' products."),
'minimum_planned_date':fields.function(_minimum_planned_date, fnct_inv=_set_minimum_planned_date, method=True,store=True, string='Planned Date', type='datetime', help="This is computed as the minimum scheduled date of all purchase order lines' products."),
'amount_untaxed': fields.function(_amount_untaxed, method=True, string='Untaxed Amount'),
'amount_tax': fields.function(_amount_tax, method=True, string='Taxes'),
'amount_total': fields.function(_amount_total, method=True, string='Total'),
@@ -370,7 +382,7 @@ class purchase_order_line(osv.osv):
_columns = {
'name': fields.char('Description', size=64, required=True),
'product_qty': fields.float('Quantity', required=True, digits=(16,2)),
'date_planned': fields.date('Scheduled date', required=True),
'date_planned': fields.datetime('Scheduled date', required=True),
'taxes_id': fields.many2many('account.tax', 'purchase_order_taxe', 'ord_id', 'tax_id', 'Taxes'),
'product_uom': fields.many2one('product.uom', 'Product UOM', required=True),
'product_id': fields.many2one('product.product', 'Product', domain=[('purchase_ok','=',True)], change_default=True),
@@ -416,7 +428,7 @@ class purchase_order_line(osv.osv):
'uom': uom,
'date': date_order,
})[pricelist]
dt = (DateTime.now() + DateTime.RelativeDateTime(days=prod['seller_delay'] or 0.0)).strftime('%Y-%m-%d')
dt = (DateTime.now() + DateTime.RelativeDateTime(days=prod['seller_delay'] or 0.0)).strftime('%Y-%m-%d %H:%M:%S')
prod_name = self.pool.get('product.product').name_get(cr, uid, [product], context=context)[0][1]
res = {'value': {'price_unit': price, 'name':prod_name, 'taxes_id':prod['supplier_taxes_id'], 'date_planned': dt,'notes':prod['description_purchase'], 'product_uom': uom}}
+11 -11
View File
@@ -16,17 +16,17 @@
</calendar>
</field>
</record>
<record model="ir.ui.view" id="view_purchase_order_graph">
<field name="name">purchase.order.graph</field>
<field name="model">purchase.order</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Purchase Order" type="bar">
<field name="partner_id"/>
<field name="amount_total" operator="+"/>
</graph>
</field>
</record>
<record model="ir.ui.view" id="view_purchase_order_graph">
<field name="name">purchase.order.graph</field>
<field name="model">purchase.order</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Purchase Order" type="bar">
<field name="partner_id"/>
<field name="amount_total" operator="+"/>
</graph>
</field>
</record>
<record id="purchase_order_form" model="ir.ui.view">
<field name="name">purchase.order.form</field>
+1 -1
View File
@@ -31,7 +31,7 @@
"version" : "1.0",
"author" : "Tiny",
"website" : "http://tinyerp.com",
"depends" : ["base", "product", "stock", "sale", "purchase", "report_stock"],
"depends" : ["base", "product", "stock", "sale", "purchase"],
"category" : "Generic Modules/Inventory Control",
"description": "A module that adds intrastat reports.",
"init_xml" : ["report_intrastat_data.xml",],
-75
View File
@@ -1,75 +0,0 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * report_stock
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 4.3.0"
"Report-Msgid-Bugs-To: support@openerp.com"
"POT-Creation-Date: 2008-09-11 15:40:34+0000"
"PO-Revision-Date: 2008-09-11 15:40:34+0000"
"Last-Translator: <>"
"Language-Team: "
"MIME-Version: 1.0"
"Content-Type: text/plain; charset=UTF-8"
"Content-Transfer-Encoding: "
"Plural-Forms: "
#. module: report_stock
#: field:report.stock.prodlots,prodlot_id:0
msgid "Production lot"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_62
msgid "Traceability"
msgstr ""
#. module: report_stock
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_61
msgid "Reporting"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,product_id:0
msgid "Product"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_product_product_2_report_stock_prodlots
#: model:ir.actions.act_window,name:report_stock.act_stock_location_2_report_stock_prodlots
#: model:ir.ui.menu,name:report_stock.menu_report_stock_prodlots
#: view:report.stock.prodlots:0
msgid "Stock by production lots"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_stock_production_lot_2_report_stock_prodlots
msgid "Stock"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,location_id:0
msgid "Location"
msgstr ""
#. module: report_stock
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: report_stock
#: model:ir.model,name:report_stock.model_report_stock_prodlots
msgid "Stock report by production lots"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,name:0
msgid "Quantity"
msgstr ""
-75
View File
@@ -1,75 +0,0 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * report_stock
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 4.3.0"
"Report-Msgid-Bugs-To: support@openerp.com"
"POT-Creation-Date: 2008-09-11 15:38:50+0000"
"PO-Revision-Date: 2008-09-11 15:38:50+0000"
"Last-Translator: <>"
"Language-Team: "
"MIME-Version: 1.0"
"Content-Type: text/plain; charset=UTF-8"
"Content-Transfer-Encoding: "
"Plural-Forms: "
#. module: report_stock
#: field:report.stock.prodlots,prodlot_id:0
msgid "Production lot"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_62
msgid "Traceability"
msgstr ""
#. module: report_stock
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_61
msgid "Reporting"
msgstr "Berichtswesen"
#. module: report_stock
#: field:report.stock.prodlots,product_id:0
msgid "Product"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_product_product_2_report_stock_prodlots
#: model:ir.actions.act_window,name:report_stock.act_stock_location_2_report_stock_prodlots
#: model:ir.ui.menu,name:report_stock.menu_report_stock_prodlots
#: view:report.stock.prodlots:0
msgid "Stock by production lots"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_stock_production_lot_2_report_stock_prodlots
msgid "Stock"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,location_id:0
msgid "Location"
msgstr ""
#. module: report_stock
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: report_stock
#: model:ir.model,name:report_stock.model_report_stock_prodlots
msgid "Stock report by production lots"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,name:0
msgid "Quantity"
msgstr ""
-75
View File
@@ -1,75 +0,0 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * report_stock
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 4.3.0"
"Report-Msgid-Bugs-To: support@openerp.com"
"POT-Creation-Date: 2008-09-11 15:44:00+0000"
"PO-Revision-Date: 2008-09-11 15:44:00+0000"
"Last-Translator: <>"
"Language-Team: "
"MIME-Version: 1.0"
"Content-Type: text/plain; charset=UTF-8"
"Content-Transfer-Encoding: "
"Plural-Forms: "
#. module: report_stock
#: field:report.stock.prodlots,prodlot_id:0
msgid "Production lot"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_62
msgid "Traceability"
msgstr "Trazabilidad"
#. module: report_stock
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_61
msgid "Reporting"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,product_id:0
msgid "Product"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_product_product_2_report_stock_prodlots
#: model:ir.actions.act_window,name:report_stock.act_stock_location_2_report_stock_prodlots
#: model:ir.ui.menu,name:report_stock.menu_report_stock_prodlots
#: view:report.stock.prodlots:0
msgid "Stock by production lots"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_stock_production_lot_2_report_stock_prodlots
msgid "Stock"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,location_id:0
msgid "Location"
msgstr ""
#. module: report_stock
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: report_stock
#: model:ir.model,name:report_stock.model_report_stock_prodlots
msgid "Stock report by production lots"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,name:0
msgid "Quantity"
msgstr ""
-75
View File
@@ -1,75 +0,0 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * report_stock
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 4.3.0"
"Report-Msgid-Bugs-To: support@openerp.com"
"POT-Creation-Date: 2008-09-11 15:41:08+0000"
"PO-Revision-Date: 2008-09-11 15:41:08+0000"
"Last-Translator: <>"
"Language-Team: "
"MIME-Version: 1.0"
"Content-Type: text/plain; charset=UTF-8"
"Content-Transfer-Encoding: "
"Plural-Forms: "
#. module: report_stock
#: field:report.stock.prodlots,prodlot_id:0
msgid "Production lot"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_62
msgid "Traceability"
msgstr "Trazabilidad"
#. module: report_stock
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_61
msgid "Reporting"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,product_id:0
msgid "Product"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_product_product_2_report_stock_prodlots
#: model:ir.actions.act_window,name:report_stock.act_stock_location_2_report_stock_prodlots
#: model:ir.ui.menu,name:report_stock.menu_report_stock_prodlots
#: view:report.stock.prodlots:0
msgid "Stock by production lots"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_stock_production_lot_2_report_stock_prodlots
msgid "Stock"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,location_id:0
msgid "Location"
msgstr ""
#. module: report_stock
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: report_stock
#: model:ir.model,name:report_stock.model_report_stock_prodlots
msgid "Stock report by production lots"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,name:0
msgid "Quantity"
msgstr ""
-75
View File
@@ -1,75 +0,0 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * report_stock
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 4.3.0"
"Report-Msgid-Bugs-To: support@openerp.com"
"POT-Creation-Date: 2008-09-11 15:41:43+0000"
"PO-Revision-Date: 2008-09-11 15:41:43+0000"
"Last-Translator: <>"
"Language-Team: "
"MIME-Version: 1.0"
"Content-Type: text/plain; charset=UTF-8"
"Content-Transfer-Encoding: "
"Plural-Forms: "
#. module: report_stock
#: field:report.stock.prodlots,prodlot_id:0
msgid "Production lot"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_62
msgid "Traceability"
msgstr "Traçabilités"
#. module: report_stock
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_61
msgid "Reporting"
msgstr "Reporting"
#. module: report_stock
#: field:report.stock.prodlots,product_id:0
msgid "Product"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_product_product_2_report_stock_prodlots
#: model:ir.actions.act_window,name:report_stock.act_stock_location_2_report_stock_prodlots
#: model:ir.ui.menu,name:report_stock.menu_report_stock_prodlots
#: view:report.stock.prodlots:0
msgid "Stock by production lots"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_stock_production_lot_2_report_stock_prodlots
msgid "Stock"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,location_id:0
msgid "Location"
msgstr ""
#. module: report_stock
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: report_stock
#: model:ir.model,name:report_stock.model_report_stock_prodlots
msgid "Stock report by production lots"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,name:0
msgid "Quantity"
msgstr ""
-75
View File
@@ -1,75 +0,0 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * report_stock
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 4.3.0"
"Report-Msgid-Bugs-To: support@openerp.com"
"POT-Creation-Date: 2008-09-11 15:44:35+0000"
"PO-Revision-Date: 2008-09-11 15:44:35+0000"
"Last-Translator: <>"
"Language-Team: "
"MIME-Version: 1.0"
"Content-Type: text/plain; charset=UTF-8"
"Content-Transfer-Encoding: "
"Plural-Forms: "
#. module: report_stock
#: field:report.stock.prodlots,prodlot_id:0
msgid "Production lot"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_62
msgid "Traceability"
msgstr ""
#. module: report_stock
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_61
msgid "Reporting"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,product_id:0
msgid "Product"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_product_product_2_report_stock_prodlots
#: model:ir.actions.act_window,name:report_stock.act_stock_location_2_report_stock_prodlots
#: model:ir.ui.menu,name:report_stock.menu_report_stock_prodlots
#: view:report.stock.prodlots:0
msgid "Stock by production lots"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_stock_production_lot_2_report_stock_prodlots
msgid "Stock"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,location_id:0
msgid "Location"
msgstr ""
#. module: report_stock
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: report_stock
#: model:ir.model,name:report_stock.model_report_stock_prodlots
msgid "Stock report by production lots"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,name:0
msgid "Quantity"
msgstr ""
-75
View File
@@ -1,75 +0,0 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * report_stock
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 4.3.0"
"Report-Msgid-Bugs-To: support@openerp.com"
"POT-Creation-Date: 2008-09-11 15:36:31+0000"
"PO-Revision-Date: 2008-09-11 15:36:31+0000"
"Last-Translator: <>"
"Language-Team: "
"MIME-Version: 1.0"
"Content-Type: text/plain; charset=UTF-8"
"Content-Transfer-Encoding: "
"Plural-Forms: "
#. module: report_stock
#: field:report.stock.prodlots,prodlot_id:0
msgid "Production lot"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_62
msgid "Traceability"
msgstr "Tracciatura"
#. module: report_stock
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_61
msgid "Reporting"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,product_id:0
msgid "Product"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_product_product_2_report_stock_prodlots
#: model:ir.actions.act_window,name:report_stock.act_stock_location_2_report_stock_prodlots
#: model:ir.ui.menu,name:report_stock.menu_report_stock_prodlots
#: view:report.stock.prodlots:0
msgid "Stock by production lots"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_stock_production_lot_2_report_stock_prodlots
msgid "Stock"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,location_id:0
msgid "Location"
msgstr ""
#. module: report_stock
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: report_stock
#: model:ir.model,name:report_stock.model_report_stock_prodlots
msgid "Stock report by production lots"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,name:0
msgid "Quantity"
msgstr ""
-75
View File
@@ -1,75 +0,0 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * report_stock
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 4.3.0"
"Report-Msgid-Bugs-To: support@openerp.com"
"POT-Creation-Date: 2008-09-11 15:40:00+0000"
"PO-Revision-Date: 2008-09-11 15:40:00+0000"
"Last-Translator: <>"
"Language-Team: "
"MIME-Version: 1.0"
"Content-Type: text/plain; charset=UTF-8"
"Content-Transfer-Encoding: "
"Plural-Forms: "
#. module: report_stock
#: field:report.stock.prodlots,prodlot_id:0
msgid "Production lot"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_62
msgid "Traceability"
msgstr "Traceerbaarheid"
#. module: report_stock
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_61
msgid "Reporting"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,product_id:0
msgid "Product"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_product_product_2_report_stock_prodlots
#: model:ir.actions.act_window,name:report_stock.act_stock_location_2_report_stock_prodlots
#: model:ir.ui.menu,name:report_stock.menu_report_stock_prodlots
#: view:report.stock.prodlots:0
msgid "Stock by production lots"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_stock_production_lot_2_report_stock_prodlots
msgid "Stock"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,location_id:0
msgid "Location"
msgstr ""
#. module: report_stock
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: report_stock
#: model:ir.model,name:report_stock.model_report_stock_prodlots
msgid "Stock report by production lots"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,name:0
msgid "Quantity"
msgstr ""
-75
View File
@@ -1,75 +0,0 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * report_stock
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 4.3.0"
"Report-Msgid-Bugs-To: support@openerp.com"
"POT-Creation-Date: 2008-09-11 15:38:15+0000"
"PO-Revision-Date: 2008-09-11 15:38:15+0000"
"Last-Translator: <>"
"Language-Team: "
"MIME-Version: 1.0"
"Content-Type: text/plain; charset=UTF-8"
"Content-Transfer-Encoding: "
"Plural-Forms: "
#. module: report_stock
#: field:report.stock.prodlots,prodlot_id:0
msgid "Production lot"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_62
msgid "Traceability"
msgstr ""
#. module: report_stock
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_61
msgid "Reporting"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,product_id:0
msgid "Product"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_product_product_2_report_stock_prodlots
#: model:ir.actions.act_window,name:report_stock.act_stock_location_2_report_stock_prodlots
#: model:ir.ui.menu,name:report_stock.menu_report_stock_prodlots
#: view:report.stock.prodlots:0
msgid "Stock by production lots"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_stock_production_lot_2_report_stock_prodlots
msgid "Stock"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,location_id:0
msgid "Location"
msgstr ""
#. module: report_stock
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: report_stock
#: model:ir.model,name:report_stock.model_report_stock_prodlots
msgid "Stock report by production lots"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,name:0
msgid "Quantity"
msgstr ""
-75
View File
@@ -1,75 +0,0 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * report_stock
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 4.3.0"
"Report-Msgid-Bugs-To: support@openerp.com"
"POT-Creation-Date: 2008-09-11 15:42:18+0000"
"PO-Revision-Date: 2008-09-11 15:42:18+0000"
"Last-Translator: <>"
"Language-Team: "
"MIME-Version: 1.0"
"Content-Type: text/plain; charset=UTF-8"
"Content-Transfer-Encoding: "
"Plural-Forms: "
#. module: report_stock
#: field:report.stock.prodlots,prodlot_id:0
msgid "Production lot"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_62
msgid "Traceability"
msgstr "Rastreabilidade"
#. module: report_stock
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_61
msgid "Reporting"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,product_id:0
msgid "Product"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_product_product_2_report_stock_prodlots
#: model:ir.actions.act_window,name:report_stock.act_stock_location_2_report_stock_prodlots
#: model:ir.ui.menu,name:report_stock.menu_report_stock_prodlots
#: view:report.stock.prodlots:0
msgid "Stock by production lots"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_stock_production_lot_2_report_stock_prodlots
msgid "Stock"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,location_id:0
msgid "Location"
msgstr ""
#. module: report_stock
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: report_stock
#: model:ir.model,name:report_stock.model_report_stock_prodlots
msgid "Stock report by production lots"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,name:0
msgid "Quantity"
msgstr ""
-75
View File
@@ -1,75 +0,0 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * report_stock
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 4.3.0"
"Report-Msgid-Bugs-To: support@openerp.com"
"POT-Creation-Date: 2008-09-11 15:45:09+0000"
"PO-Revision-Date: 2008-09-11 15:45:09+0000"
"Last-Translator: <>"
"Language-Team: "
"MIME-Version: 1.0"
"Content-Type: text/plain; charset=UTF-8"
"Content-Transfer-Encoding: "
"Plural-Forms: "
#. module: report_stock
#: field:report.stock.prodlots,prodlot_id:0
msgid "Production lot"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_62
msgid "Traceability"
msgstr ""
#. module: report_stock
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_61
msgid "Reporting"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,product_id:0
msgid "Product"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_product_product_2_report_stock_prodlots
#: model:ir.actions.act_window,name:report_stock.act_stock_location_2_report_stock_prodlots
#: model:ir.ui.menu,name:report_stock.menu_report_stock_prodlots
#: view:report.stock.prodlots:0
msgid "Stock by production lots"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_stock_production_lot_2_report_stock_prodlots
msgid "Stock"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,location_id:0
msgid "Location"
msgstr ""
#. module: report_stock
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: report_stock
#: model:ir.model,name:report_stock.model_report_stock_prodlots
msgid "Stock report by production lots"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,name:0
msgid "Quantity"
msgstr ""
-75
View File
@@ -1,75 +0,0 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * report_stock
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 4.3.0"
"Report-Msgid-Bugs-To: support@openerp.com"
"POT-Creation-Date: 2008-09-11 15:43:26+0000"
"PO-Revision-Date: 2008-09-11 15:43:26+0000"
"Last-Translator: <>"
"Language-Team: "
"MIME-Version: 1.0"
"Content-Type: text/plain; charset=UTF-8"
"Content-Transfer-Encoding: "
"Plural-Forms: "
#. module: report_stock
#: field:report.stock.prodlots,prodlot_id:0
msgid "Production lot"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_62
msgid "Traceability"
msgstr ""
#. module: report_stock
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_61
msgid "Reporting"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,product_id:0
msgid "Product"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_product_product_2_report_stock_prodlots
#: model:ir.actions.act_window,name:report_stock.act_stock_location_2_report_stock_prodlots
#: model:ir.ui.menu,name:report_stock.menu_report_stock_prodlots
#: view:report.stock.prodlots:0
msgid "Stock by production lots"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_stock_production_lot_2_report_stock_prodlots
msgid "Stock"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,location_id:0
msgid "Location"
msgstr ""
#. module: report_stock
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: report_stock
#: model:ir.model,name:report_stock.model_report_stock_prodlots
msgid "Stock report by production lots"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,name:0
msgid "Quantity"
msgstr ""
-75
View File
@@ -1,75 +0,0 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * report_stock
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 4.3.0"
"Report-Msgid-Bugs-To: support@openerp.com"
"POT-Creation-Date: 2008-09-11 15:42:52+0000"
"PO-Revision-Date: 2008-09-11 15:42:52+0000"
"Last-Translator: <>"
"Language-Team: "
"MIME-Version: 1.0"
"Content-Type: text/plain; charset=UTF-8"
"Content-Transfer-Encoding: "
"Plural-Forms: "
#. module: report_stock
#: field:report.stock.prodlots,prodlot_id:0
msgid "Production lot"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_62
msgid "Traceability"
msgstr ""
#. module: report_stock
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_61
msgid "Reporting"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,product_id:0
msgid "Product"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_product_product_2_report_stock_prodlots
#: model:ir.actions.act_window,name:report_stock.act_stock_location_2_report_stock_prodlots
#: model:ir.ui.menu,name:report_stock.menu_report_stock_prodlots
#: view:report.stock.prodlots:0
msgid "Stock by production lots"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_stock_production_lot_2_report_stock_prodlots
msgid "Stock"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,location_id:0
msgid "Location"
msgstr ""
#. module: report_stock
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: report_stock
#: model:ir.model,name:report_stock.model_report_stock_prodlots
msgid "Stock report by production lots"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,name:0
msgid "Quantity"
msgstr ""
-75
View File
@@ -1,75 +0,0 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * report_stock
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 4.3.0"
"Report-Msgid-Bugs-To: support@openerp.com"
"POT-Creation-Date: 2008-09-11 15:39:25+0000"
"PO-Revision-Date: 2008-09-11 15:39:25+0000"
"Last-Translator: <>"
"Language-Team: "
"MIME-Version: 1.0"
"Content-Type: text/plain; charset=UTF-8"
"Content-Transfer-Encoding: "
"Plural-Forms: "
#. module: report_stock
#: field:report.stock.prodlots,prodlot_id:0
msgid "Production lot"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_62
msgid "Traceability"
msgstr "Spårbarhet"
#. module: report_stock
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_61
msgid "Reporting"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,product_id:0
msgid "Product"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_product_product_2_report_stock_prodlots
#: model:ir.actions.act_window,name:report_stock.act_stock_location_2_report_stock_prodlots
#: model:ir.ui.menu,name:report_stock.menu_report_stock_prodlots
#: view:report.stock.prodlots:0
msgid "Stock by production lots"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_stock_production_lot_2_report_stock_prodlots
msgid "Stock"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,location_id:0
msgid "Location"
msgstr ""
#. module: report_stock
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: report_stock
#: model:ir.model,name:report_stock.model_report_stock_prodlots
msgid "Stock report by production lots"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,name:0
msgid "Quantity"
msgstr ""
-75
View File
@@ -1,75 +0,0 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * report_stock
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 4.3.0"
"Report-Msgid-Bugs-To: support@openerp.com"
"POT-Creation-Date: 2008-09-11 15:37:41+0000"
"PO-Revision-Date: 2008-09-11 15:37:41+0000"
"Last-Translator: <>"
"Language-Team: "
"MIME-Version: 1.0"
"Content-Type: text/plain; charset=UTF-8"
"Content-Transfer-Encoding: "
"Plural-Forms: "
#. module: report_stock
#: field:report.stock.prodlots,prodlot_id:0
msgid "Production lot"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_62
msgid "Traceability"
msgstr "追踪"
#. module: report_stock
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_61
msgid "Reporting"
msgstr "报表"
#. module: report_stock
#: field:report.stock.prodlots,product_id:0
msgid "Product"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_product_product_2_report_stock_prodlots
#: model:ir.actions.act_window,name:report_stock.act_stock_location_2_report_stock_prodlots
#: model:ir.ui.menu,name:report_stock.menu_report_stock_prodlots
#: view:report.stock.prodlots:0
msgid "Stock by production lots"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_stock_production_lot_2_report_stock_prodlots
msgid "Stock"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,location_id:0
msgid "Location"
msgstr ""
#. module: report_stock
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: report_stock
#: model:ir.model,name:report_stock.model_report_stock_prodlots
msgid "Stock report by production lots"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,name:0
msgid "Quantity"
msgstr ""
-75
View File
@@ -1,75 +0,0 @@
# Translation of OpenERP Server.
# This file containt the translation of the following modules:
# * report_stock
#
msgid ""
msgstr ""
"Project-Id-Version: OpenERP Server 4.3.0"
"Report-Msgid-Bugs-To: support@openerp.com"
"POT-Creation-Date: 2008-09-11 15:37:06+0000"
"PO-Revision-Date: 2008-09-11 15:37:06+0000"
"Last-Translator: <>"
"Language-Team: "
"MIME-Version: 1.0"
"Content-Type: text/plain; charset=UTF-8"
"Content-Transfer-Encoding: "
"Plural-Forms: "
#. module: report_stock
#: field:report.stock.prodlots,prodlot_id:0
msgid "Production lot"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_62
msgid "Traceability"
msgstr ""
#. module: report_stock
#: constraint:ir.model:0
msgid "The Object name must start with x_ and not contain any special character !"
msgstr ""
#. module: report_stock
#: model:ir.ui.menu,name:report_stock.next_id_61
msgid "Reporting"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,product_id:0
msgid "Product"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_product_product_2_report_stock_prodlots
#: model:ir.actions.act_window,name:report_stock.act_stock_location_2_report_stock_prodlots
#: model:ir.ui.menu,name:report_stock.menu_report_stock_prodlots
#: view:report.stock.prodlots:0
msgid "Stock by production lots"
msgstr ""
#. module: report_stock
#: model:ir.actions.act_window,name:report_stock.act_stock_production_lot_2_report_stock_prodlots
msgid "Stock"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,location_id:0
msgid "Location"
msgstr ""
#. module: report_stock
#: constraint:ir.ui.view:0
msgid "Invalid XML for View Architecture!"
msgstr ""
#. module: report_stock
#: model:ir.model,name:report_stock.model_report_stock_prodlots
msgid "Stock report by production lots"
msgstr ""
#. module: report_stock
#: field:report.stock.prodlots,name:0
msgid "Quantity"
msgstr ""
-64
View File
@@ -1,64 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="report_stock_prodlots_tree" model="ir.ui.view">
<field name="name">report.stock.prodlots.view</field>
<field name="model">report.stock.prodlots</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Stock by production lots">
<field name="location_id" select="1"/>
<field name="product_id" select="1"/>
<field name="prodlot_id" select="1"/>
<field name="name"/>
</tree>
</field>
</record>
<record id="action_report_stock_prodlots_form" model="ir.actions.act_window">
<field name="name">Stock by production lots</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">report.stock.prodlots</field>
<field name="view_type">form</field>
<field name="view_mode">form,tree</field>
</record>
<menuitem id="next_id_61" name="Reporting" parent="stock.menu_stock_root"/><menuitem id="next_id_62" name="Traceability" parent="next_id_61"/>
<menuitem action="action_report_stock_prodlots_form" id="menu_report_stock_prodlots" parent="next_id_62"/>
<act_window domain="[('location_id', '=', active_id)]" id="act_stock_location_2_report_stock_prodlots" name="Stock by production lots" res_model="report.stock.prodlots" src_model="stock.location"/>
<act_window domain="[('product_id', '=', active_id)]" id="act_product_product_2_report_stock_prodlots" name="Stock by production lots" res_model="report.stock.prodlots" src_model="product.product"/>
<act_window domain="[('prodlot_id', '=', active_id)]" id="act_stock_production_lot_2_report_stock_prodlots" name="Stock" res_model="report.stock.prodlots" src_model="stock.production.lot"/>
<record id="report_stock_latest_tree" model="ir.ui.view">
<field name="name">report.inventory.latest.view</field>
<field name="model">report.inventory.latest</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Latest inventories by product">
<field name="product" select="1"/>
<field name="qty" select="1"/>
<field name="uom"/>
<field name="inventory"/>
<field name="name"/>
</tree>
</field>
</record>
<record id="action_report_stock_latest_form" model="ir.actions.act_window">
<field name="name">Latest Inventories by product</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">report.inventory.latest</field>
<field name="view_type">form</field>
<field name="view_mode">tree</field>
<field name="domain">[('name','&gt;=',time.strftime('%Y-%m-01'))]</field>
</record>
<menuitem action="action_report_stock_latest_form" id="menu_report_stock_latest" parent="next_id_62"/>
</data>
</openerp>
@@ -1,2 +0,0 @@
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_report_stock_prodlots,report.stock.prodlots,model_report_stock_prodlots,stock.group_stock_manager,1,0,0,0
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_report_stock_prodlots report.stock.prodlots model_report_stock_prodlots stock.group_stock_manager 1 0 0 0
-4
View File
@@ -41,7 +41,3 @@ from osv import fields, osv
#
#res_partner()
#
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-1
View File
@@ -955,5 +955,4 @@ class sale_config_picking_policy(osv.osv_memory):
}
sale_config_picking_policy()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+24 -24
View File
@@ -43,8 +43,8 @@
</record>
<menuitem id="menu_shop_configuration" name="Configuration" parent="sale.menu_sale_root" sequence="1"/>
<menuitem action="action_shop_form" id="menu_action_shop_form" parent="sale.menu_shop_configuration"/>
<record id="view_sale_order_calendar" model="ir.ui.view">
<record id="view_sale_order_calendar" model="ir.ui.view">
<field name="name">sale.order.calendar</field>
<field name="model">sale.order</field>
<field name="type">calendar</field>
@@ -55,17 +55,17 @@
</calendar>
</field>
</record>
<record model="ir.ui.view" id="view_sale_order_graph">
<field name="name">sale.order.graph</field>
<field name="model">sale.order</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Sales orders" type="bar">
<field name="partner_id"/>
<field name="amount_total" operator="+"/>
</graph>
</field>
</record>
<record model="ir.ui.view" id="view_sale_order_graph">
<field name="name">sale.order.graph</field>
<field name="model">sale.order</field>
<field name="type">graph</field>
<field name="arch" type="xml">
<graph string="Sales orders" type="bar">
<field name="partner_id"/>
<field name="amount_total" operator="+"/>
</graph>
</field>
</record>
<record id="view_order_tree" model="ir.ui.view">
<field name="name">sale.order.tree</field>
@@ -91,14 +91,14 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sales order">
<group col="6" colspan="4">
<field name="name" select="1"/>
<field name="client_order_ref"/>
<field name="shipped" select="2"/>
<field name="shop_id" on_change="onchange_shop_id(shop_id)" select="2"/>
<field name="date_order" select="1"/>
<field name="invoiced" select="2"/>
</group>
<group col="6" colspan="4">
<field name="name" select="1"/>
<field name="client_order_ref"/>
<field name="shipped" select="2"/>
<field name="shop_id" on_change="onchange_shop_id(shop_id)" select="2"/>
<field name="date_order" select="1"/>
<field name="invoiced" select="2"/>
</group>
<notebook colspan="4">
<page string="Sale Order">
@@ -157,11 +157,11 @@
<page string="Notes">
<field colspan="4" name="notes" nolabel="1"/>
</page>
<page string="History">
<page string="History" groups="base.group_extended">
<separator colspan="4" string="Invoice Lines"/>
<field colspan="4" name="invoice_lines" nolabel="1"/>
<separator colspan="4" string="Stock Moves"/>
<field colspan="4" name="move_ids" nolabel="1"/>
<field colspan="4" name="move_ids" nolabel="1" widget="many2many"/>
</page>
</notebook>
</form>
@@ -204,7 +204,7 @@
<field name="order_policy"/>
<field groups="base.group_extended" name="origin"/>
<field groups="base.group_extended" name="invoice_quantity" attrs="{'readonly':[('order_policy','=','picking')]}"/>
<field name="payment_term"/>
<field name="payment_term"/>
<separator colspan="4" string="Notes"/>
<field colspan="4" name="note" nolabel="1"/>
</page>
+7 -6
View File
@@ -381,8 +381,8 @@
-->
<record id="view_task_form2" model="ir.ui.view">
<field name="name">project.task.form</field>
<field name="model">project.task</field>
<field name="name">scrum.task.form</field>
<field name="model">scrum.task</field>
<field name="type">form</field>
<field name="inherit_id" ref="project.view_task_form2"/>
<field name="arch" type="xml">
@@ -396,7 +396,7 @@
<record id="action_view_task" model="ir.actions.act_window">
<field name="name">All Tasks</field>
<field name="res_model">project.task</field>
<field name="res_model">scrum.task</field>
<field name="view_type">form</field>
<field name="domain">[('scrum','=',1)]</field>
</record>
@@ -404,7 +404,7 @@
<record id="action_view_task4" model="ir.actions.act_window">
<field name="name">My tasks</field>
<field name="res_model">project.task</field>
<field name="res_model">scrum.task</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('user_id', '=', uid),('scrum','=',1)]</field>
@@ -413,7 +413,7 @@
<record id="action_view_task5" model="ir.actions.act_window">
<field name="name">My opened tasks</field>
<field name="res_model">project.task</field>
<field name="res_model">scrum.task</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('user_id','=',uid),('state','=','open'),('scrum','=',1)]</field>
@@ -422,11 +422,12 @@
<record id="action_view_task6" model="ir.actions.act_window">
<field name="name">Opened tasks</field>
<field name="res_model">project.task</field>
<field name="res_model">scrum.task</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="domain">[('state','=','open'),('scrum','=',1)]</field>
</record>
<menuitem action="action_view_task6" id="menu_action_view_task6" parent="project.menu_action_view_task"/>
</data>
</openerp>

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