[[ repeatIn(lines(data['form']), 'a') ]][[ a['level']>2 and setTag('para','para',{'fontName':"Helvetica"}) ]][[ a['code'] or removeParentNode('tr') ]]
-
[[ a['level']>2 and setTag('para','para',{'fontName':"Helvetica"}) ]][[ '..'*(a['level']-1) ]][[ a['name'] ]]
-
[[ a['level']>2 and setTag('para','para',{'fontName':"Helvetica"}) ]][[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['debit']) ]][[ a['type']<>'view' and removeParentNode('font') ]] [[formatLang(a['debit']) ]]
-
[[ a['level']>2 and setTag('para','para',{'fontName':"Helvetica"}) ]][[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['credit']) ]][[ a['type']<>'view' and removeParentNode('font') ]] [[ formatLang(a['credit']) ]]
-
[[ a['level']>2 and setTag('para','para',{'fontName':"Helvetica"}) ]][[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['balance']) ]][[ a['type']<>'view' and removeParentNode('font') ]] [[ formatLang(a['balance']) ]]
+
[[ repeatIn(lines(data['form']), 'a') ]][[ (a['level']>2 and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]][[ a['code'] or removeParentNode('tr') ]]
+
[[ (a['level']>2 and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]][[ '..'*(a['level']-1) ]][[ a['name'] ]]
+
[[ (a['level']>2 and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]][[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['debit']) ]][[ a['type']<>'view' and removeParentNode('font') ]] [[formatLang(a['debit']) ]]
+
[[ (a['level']>2 and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font')]][[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['credit']) ]][[ a['type']<>'view' and removeParentNode('font') ]] [[ formatLang(a['credit']) ]]
+
[[ (a['level']>2 and setTag('para','para',{'fontName':"Helvetica"})) or removeParentNode('font') ]][[ a['type']=='view' and removeParentNode('font') ]][[ formatLang(a['balance']) ]][[ a['type']<>'view' and removeParentNode('font') ]] [[ formatLang(a['balance']) ]]
diff --git a/addons/account/report/account_entries_report_view.xml b/addons/account/report/account_entries_report_view.xml
index 184b087ce95..927bba3e228 100644
--- a/addons/account/report/account_entries_report_view.xml
+++ b/addons/account/report/account_entries_report_view.xml
@@ -50,36 +50,42 @@
-
-
-
-
-
-
-
+
+
+
-
-
-
-
-
-
+
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
@@ -88,12 +94,20 @@
+
+
+
+
+
+
+
+
+
+
+
-
-
-
@@ -103,7 +117,7 @@
account.entries.reportformtree,graph
- {'search_default_profit': 1,'search_default_group_journal':1,'search_default_group_period': 1, 'group_by_no_leaf':1,'group_by':[]}
+ {'search_default_profit': 1,'search_default_group_account':1,'search_default_group_month': 1, 'group_by_no_leaf':1,'group_by':[]}
diff --git a/addons/account/report/account_invoice_report.py b/addons/account/report/account_invoice_report.py
index 43c8344f110..c15c2e670e3 100644
--- a/addons/account/report/account_invoice_report.py
+++ b/addons/account/report/account_invoice_report.py
@@ -77,84 +77,83 @@ class account_invoice_report(osv.osv):
tools.drop_view_if_exists(cr, 'account_invoice_report')
cr.execute("""
create or replace view account_invoice_report as (
- select
- min(l.id) as id,
- s.date_invoice as date,
- to_char(s.date_invoice, 'YYYY') as year,
- to_char(s.date_invoice, 'MM') as month,
- to_char(s.date_invoice, 'YYYY-MM-DD') as day,
- l.product_id as product_id,
- sum(case when s.type in ('out_refund','in_invoice') then
- l.quantity * u.factor * -1
- else
- l.quantity * u.factor
- end) as product_qty,
- s.partner_id as partner_id,
- s.reconciled::integer,
- s.payment_term as payment_term,
- s.period_id as period_id,
- u.name as uom_name,
- s.currency_id as currency_id,
- s.journal_id as journal_id,
- s.fiscal_position as fiscal_position,
- s.user_id as user_id,
- s.company_id as company_id,
- sum(case when s.type in ('out_refund','in_invoice') then
- l.quantity*l.price_unit * -1
- else
- l.quantity*l.price_unit
- end) as price_total,
- sum(case when s.type in ('out_refund','in_invoice') then
- l.quantity*l.price_unit * -1
- else
- l.quantity*l.price_unit
- end) / sum(l.quantity * u.factor)::decimal(16,2) as price_average,
- count(*) as nbr,
- s.type as type,
- s.state,
- pt.categ_id,
- s.date_due as date_due,
- s.address_contact_id as address_contact_id,
- s.address_invoice_id as address_invoice_id,
- s.account_id as account_id,
- s.partner_bank as partner_bank,
- sum(case when s.type in ('out_refund','in_invoice') then
- s.residual * -1
- else
- s.residual
- end) as residual,
- case when s.state != 'paid' then null else
- extract(epoch from avg(am.date_created-l.create_date))/(24*60*60)::decimal(16,2)
- end as delay_to_pay
- from account_invoice_line l
- left join account_invoice s on (s.id=l.invoice_id)
- left join product_template pt on (pt.id=l.product_id)
- left join product_uom u on (u.id=l.uos_id),
- account_move_line am left join account_invoice i on (i.move_id=am.move_id)
- where am.account_id=i.account_id
- group by
- s.type,
- s.date_invoice,
- s.partner_id,
- l.product_id,
- u.name,
- l.uos_id,
- s.reconciled,
- s.user_id,
- s.state,
- s.residual,
- pt.categ_id,
- s.company_id,
- s.payment_term,
- s.period_id,
- s.fiscal_position,
- s.currency_id,
- s.journal_id,
- s.date_due,
- s.address_contact_id,
- s.address_invoice_id,
- s.account_id,
- s.partner_bank
+ select min(ail.id) as id,
+ ai.date_invoice as date,
+ to_char(ai.date_invoice, 'YYYY') as year,
+ to_char(ai.date_invoice, 'MM') as month,
+ to_char(ai.date_invoice, 'YYYY-MM-DD') as day,
+ ail.product_id,
+ ai.partner_id as partner_id,
+ ai.reconciled::integer,
+ ai.payment_term as payment_term,
+ ai.period_id as period_id,
+ u.name as uom_name,
+ ai.currency_id as currency_id,
+ ai.journal_id as journal_id,
+ ai.fiscal_position as fiscal_position,
+ ai.user_id as user_id,
+ ai.company_id as company_id,
+ count(ail.*) as nbr,
+ ai.type as type,
+ ai.state,
+ pt.categ_id,
+ ai.date_due as date_due,
+ ai.address_contact_id as address_contact_id,
+ ai.address_invoice_id as address_invoice_id,
+ ai.account_id as account_id,
+ ai.partner_bank as partner_bank,
+ sum(case when ai.type in ('out_refund','in_invoice') then
+ ail.quantity * u.factor * -1
+ else
+ ail.quantity * u.factor
+ end) as product_qty,
+ sum(case when ai.type in ('out_refund','in_invoice') then
+ ail.quantity*ail.price_unit * -1
+ else
+ ail.quantity*ail.price_unit
+ end) as price_total,
+ sum(case when ai.type in ('out_refund','in_invoice') then
+ ail.quantity*ail.price_unit * -1
+ else
+ ail.quantity*ail.price_unit
+ end) / sum(ail.quantity * u.factor)*count(ail.product_id)::decimal(16,2) as price_average,
+ sum((select extract(epoch from avg(aml.date_created-l.create_date))/(24*60*60)::decimal(16,2)
+ from account_move_line as aml
+ left join account_invoice as a ON (a.move_id=aml.move_id)
+ left join account_invoice_line as l ON (a.id=l.invoice_id)
+ where a.id=ai.id)) as delay_to_pay,
+ sum(case when ai.type in ('out_refund','in_invoice') then
+ ai.residual * -1
+ else
+ ai.residual
+ end) as residual
+ from account_invoice_line as ail
+ left join account_invoice as ai ON (ai.id=ail.invoice_id)
+ left join product_template pt on (pt.id=ail.product_id)
+ left join product_uom u on (u.id=ail.uos_id)
+ group by ail.product_id,
+ ai.date_invoice,
+ to_char(ai.date_invoice, 'YYYY'),
+ to_char(ai.date_invoice, 'MM'),
+ to_char(ai.date_invoice, 'YYYY-MM-DD'),
+ ai.partner_id,
+ ai.reconciled,
+ ai.payment_term,
+ ai.period_id,
+ u.name,
+ ai.currency_id,
+ ai.journal_id,
+ ai.fiscal_position,
+ ai.user_id,
+ ai.company_id,
+ ai.type,
+ ai.state,
+ pt.categ_id,
+ ai.date_due,
+ ai.address_contact_id,
+ ai.address_invoice_id,
+ ai.account_id,
+ ai.partner_bank
)
""")
account_invoice_report()
diff --git a/addons/account/report/account_invoice_report_view.xml b/addons/account/report/account_invoice_report_view.xml
index f4956939fce..b947f9d5f6a 100644
--- a/addons/account/report/account_invoice_report_view.xml
+++ b/addons/account/report/account_invoice_report_view.xml
@@ -84,7 +84,7 @@
help = "Done Invoices"/>
-
+
-
+
diff --git a/addons/account/report/general_ledger.rml b/addons/account/report/general_ledger.rml
index 5358af913de..3f1deb22e6b 100644
--- a/addons/account/report/general_ledger.rml
+++ b/addons/account/report/general_ledger.rml
@@ -26,7 +26,7 @@
- 1cm 27.7cm 20cm 27.7cm
+ 0.88cm 27.7cm 20.12cm 27.7cm
@@ -105,7 +105,7 @@
[[ repeatIn(get_children_accounts(a,data['form']), 'o') ]]
- [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
+ [[ data['form']['amount_currency'] == False or removeParentNode('blockTable') ]]
@@ -141,7 +141,7 @@
- [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
+ [[ data['form']['amount_currency'] == True or removeParentNode('blockTable') ]]
[[ repeatIn(lines(data), 'a') ]][[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]][[ a['ref'] ]] [[ a['type']==3 and a['code'] ]]
-
[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]][[ a['name'] ]]
-
[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]][[ formatLang(a['debit']) ]]
-
[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]][[ formatLang(a['credit']) ]]
-
[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]][[ formatLang(a['balance']) ]]
-
[[ a['type']==3 and ( setTag('para','para',{'fontName':'Helvetica-Bold'})) ]][[ formatLang(a['enlitige'] or 0.00) ]]
+
[[ repeatIn(lines(data), 'a') ]][[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ a['ref'] ]] [[ a['type']==3 and a['code'] ]]
+
[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ a['name'] ]]
+
[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ formatLang(a['debit']) ]]
+
[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ formatLang(a['credit']) ]]
+
[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ formatLang(a['balance']) ]]
+
[[ (a['type']==3 and setTag('para','para',{'fontName':'Helvetica-Bold'})) or removeParentNode('font') ]][[ formatLang(a['enlitige'] or 0.00) ]]
diff --git a/addons/base_report_creator/__openerp__.py b/addons/base_report_creator/__openerp__.py
index 22d7adffe8b..8e1ba708850 100644
--- a/addons/base_report_creator/__openerp__.py
+++ b/addons/base_report_creator/__openerp__.py
@@ -38,7 +38,6 @@ the "Dashboard" menu.
'update_xml': [
'security/ir.model.access.csv',
'wizard/report_menu_create_view.xml',
- 'wizard/report_open_view.xml',
'base_report_creator_wizard.xml',
'base_report_creator_view.xml'
],
diff --git a/addons/base_report_creator/base_report_creator.py b/addons/base_report_creator/base_report_creator.py
index 764753f5cc2..3ba79bad2c0 100644
--- a/addons/base_report_creator/base_report_creator.py
+++ b/addons/base_report_creator/base_report_creator.py
@@ -98,7 +98,7 @@ class report_creator(osv.osv):
if context is None:
context = {}
- data = context and context.get('report_id', False) or False
+ data = context and context.get('report_id', False) or False
if (not context) or 'report_id' not in context:
return super(report_creator, self).fields_view_get(cr, user, view_id, view_type, context, toolbar=toolbar, submenu=submenu)
report = self.browse(cr, user, data)
@@ -114,7 +114,7 @@ class report_creator(osv.osv):
else:
fields['column_count'] = {'readonly': True, 'type': 'integer', 'string': 'Count', 'size': 64, 'name': 'column_count'}
- arch = '\n'
+ arch = ''
if view_type == 'graph':
orientation_eval = {'horz':'horizontal','vert' :'vertical'}
orientation = eval(report.view_graph_orientation,orientation_eval)
@@ -163,14 +163,14 @@ class report_creator(osv.osv):
arch += '''>'''
arch += ''.join(temp_list)
else:
- arch += '<%s string="%s">\n' % (view_type, report.name)
+ arch += '<%s string="%s">' % (view_type, report.name)
i = 0
for f in report.field_ids:
if f.field_id.model:
- arch += '' % ('field' + str(i),)
+ arch += '' % ('field' + str(i),)
i += 1
else:
- arch += '' % ('column_count',)
+ arch += '' % ('column_count',)
arch += '%s>' % (view_type,)
result = {
'arch': arch,
@@ -181,7 +181,6 @@ class report_creator(osv.osv):
'action': [],
'relate': []
}
-
return result
def read(self, cr, user, ids, fields = None, context = None, load = '_classic_read'):
@@ -406,55 +405,85 @@ class report_creator(osv.osv):
return result
_columns = {
- 'name': fields.char('Report Name', size=64, required=True),
+ 'name': fields.char('Report Name', size=64, required=True),
'type': fields.selection([('list', 'Rows And Columns Report'), ], 'Report Type', required=True), #('sum','Summation Report')
- 'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the report without removing it."),
- 'view_type1': fields.selection([('form', 'Form'),
- ('tree', 'Tree'),
- ('graph', 'Graph'),
- ('calendar', 'Calendar')], 'First View', required=True),
- 'view_type2': fields.selection([('', '/'),
- ('form', 'Form'),
- ('tree', 'Tree'),
- ('graph', 'Graph'),
- ('calendar', 'Calendar')], 'Second View'),
- 'view_type3': fields.selection([('', '/'),
- ('form', 'Form'),
- ('tree', 'Tree'),
- ('graph', 'Graph'),
- ('calendar', 'Calendar')], 'Third View'),
- 'view_graph_type': fields.selection([('pie', 'Pie Chart'),
- ('bar', 'Bar Chart')], 'Graph Type', required=True),
- 'view_graph_orientation': fields.selection([('horz', 'Horizontal'),
- ('vert', 'Vertical')], 'Graph Orientation', required=True),
- 'model_ids': fields.many2many('ir.model', 'base_report_creator_report_model_rel', 'report_id', 'model_id', 'Reported Objects'),
- 'field_ids': fields.one2many('base_report_creator.report.fields', 'report_id', 'Fields to Display'),
- 'filter_ids': fields.one2many('base_report_creator.report.filter', 'report_id', 'Filters'),
- 'state': fields.selection([
- ('draft', 'Draft'),
- ('valid', 'Valid')],
- 'State', required=True,
- help=' * The \'Draft\' state is used when a user is encoding a new and unconfirmed custom report. \
- \n* The \'Valid\' state is used when user validates the custom report.'),
- 'sql_query': fields.function(_sql_query_get, method=True, type="text", string='SQL Query', store=True),
- 'group_ids': fields.many2many('res.groups', 'base_report_creator_group_rel', 'report_id', 'group_id', 'Authorized Groups'),
+ 'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the report without removing it."),
+ 'view_type1': fields.selection([('form', 'Form'),
+ ('tree', 'Tree'),
+ ('graph', 'Graph'),
+ ('calendar', 'Calendar')], 'First View', required=True),
+ 'view_type2': fields.selection([('', '/'),
+ ('form', 'Form'),
+ ('tree', 'Tree'),
+ ('graph', 'Graph'),
+ ('calendar', 'Calendar')], 'Second View'),
+ 'view_type3': fields.selection([('', '/'),
+ ('form', 'Form'),
+ ('tree', 'Tree'),
+ ('graph', 'Graph'),
+ ('calendar', 'Calendar')], 'Third View'),
+ 'view_graph_type': fields.selection([('pie', 'Pie Chart'),
+ ('bar', 'Bar Chart')], 'Graph Type', required=True),
+ 'view_graph_orientation': fields.selection([('horz', 'Horizontal'),
+ ('vert', 'Vertical')], 'Graph Orientation', required=True),
+ 'model_ids': fields.many2many('ir.model', 'base_report_creator_report_model_rel', 'report_id', 'model_id', 'Reported Objects'),
+ 'field_ids': fields.one2many('base_report_creator.report.fields', 'report_id', 'Fields to Display'),
+ 'filter_ids': fields.one2many('base_report_creator.report.filter', 'report_id', 'Filters'),
+ 'sql_query': fields.function(_sql_query_get, method=True, type="text", string='SQL Query', store=True),
+ 'group_ids': fields.many2many('res.groups', 'base_report_creator_group_rel', 'report_id', 'group_id', 'Authorized Groups'),
+ 'menu_id': fields.many2one('ir.ui.menu', "Menu", readonly=True),
}
_defaults = {
- 'type': lambda *args: 'list',
- 'state': lambda *args: 'draft',
- 'active': lambda *args: True,
- 'view_type1': lambda *args: 'tree',
- 'view_type2': lambda *args: 'graph',
- 'view_graph_type': lambda *args: 'bar',
- 'view_graph_orientation': lambda *args: 'horz',
+ 'type': lambda *args: 'list',
+ 'active': lambda *args: True,
+ 'view_type1': lambda *args: 'tree',
+ 'view_type2': lambda *args: 'graph',
+ 'view_graph_type': lambda *args: 'bar',
+ 'view_graph_orientation': lambda *args: 'horz',
}
+
+ def open_report(self, cr, uid, ids, context=None):
+ """
+ This Function opens base creator report view
+ @param self: The object pointer
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param ids: List of report open's IDs
+ @param context: A standard dictionary for contextual values
+ @return : Dictionary value for base creator report form
+ """
+ if not context:
+ context = {}
+
+ rep = self.browse(cr, uid, ids, context=context)
+ if not rep:
+ return False
+
+ rep = rep[0]
+ view_mode = rep.view_type1
+ if rep.view_type2:
+ view_mode += ',' + rep.view_type2
+ if rep.view_type3:
+ view_mode += ',' + rep.view_type3
+ value = {
+ 'name': rep.name,
+ 'view_type': 'form',
+ 'view_mode': view_mode,
+ 'res_model': 'base_report_creator.report',
+ 'type': 'ir.actions.act_window',
+ 'context': "{'report_id':%d}" % (rep.id,),
+ 'nodestroy': True,
+ }
+
+ return value
+
def _function_field(self, cr, uid, ids):
"""
- constraints function which specify that
+ constraints function which specify that
not display field which are not stored in Database.
@param cr: the current row, from the database cursor,
@param uid: the current user’s ID for security checks,
- @param ids: List of Report creator's id.
+ @param ids: List of Report creator's id.
@return: True if display field which are stored in database.
or false if display field which are not store in dtabase.
"""
@@ -514,10 +543,11 @@ class report_creator(osv.osv):
return False
return True
+
_constraints = [
- (_function_field, 'You can not display field which are not stored in Database.', ['field_ids']),
- (_aggregation_error, 'You can apply aggregate function to the non calculated field.', ['field_ids']),
- (_calander_view_error, "You must have to give calendar view's color,start date and delay.", ['field_ids']),
+ (_function_field, 'You can not display field which are not stored in Database.', ['field_ids']),
+ (_aggregation_error, 'You can apply aggregate function to the non calculated field.', ['field_ids']),
+ (_calander_view_error, "You must have to give calendar view's color,start date and delay.", ['field_ids']),
]
report_creator()
@@ -531,25 +561,25 @@ class report_creator_field(osv.osv):
_rec_name = 'field_id'
_order = "sequence,id"
_columns = {
- 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of fields."),
- 'field_id': fields.many2one('ir.model.fields', 'Field'),
- 'report_id': fields.many2one('base_report_creator.report', 'Report', on_delete='cascade'),
- 'group_method': fields.selection([('group', 'Grouped'),
- ('sum', 'Sum'),
- ('min', 'Minimum'),
- ('count', 'Count'),
- ('max', 'Maximum'),
- ('avg', 'Average')], 'Grouping Method', required=True),
- 'graph_mode': fields.selection([('', '/'),
- ('x', 'X Axis'),
- ('y', 'Y Axis')], 'Graph Mode'),
- 'calendar_mode': fields.selection([('', '/'),
- ('date_start', 'Starting Date'),
- ('date_end', 'Ending Date'), ('date_delay', 'Delay'), ('date_stop', 'End Date'), ('color', 'Unique Colors')], 'Calendar Mode'),
+ 'sequence': fields.integer('Sequence', help="Gives the sequence order when displaying a list of fields."),
+ 'field_id': fields.many2one('ir.model.fields', 'Field'),
+ 'report_id': fields.many2one('base_report_creator.report', 'Report', on_delete='cascade'),
+ 'group_method': fields.selection([('group', 'Grouped'),
+ ('sum', 'Sum'),
+ ('min', 'Minimum'),
+ ('count', 'Count'),
+ ('max', 'Maximum'),
+ ('avg', 'Average')], 'Grouping Method', required=True),
+ 'graph_mode': fields.selection([('', '/'),
+ ('x', 'X Axis'),
+ ('y', 'Y Axis')], 'Graph Mode'),
+ 'calendar_mode': fields.selection([('', '/'),
+ ('date_start', 'Starting Date'),
+ ('date_end', 'Ending Date'), ('date_delay', 'Delay'), ('date_stop', 'End Date'), ('color', 'Unique Colors')], 'Calendar Mode'),
}
_defaults = {
- 'group_method': lambda *args: 'group',
- 'graph_mode': lambda *args: '',
+ 'group_method': lambda *args: 'group',
+ 'graph_mode': lambda *args: '',
}
report_creator_field()
@@ -561,14 +591,14 @@ class report_creator_filter(osv.osv):
_name = "base_report_creator.report.filter"
_description = "Report Filters"
_columns = {
- 'name': fields.char('Filter Name', size=64, required=True),
- 'expression': fields.text('Value', required=True, help='Provide an expression for the field based on which you want to filter the records.\n e.g. res_partner.id=3'),
- 'report_id': fields.many2one('base_report_creator.report', 'Report', on_delete='cascade'),
- 'condition': fields.selection([('and', 'AND'),
+ 'name': fields.char('Filter Name', size=64, required=True),
+ 'expression': fields.text('Value', required=True, help='Provide an expression for the field based on which you want to filter the records.\n e.g. res_partner.id=3'),
+ 'report_id': fields.many2one('base_report_creator.report', 'Report', on_delete='cascade'),
+ 'condition': fields.selection([('and', 'AND'),
('or', 'OR')], 'Condition')
}
_defaults = {
- 'condition': lambda *args: 'and',
+ 'condition': lambda *args: 'and',
}
report_creator_filter()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/base_report_creator/base_report_creator_demo.xml b/addons/base_report_creator/base_report_creator_demo.xml
index da44979f26d..3ec5cfbe987 100644
--- a/addons/base_report_creator/base_report_creator_demo.xml
+++ b/addons/base_report_creator/base_report_creator_demo.xml
@@ -10,7 +10,6 @@
-
diff --git a/addons/base_report_creator/base_report_creator_view.xml b/addons/base_report_creator/base_report_creator_view.xml
index 021bcbb5998..8752a573725 100644
--- a/addons/base_report_creator/base_report_creator_view.xml
+++ b/addons/base_report_creator/base_report_creator_view.xml
@@ -23,7 +23,6 @@
-
@@ -42,12 +41,21 @@
-
-
-
+ context="{'model_ids':model_ids}" nolabel="1" />
+
+
+
+
+
+
+
+
+
+
@@ -112,6 +120,17 @@
+
+ Report Name
+ base_report_creator.report
+ search
+
+
+
+
+
+
+
@@ -119,6 +138,7 @@
base_report_creator.reportformtree,form
+
-
-
-
diff --git a/addons/base_report_creator/base_report_creator_wizard.xml b/addons/base_report_creator/base_report_creator_wizard.xml
index a8dad6f9b41..68ab122edb0 100644
--- a/addons/base_report_creator/base_report_creator_wizard.xml
+++ b/addons/base_report_creator/base_report_creator_wizard.xml
@@ -3,6 +3,5 @@
-
diff --git a/addons/base_report_creator/wizard/__init__.py b/addons/base_report_creator/wizard/__init__.py
index d2ff1dc5fea..5616c82a370 100644
--- a/addons/base_report_creator/wizard/__init__.py
+++ b/addons/base_report_creator/wizard/__init__.py
@@ -21,6 +21,5 @@
import wiz_set_filter_fields
import report_menu_create
-import report_open
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/base_report_creator/wizard/base_report_creator_open.py b/addons/base_report_creator/wizard/base_report_creator_open.py
deleted file mode 100644
index be7420c5744..00000000000
--- a/addons/base_report_creator/wizard/base_report_creator_open.py
+++ /dev/null
@@ -1,64 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-
-import wizard
-import netsvc
-import time
-import pooler
-from osv import osv
-from tools.translate import _
-
-
-
-class report_creator_open(wizard.interface):
- def _open_report(self, cr, uid, data, context):
- pool = pooler.get_pool(cr.dbname)
- if context.get('report_id',False):
- raise wizard.except_wizard(_('UserError'),_('No Wizards available for this object!'))
- rep = pool.get('base_report_creator.report').browse(cr, uid, data['id'], context)
- view_mode = rep.view_type1
- if rep.view_type2:
- view_mode += ','+rep.view_type2
- if rep.view_type3:
- view_mode += ','+rep.view_type3
- value = {
- 'name': rep.name,
- 'view_type': 'form',
- 'view_mode': view_mode,
- 'res_model': 'base_report_creator.report',
- 'context': {'report_id': data['id']},
- 'view_id': False,
- 'type': 'ir.actions.act_window'
- }
- return value
-
- states = {
- 'init' : {
- 'actions' : [],
- 'result' : {'type':'action', 'action':_open_report, 'state':'end'}
- }
- }
-report_creator_open('base_report_creator.report.open')
-
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
-
diff --git a/addons/base_report_creator/wizard/report_menu_create.py b/addons/base_report_creator/wizard/report_menu_create.py
index 06e48b2ee8f..84b952f976a 100644
--- a/addons/base_report_creator/wizard/report_menu_create.py
+++ b/addons/base_report_creator/wizard/report_menu_create.py
@@ -43,31 +43,41 @@ class report_menu_create(osv.osv_memory):
if not context:
context = {}
context_id = context and context.get('active_id', False) or False
+ obj_menu = self.pool.get('ir.ui.menu')
+ data_obj = self.pool.get('ir.model.data')
+ obj_board = self.pool.get('base_report_creator.report')
if context_id:
- board = self.pool.get('base_report_creator.report').browse(cr, uid, context_id)
+ data = self.browse(cr, uid, ids, context=context)
+ if not data:
+ return {}
+ data = data[0]
+
+ board = obj_board.browse(cr, uid, context_id)
view = board.view_type1
if board.view_type2:
view += ',' + board.view_type2
if board.view_type3:
view += ',' + board.view_type3
+
+ result = data_obj._get_id(cr, uid, 'base_report_creator', 'view_report_filter')
+ res = data_obj.read(cr, uid, result, ['res_id'])
action_id = self.pool.get('ir.actions.act_window').create(cr, uid, {
'name': board.name,
'view_type':'form',
'view_mode':view,
'context': "{'report_id':%d}" % (board.id,),
- 'res_model': 'base_report_creator.report'
- })
- obj_menu = self.pool.get('ir.ui.menu')
- #start Loop
- for data in self.read(cr, uid, ids):
- obj_menu.create(cr, uid, {
- 'name': data.get('menu_name'),
- 'parent_id': data.get('menu_parent_id'),
+ 'res_model': 'base_report_creator.report',
+ 'search_view_id': res['res_id']
+ })
+
+ menu_id = obj_menu.create(cr, uid, {
+ 'name': data.menu_name,
+ 'parent_id': data.menu_parent_id.id,
'icon': 'STOCK_SELECT_COLOR',
'action': 'ir.actions.act_window, ' + str(action_id)
}, context=context)
- return {}
- #End Loop
+ obj_board.write(cr, uid, context_id, {'menu_id': menu_id})
+ return {}
report_menu_create()
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/base_report_creator/wizard/report_open.py b/addons/base_report_creator/wizard/report_open.py
deleted file mode 100644
index 4476c9d4e93..00000000000
--- a/addons/base_report_creator/wizard/report_open.py
+++ /dev/null
@@ -1,71 +0,0 @@
-# -*- coding: utf-8 -*-
-##############################################################################
-#
-# OpenERP, Open Source Management Solution
-# Copyright (C) 2004-2010 Tiny SPRL ().
-#
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU Affero General Public License as
-# published by the Free Software Foundation, either version 3 of the
-# License, or (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU Affero General Public License for more details.
-#
-# You should have received a copy of the GNU Affero General Public License
-# along with this program. If not, see .
-#
-##############################################################################
-
-from osv import fields, osv
-
-class report_open(osv.osv_memory):
- """
- Open report
- """
- _name = "report.open"
- _description = __doc__
-
- def open_report(self, cr, uid, ids, context=None):
- """
- This Function opens base creator report view
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
- @param ids: List of report open's IDs
- @param context: A standard dictionary for contextual values
- @return : Dictionary value for base creator report form
- """
-
- if not context:
- context = {}
-
- context_id = context and context.get('active_id', False) or False
-
- if context.get('report_id', False):
- raise osv.except_osv(_('UserError'), _('No Wizards available for this object!'))
-
- rep = self.pool.get('base_report_creator.report').browse(cr, uid, context_id, context)
- view_mode = rep.view_type1
-
- if rep.view_type2:
- view_mode += ',' + rep.view_type2
- if rep.view_type3:
- view_mode += ',' + rep.view_type3
- value = {
- 'name': rep.name,
- 'view_type': 'form',
- 'view_mode': view_mode,
- 'res_model': 'base_report_creator.report',
- 'context': {'report_id': context_id},
- 'view_id': False,
- 'type': 'ir.actions.act_window'
- }
-
- return value
-
-report_open()
-
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/base_report_creator/wizard/report_open_view.xml b/addons/base_report_creator/wizard/report_open_view.xml
deleted file mode 100644
index 941bcf73b6e..00000000000
--- a/addons/base_report_creator/wizard/report_open_view.xml
+++ /dev/null
@@ -1,34 +0,0 @@
-
-
-
-
-
-
-
- report.open.form
- report.open
- form
-
-
-
-
-
-
- Open Report
- report.open
- form
- tree,form
-
- new
-
-
-
-
diff --git a/addons/base_setup/base_setup_todo.xml b/addons/base_setup/base_setup_todo.xml
index 0bf0fbb09be..ae7ae7f23c7 100644
--- a/addons/base_setup/base_setup_todo.xml
+++ b/addons/base_setup/base_setup_todo.xml
@@ -67,7 +67,7 @@
- 1
+ 3onskip
diff --git a/addons/base_setup/gtk_contact_form.xml b/addons/base_setup/gtk_contact_form.xml
index fcbaa9867e7..f03d8f6cc9d 100644
--- a/addons/base_setup/gtk_contact_form.xml
+++ b/addons/base_setup/gtk_contact_form.xml
@@ -10,50 +10,50 @@
-
- To receive more information, please fill in the form about you and your company. Documentation and/or information will be sent to you as soon as possible.
-
-
- Would you like more information or documentation ?
- 4
-
-
- 22
-
-
+
+ To receive more information, please fill in the form about you and your company. Documentation and/or information will be sent to you as soon as possible.
+
+
+ Would you like more information or documentation ?
+ 4
+
+
+ 22
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -70,7 +70,7 @@
- 1
+ 5never
diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py
index bf6d391ab82..6708f3e8f0e 100644
--- a/addons/crm/crm_lead.py
+++ b/addons/crm/crm_lead.py
@@ -168,6 +168,9 @@ and users"),
"""
res = super(crm_lead, self).case_open(cr, uid, ids, *args)
self.write(cr, uid, ids, {'date_open': time.strftime('%Y-%m-%d %H:%M:%S')})
+ for (id, name) in self.name_get(cr, uid, ids):
+ message = _('Lead ') + " '" + name + "' "+ _("is Open.")
+ self.log(cr, uid, id, message)
return res
def case_close(self, cr, uid, ids, *args):
@@ -180,6 +183,9 @@ and users"),
"""
res = super(crm_lead, self).case_close(cr, uid, ids, args)
self.write(cr, uid, ids, {'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')})
+ for (id, name) in self.name_get(cr, uid, ids):
+ message = _('Lead ') + " '" + name + "' "+ _("is Closed.")
+ self.log(cr, uid, id, message)
return res
def convert_opportunity(self, cr, uid, ids, context=None):
@@ -276,7 +282,10 @@ and users"),
vals.update(res)
res = self.create(cr, uid, vals, context)
-
+
+ message = _('A Lead created') + " '" + subject + "' " + _("from Mailgate.")
+ self.log(cr, uid, res, message)
+
attachents = msg.get('attachments', [])
for attactment in attachents or []:
data_attach = {
diff --git a/addons/crm/crm_opportunity.py b/addons/crm/crm_opportunity.py
index 4faebe37d91..e13a428138a 100644
--- a/addons/crm/crm_opportunity.py
+++ b/addons/crm/crm_opportunity.py
@@ -65,6 +65,9 @@ class crm_opportunity(osv.osv):
"""
res = super(crm_opportunity, self).case_close(cr, uid, ids, args)
self.write(cr, uid, ids, {'probability' : 100.0, 'date_closed': time.strftime('%Y-%m-%d %H:%M:%S')})
+ for (id, name) in self.name_get(cr, uid, ids):
+ message = _('Opportunity ') + " '" + name + "' "+ _("is Won.")
+ self.log(cr, uid, id, message)
return res
def case_cancel(self, cr, uid, ids, *args):
@@ -77,6 +80,9 @@ class crm_opportunity(osv.osv):
"""
res = super(crm_opportunity, self).case_cancel(cr, uid, ids, args)
self.write(cr, uid, ids, {'probability' : 0.0})
+ for (id, name) in self.name_get(cr, uid, ids):
+ message = _('Opportunity ') + " '" + name + "' "+ _("is Lost.")
+ self.log(cr, uid, id, message)
return res
def case_open(self, cr, uid, ids, *args):
diff --git a/addons/crm/report/crm_lead_report.py b/addons/crm/report/crm_lead_report.py
index 0993cf2dedb..208054b3f4d 100644
--- a/addons/crm/report/crm_lead_report.py
+++ b/addons/crm/report/crm_lead_report.py
@@ -51,7 +51,7 @@ class crm_lead_report(osv.osv):
for case in self.browse(cr, uid, ids, context):
if field_name != 'avg_answers':
state = field_name[5:]
- cr.execute("select count(id) from crm_opportunity where \
+ cr.execute("select count(id) from crm_lead where \
section_id =%s and state='%s'"%(case.section_id.id, state))
state_cases = cr.fetchone()[0]
perc_state = (state_cases / float(case.nbr)) * 100
diff --git a/addons/crm/report/crm_lead_report_view.xml b/addons/crm/report/crm_lead_report_view.xml
index e180d59c720..4086a04ee9d 100644
--- a/addons/crm/report/crm_lead_report_view.xml
+++ b/addons/crm/report/crm_lead_report_view.xml
@@ -41,12 +41,25 @@
-
+
+
+ crm.opportunity.report.graph
+ crm.lead.report
+ graph
+
+
+
+
+
+
+
+
+
@@ -208,7 +221,7 @@
graph
-
+
diff --git a/addons/crm/report/crm_phonecall_report.py b/addons/crm/report/crm_phonecall_report.py
index 25e62fb2342..00d13c7216c 100644
--- a/addons/crm/report/crm_phonecall_report.py
+++ b/addons/crm/report/crm_phonecall_report.py
@@ -53,7 +53,7 @@ class crm_phonecall_report(osv.osv):
for case in self.browse(cr, uid, ids, context):
if field_name != 'avg_answers':
state = field_name[5:]
- cr.execute("select count(*) from crm_opportunity where \
+ cr.execute("select count(*) from crm_lead where \
section_id =%s and state='%s'"%(case.section_id.id, state))
state_cases = cr.fetchone()[0]
perc_state = (state_cases / float(case.nbr)) * 100
@@ -143,7 +143,6 @@ class crm_phonecall_report(osv.osv):
extract('epoch' from (c.date_open-c.create_date))/(3600*24) as delay_open
from
crm_phonecall c
- where c.categ_id in (select res_id from ir_model_data where (name = 'categ_phone1' or name ='categ_phone2') and model = 'crm.case.categ')
)""")
crm_phonecall_report()
diff --git a/addons/crm/wizard/crm_lead_to_opportunity.py b/addons/crm/wizard/crm_lead_to_opportunity.py
index a77f553b173..7f47e27a4ff 100644
--- a/addons/crm/wizard/crm_lead_to_opportunity.py
+++ b/addons/crm/wizard/crm_lead_to_opportunity.py
@@ -86,7 +86,8 @@ class crm_lead2opportunity(osv.osv_memory):
if lead.partner_id:
msg_ids = [ x.id for x in lead.message_ids]
self.pool.get('mailgate.message').write(cr, uid, msg_ids, {'partner_id': lead.partner_id.id}, context=context)
-
+ message = _('Lead ') + " '" + lead.name + "' "+ _("is converted to Opportunity.")
+ self.log(cr, uid, lead.id, message)
value = {
'name': _('Opportunity'),
'view_type': 'form',
@@ -99,6 +100,7 @@ class crm_lead2opportunity(osv.osv_memory):
'type': 'ir.actions.act_window',
'search_view_id': res['res_id']
}
+
return value
_columns = {
diff --git a/addons/crm/wizard/crm_send_email.py b/addons/crm/wizard/crm_send_email.py
index 08395834115..83b1959b196 100644
--- a/addons/crm/wizard/crm_send_email.py
+++ b/addons/crm/wizard/crm_send_email.py
@@ -103,7 +103,7 @@ class crm_send_new_email2(osv.osv_memory):
ref_id = hist.ref_id
case = model_pool.browse(cr, uid, res_id)
emails = [obj.email_to]
- email_cc = (obj.email_cc or '').split(',')
+ email_cc = obj.email_cc and obj.email_cc.split(',') or ''
emails = filter(None, emails)
body = obj.text
diff --git a/addons/crm_helpdesk/crm_helpdesk.py b/addons/crm_helpdesk/crm_helpdesk.py
index f6106db5903..38352691db0 100644
--- a/addons/crm_helpdesk/crm_helpdesk.py
+++ b/addons/crm_helpdesk/crm_helpdesk.py
@@ -76,7 +76,9 @@ class crm_helpdesk(osv.osv, crm.crm_case):
help='The state is set to \'Draft\', when a case is created.\
\nIf the case is in progress the state is set to \'Open\'.\
\nWhen the case is over, the state is set to \'Done\'.\
- \nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
+ \nIf the case needs to be reviewed then the state is set to \'Pending\'.'),
+ 'message_ids': fields.one2many('mailgate.message', 'res_id', 'Messages', domain=[('history', '=', True),('model','=',_name)]),
+ 'log_ids': fields.one2many('mailgate.message', 'res_id', 'Logs', domain=[('history', '=', False),('model','=',_name)]),
}
_defaults = {
diff --git a/addons/hr_recruitment/hr_recruitment.py b/addons/hr_recruitment/hr_recruitment.py
index 09ad521d24b..2845768f59c 100644
--- a/addons/hr_recruitment/hr_recruitment.py
+++ b/addons/hr_recruitment/hr_recruitment.py
@@ -277,6 +277,8 @@ class hr_applicant(osv.osv, crm.crm_case):
vals.update(res)
res = self.create(cr, uid, vals, context)
+ message = _('A Job Request created') + " '" + subject + "' " + _("from Mailgate.")
+ self.log(cr, uid, res, message)
attachents = msg.get('attachments', [])
for attactment in attachents or []:
@@ -338,6 +340,34 @@ class hr_applicant(osv.osv, crm.crm_case):
@param **args: Return Dictionary of Keyword Value
"""
return True
+
+ def case_open(self, cr, uid, ids, *args):
+ """
+ @param self: The object pointer
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param ids: List of case's Ids
+ @param *args: Give Tuple Value
+ """
+ res = super(hr_applicant, self).case_open(cr, uid, ids, *args)
+ for (id, name) in self.name_get(cr, uid, ids):
+ message = _('Job request for') + " '" + name + "' "+ _("is Open.")
+ self.log(cr, uid, id, message)
+ return res
+
+ def case_close(self, cr, uid, ids, *args):
+ """
+ @param self: The object pointer
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param ids: List of case's Ids
+ @param *args: Give Tuple Value
+ """
+ res = super(hr_applicant, self).case_close(cr, uid, ids, *args)
+ for (id, name) in self.name_get(cr, uid, ids):
+ message = _('Applicant ') + " '" + name + "' "+ _("is Hired.")
+ self.log(cr, uid, id, message)
+ return res
hr_applicant()
diff --git a/addons/idea/security/ir.model.access.csv b/addons/idea/security/ir.model.access.csv
index ba3b6fe4e3f..f9f665766e1 100644
--- a/addons/idea/security/ir.model.access.csv
+++ b/addons/idea/security/ir.model.access.csv
@@ -5,3 +5,4 @@
"access_idea_vote_stat","idea.vote.stat","model_idea_vote_stat","base.group_user",1,0,0,0
"access_idea_category_system","idea.category system","model_idea_category","base.group_system",1,1,1,1
"access_idea_comment","idea.comment","model_idea_comment","base.group_system",1,1,1,1
+"access_idea_comment_user","idea.comment","model_idea_comment","base.group_user",1,1,1,0
diff --git a/addons/idea/test/test_idea.yml b/addons/idea/test/test_idea.yml
index bcb764f8933..9646222cab4 100644
--- a/addons/idea/test/test_idea.yml
+++ b/addons/idea/test/test_idea.yml
@@ -44,9 +44,6 @@
!record {model: res.users, id: res_users_user1}:
company_id: base.main_company
context_lang: en_US
- groups_id:
- - base.group_system
- - base.group_user
login: user2
name: user2
password: user2
@@ -54,16 +51,12 @@
- |
In order to post vote I connect as user1 and open the idea page
I click on "Submit Vote" wizard button and vote the idea as "Normal"
--
- !record {model: idea.post.vote, id: idea_post_vote_0}:
- vote: 50
-- |
- Now I click on "Post" button of this wizard.
-
!python {model: idea.post.vote}: |
- uid = ref('res_users_user0')
- self.do_vote(cr, uid, [ref("idea_post_vote_0")], {'active_ids': [ref('idea_idea_0')]})
+ uid = ref('res_users_user0')
+ new_id = self.create(cr, uid, {'vote': 50}, {"active_ids": [ref("idea_idea_0")]})
+ self.do_vote(cr, uid, [new_id], {"active_ids": [ref("idea_idea_0")]})
- |
To add other vote I connect as user2 and open the idea page.
@@ -72,16 +65,11 @@
and put comment "We can learn many things from technical presentation".
--
- !record {model: idea.post.vote, id: idea_post_vote_1}:
- vote: 100
- note: 'We can learn many things from technical presentation'
-- |
- I click on "Post" button of this wizard.
-
!python {model: idea.post.vote}: |
uid = ref('res_users_user1')
- self.do_vote(cr, uid, [ref("idea_post_vote_1")], {'active_ids': [ref('idea_idea_0')]})
+ new_id = self.create(cr, uid, {'vote': 100, 'note': 'We can learn many things from technical presentation'}, {"active_ids": [ref("idea_idea_0")]})
+ self.do_vote(cr, uid, [new_id], {'active_ids': [ref('idea_idea_0')]})
- |
I can see that the Average score changed in "Average score" field with value 75
@@ -99,4 +87,3 @@
-
!assert {model: idea.idea, id: idea_idea_0}:
- state == 'close'
-
diff --git a/addons/mrp/mrp.py b/addons/mrp/mrp.py
index f3731bb59bb..13ded3a9694 100644
--- a/addons/mrp/mrp.py
+++ b/addons/mrp/mrp.py
@@ -757,9 +757,11 @@ class mrp_production(osv.osv):
new_parent_ids.append(final_product.id)
for new_parent_id in new_parent_ids:
stock_mov_obj.write(cr, uid, [raw_product.id], {'move_history_ids': [(4,new_parent_id)]})
-
+
wf_service = netsvc.LocalService("workflow")
wf_service.trg_validate(uid, 'mrp.production', production_id, 'button_produce_done', cr)
+ message = _('Manufacturing order ') + " '" + production.name + "' "+ _("is finished.")
+ self.log(cr, uid, production_id, message)
return True
def _costs_generate(self, cr, uid, production):
@@ -925,9 +927,11 @@ class mrp_production(osv.osv):
'company_id': production.company_id.id,
})
wf_service.trg_validate(uid, 'procurement.order', proc_id, 'button_confirm', cr)
- proc_ids.append(proc_id)
+ proc_ids.append(proc_id)
wf_service.trg_validate(uid, 'stock.picking', picking_id, 'button_confirm', cr)
self.write(cr, uid, [production.id], {'picking_id': picking_id, 'move_lines': [(6,0,moves)], 'state':'confirmed'})
+ message = _('Manufacturing order ') + " '" + production.name + "' "+ _("is confirmed.")
+ self.log(cr, uid, production.id, message)
return picking_id
def force_production(self, cr, uid, ids, *args):
diff --git a/addons/mrp/procurement.py b/addons/mrp/procurement.py
index 8bfefc9ceef..50a976c741a 100644
--- a/addons/mrp/procurement.py
+++ b/addons/mrp/procurement.py
@@ -40,8 +40,11 @@ class procurement_order(osv.osv):
"""
properties = [x.id for x in procurement.property_ids]
bom_id = self.pool.get('mrp.bom')._bom_find(cr, uid, procurement.product_id.id, procurement.product_uom.id, properties)
- if not bom_id:
+ if not bom_id:
cr.execute('update procurement_order set message=%s where id=%s', (_('No BoM defined for this product !'), procurement.id))
+ for (id, name) in self.name_get(cr, uid, procurement.id):
+ message = _('Procurement ') + " '" + name + "' "+ _("has an exception.") + _('No BoM defined for this product !')
+ self.log(cr, uid, id, message)
return False
return True
diff --git a/addons/procurement/company.py b/addons/procurement/company.py
index f6d1e69d122..dcdff896553 100644
--- a/addons/procurement/company.py
+++ b/addons/procurement/company.py
@@ -24,7 +24,7 @@ from osv import osv,fields
class company(osv.osv):
_inherit = 'res.company'
_columns = {
- 'schedule_range': fields.float('Scheduler Range', required=True,
+ 'schedule_range': fields.float('Scheduler Range Days', required=True,
help="This is the time frame analysed by the scheduler when "\
"computing procurements. All procurements that are not between "\
"today and today+range are skipped for futur computation."),
diff --git a/addons/procurement/procurement.py b/addons/procurement/procurement.py
index beefd9dc461..b098d279d78 100644
--- a/addons/procurement/procurement.py
+++ b/addons/procurement/procurement.py
@@ -331,6 +331,8 @@ class procurement_order(osv.osv):
})
move_obj.action_confirm(cr, uid, [id], context=context)
self.write(cr, uid, [procurement.id], {'move_id': id, 'close_move': 1})
+ message = _('Procurement ') + " '" + procurement.name + "' "+ _("is running.")
+ self.log(cr, uid, procurement.id, message)
self.write(cr, uid, ids, {'state': 'confirmed', 'message': ''})
return True
@@ -355,8 +357,10 @@ class procurement_order(osv.osv):
if not (procurement.move_id.state in ('done','assigned','cancel')):
ok = ok and self.pool.get('stock.move').action_assign(cr, uid, [id])
cr.execute('select count(id) from stock_warehouse_orderpoint where product_id=%s', (procurement.product_id.id,))
- if not cr.fetchone()[0]:
+ if not cr.fetchone()[0]:
cr.execute('update procurement_order set message=%s where id=%s', (_('Not enough stock and no minimum orderpoint rule defined.'), procurement.id))
+ message = _('Procurement ') + " '" + procurement.name + "' "+ _("has an exception.") + _('Not enough stock and no minimum orderpoint rule defined.')
+ self.log(cr, uid, procurement.id, message)
return ok
def action_produce_assign_service(self, cr, uid, ids, context={}):
@@ -434,6 +438,8 @@ class procurement_order(osv.osv):
if procurement.move_id:
if procurement.close_move and (procurement.move_id.state <> 'done'):
move_obj.action_done(cr, uid, [procurement.move_id.id])
+ message = _('Procurement ') + " '" + procurement.name + "' "+ _("is done.")
+ self.log(cr, uid, procurement.id, message)
res = self.write(cr, uid, ids, {'state': 'done', 'date_close': time.strftime('%Y-%m-%d')})
wf_service = netsvc.LocalService("workflow")
for id in ids:
@@ -472,7 +478,7 @@ class stock_warehouse_orderpoint(osv.osv):
help="When the virtual stock goes belong the Min Quantity, Open ERP generates "\
"a procurement to bring the virtual stock to the Max Quantity."),
'product_max_qty': fields.float('Max Quantity', required=True,
- help="When the virtual stock goes belong the Mix Quantity, Open ERP generates "\
+ help="When the virtual stock goes belong the Max Quantity, Open ERP generates "\
"a procurement to bring the virtual stock to the Max Quantity."),
'qty_multiple': fields.integer('Qty Multiple', required=True,
help="The procurement quantity will by rounded up to this multiple."),
diff --git a/addons/project/project.py b/addons/project/project.py
index 169a2043b20..0d62929416e 100644
--- a/addons/project/project.py
+++ b/addons/project/project.py
@@ -174,6 +174,9 @@ class project(osv.osv):
def set_done(self, cr, uid, ids, context=None):
self.write(cr, uid, ids, {'state':'close'}, context=context)
+ for (id, name) in self.name_get(cr, uid, ids):
+ message = _('Project ') + " '" + name + "' "+ _("is Closed.")
+ self.log(cr, uid, id, message)
return True
def set_cancel(self, cr, uid, ids, context=None):
@@ -190,6 +193,9 @@ class project(osv.osv):
def reset_project(self, cr, uid, ids, context=None):
res = self.setActive(cr, uid, ids, value=True, context=context)
+ for (id, name) in self.name_get(cr, uid, ids):
+ message = _('Project ') + " '" + name + "' "+ _("is Open.")
+ self.log(cr, uid, id, message)
return res
def copy(self, cr, uid, id, default={}, context=None):
@@ -434,6 +440,8 @@ class task(osv.osv):
elif project.warn_manager:
task_id = ids[0]
mail_send = True
+ message = _('Task ') + " '" + task.name + "' "+ _("is Done.")
+ self.log(cr, uid, task.id, message)
self.write(cr, uid, [task.id], {'state': 'done', 'date_end':time.strftime('%Y-%m-%d %H:%M:%S'), 'remaining_hours': 0.0})
for parent_id in task.parent_ids:
if parent_id.state in ('pending','draft'):
@@ -494,6 +502,8 @@ class task(osv.osv):
'ref_doc1': 'project.task,%d' % task.id,
'ref_doc2': 'project.project,%d' % project.id,
})
+ message = _('Task ') + " '" + task.name + "' "+ _("is Cancelled.")
+ self.log(cr, uid, task.id, message)
self.write(cr, uid, [task.id], {'state': 'cancelled', 'remaining_hours':0.0})
return True
@@ -501,6 +511,8 @@ class task(osv.osv):
tasks= self.browse(cr,uid,ids)
for t in tasks:
self.write(cr, uid, [t.id], {'state': 'open'})
+ message = _('Task ') + " '" + t.name + "' "+ _("is Open.")
+ self.log(cr, uid, t.id, message)
return True
def do_draft(self, cr, uid, ids, *args):
@@ -510,6 +522,9 @@ class task(osv.osv):
def do_pending(self, cr, uid, ids, *args):
self.write(cr, uid, ids, {'state': 'pending'})
+ for (id, name) in self.name_get(cr, uid, ids):
+ message = _('Task ') + " '" + name + "' "+ _("is Pending.")
+ self.log(cr, uid, id, message)
return True
def next_type(self, cr, uid, ids, *args):
diff --git a/addons/project/wizard/project_task_delegate.py b/addons/project/wizard/project_task_delegate.py
index 30fc02f9ca3..779909273df 100644
--- a/addons/project/wizard/project_task_delegate.py
+++ b/addons/project/wizard/project_task_delegate.py
@@ -82,12 +82,13 @@ class project_task_delegate(osv.osv_memory):
'prefix': _get_prefix,
'new_task_description': _get_new_desc,
'state': 'pending',
- }
+ }
def validate(self, cr, uid, ids, context=None):
if context is None:
context = {}
task_obj = self.pool.get('project.task')
+ user_obj = self.pool.get('res.users')
delegate_data = self.read(cr, uid, ids, context=context)[0]
task = task_obj.browse(cr, uid, context['active_id'], context=context)
newname = delegate_data['prefix'] or ''
@@ -111,6 +112,9 @@ class project_task_delegate(osv.osv_memory):
task_obj.do_pending(cr, uid, [task.id])
else:
task_obj.do_close(cr, uid, [task.id])
+ delegrate_user = user_obj.browse(cr, uid, delegate_data['user_id'], context=context)
+ message = _('Task ') + " '" + delegate_data['name'] + "' "+ _("is Delegated to User:") +" '"+ delegrate_user.name +"' "
+ self.log(cr, uid, task.id, message)
return {}
project_task_delegate()
diff --git a/addons/project_issue/project_issue.py b/addons/project_issue/project_issue.py
index f13f816b4ca..a67ca004f09 100644
--- a/addons/project_issue/project_issue.py
+++ b/addons/project_issue/project_issue.py
@@ -52,8 +52,26 @@ class project_issue(osv.osv, crm.crm_case):
res = super(project_issue, self).case_open(cr, uid, ids, *args)
self.write(cr, uid, ids, {'date_open': time.strftime('%Y-%m-%d %H:%M:%S')})
+ for (id, name) in self.name_get(cr, uid, ids):
+ message = _('Issue ') + " '" + name + "' "+ _("is Open.")
+ self.log(cr, uid, id, message)
return res
+ def case_close(self, cr, uid, ids, *args):
+ """
+ @param self: The object pointer
+ @param cr: the current row, from the database cursor,
+ @param uid: the current user’s ID for security checks,
+ @param ids: List of case's Ids
+ @param *args: Give Tuple Value
+ """
+
+ res = super(project_issue, self).case_close(cr, uid, ids, *args)
+ for (id, name) in self.name_get(cr, uid, ids):
+ message = _('Issue ') + " '" + name + "' "+ _("is Closed.")
+ self.log(cr, uid, id, message)
+ return res
+
def _compute_day(self, cr, uid, ids, fields, args, context=None):
if context is None:
context = {}
@@ -319,6 +337,8 @@ class project_issue(osv.osv, crm.crm_case):
if res:
vals.update(res)
res = self.create(cr, uid, vals, context)
+ message = _('An Issue created') + " '" + subject + "' " + _("from Mailgate.")
+ self.log(cr, uid, res, message)
self.convert_to_bug(cr, uid, [res], context=context)
attachents = msg.get('attachments', [])
diff --git a/addons/project_long_term/project_long_term.py b/addons/project_long_term/project_long_term.py
index 4520e798f4e..a6fbcb22ab7 100644
--- a/addons/project_long_term/project_long_term.py
+++ b/addons/project_long_term/project_long_term.py
@@ -137,6 +137,7 @@ class project_phase(osv.osv):
"""
uom_obj = self.pool.get('product.uom')
resource_obj = self.pool.get('resource.resource')
+ model_data_obj = self.pool.get('ir.model.data')
cal_obj = self.pool.get('resource.calendar')
calendar_id = phase.project_id.resource_calendar_id and phase.project_id.resource_calendar_id.id or False
resource_id = resource_obj.search(cr, uid, [('user_id', '=', phase.responsible_id.id)])
@@ -146,7 +147,7 @@ class project_phase(osv.osv):
cal_id = res.get('calendar_id', False) and res.get('calendar_id')[0] or False
if cal_id:
calendar_id = cal_id
- default_uom_id = uom_obj.search(cr, uid, [('name', '=', 'Hour')], context=context)[0]
+ default_uom_id = model_data_obj._get_id(cr, uid, 'product', 'uom_hour')
avg_hours = uom_obj._compute_qty(cr, uid, phase.product_uom.id, phase.duration, default_uom_id)
work_times = cal_obj.interval_min_get(cr, uid, calendar_id, date_end, avg_hours or 0.0, resource_id and resource_id[0] or False)
dt_start = work_times[0][0].strftime('%Y-%m-%d %H:%M:%S')
@@ -159,6 +160,7 @@ class project_phase(osv.osv):
Check And Compute date_end of phase if change in date_end > older time.
"""
uom_obj = self.pool.get('product.uom')
+ model_data_obj = self.pool.get('ir.model.data')
resource_obj = self.pool.get('resource.resource')
cal_obj = self.pool.get('resource.calendar')
calendar_id = phase.project_id.resource_calendar_id and phase.project_id.resource_calendar_id.id or False
@@ -169,7 +171,7 @@ class project_phase(osv.osv):
cal_id = res.get('calendar_id', False) and res.get('calendar_id')[0] or False
if cal_id:
calendar_id = cal_id
- default_uom_id = uom_obj.search(cr, uid, [('name', '=', 'Hour')], context=context)[0]
+ default_uom_id = model_data_obj._get_id(cr, uid, 'product', 'uom_hour')
avg_hours = uom_obj._compute_qty(cr, uid, phase.product_uom.id, phase.duration, default_uom_id)
work_times = cal_obj.interval_get(cr, uid, calendar_id, date_start, avg_hours or 0.0, resource_id and resource_id[0] or False)
dt_end = work_times[-1][1].strftime('%Y-%m-%d %H:%M:%S')
@@ -179,6 +181,7 @@ class project_phase(osv.osv):
resource_calendar_obj = self.pool.get('resource.calendar')
resource_obj = self.pool.get('resource.resource')
uom_obj = self.pool.get('product.uom')
+ model_data_obj = self.pool.get('ir.model.data')
if context is None:
context = {}
if context.get('scheduler',False):
@@ -192,7 +195,7 @@ class project_phase(osv.osv):
cal_id = resource_obj.browse(cr, uid, resource_id[0], context=context).calendar_id.id
if cal_id:
calendar_id = cal_id
- default_uom_id = uom_obj.search(cr, uid, [('name', '=', 'Hour')])[0]
+ default_uom_id = model_data_obj._get_id(cr, uid, 'product', 'uom_hour')
avg_hours = uom_obj._compute_qty(cr, uid, phase.product_uom.id, phase.duration, default_uom_id)
# Change the date_start and date_end
diff --git a/addons/project_long_term/wizard/project_compute_phases.py b/addons/project_long_term/wizard/project_compute_phases.py
index 3b4ac2d7b23..3ee15bc6c5a 100644
--- a/addons/project_long_term/wizard/project_compute_phases.py
+++ b/addons/project_long_term/wizard/project_compute_phases.py
@@ -60,6 +60,7 @@ class project_compute_phases(osv.osv_memory):
phase_obj = self.pool.get('project.phase')
resource_obj = self.pool.get('resource.resource')
uom_obj = self.pool.get('product.uom')
+ model_data_obj = self.pool.get('ir.model.data')
phase_resource_obj = False
if context is None:
@@ -81,7 +82,7 @@ class project_compute_phases(osv.osv_memory):
'vacation': tuple(leaves),
'efficiency': time_efficiency
})
- default_uom_id = uom_obj.search(cr, uid, [('name','=','Hour')])[0]
+ default_uom_id = model_data_obj._get_id(cr, uid, 'product', 'uom_hour')
avg_hours = uom_obj._compute_qty(cr, uid, phase.product_uom.id, phase.duration, default_uom_id)
duration = str(avg_hours) + 'H'
# Create a new project for each phase
diff --git a/addons/report_intrastat/report_intrastat.py b/addons/report_intrastat/report_intrastat.py
index 3bf58ea034e..532bede5ac3 100644
--- a/addons/report_intrastat/report_intrastat.py
+++ b/addons/report_intrastat/report_intrastat.py
@@ -88,26 +88,12 @@ class report_intrastat(osv.osv):
else 0
end) as value,
sum(
- case when uom.category_id != puom.category_id then pt.weight_net * inv_line.quantity
- else
- case when uom.factor_inv_data > 0
- then
- pt.weight_net * inv_line.quantity * uom.factor_inv_data
- else
- pt.weight_net * inv_line.quantity / uom.factor
- end
- end
+ case when uom.category_id != puom.category_id then (pt.weight_net * inv_line.quantity)
+ else (pt.weight_net * inv_line.quantity * uom.factor) end
) as weight,
sum(
case when uom.category_id != puom.category_id then inv_line.quantity
- else
- case when uom.factor_inv_data > 0
- then
- inv_line.quantity * uom.factor_inv_data
- else
- inv_line.quantity / uom.factor
- end
- end
+ else (inv_line.quantity * uom.factor) end
) as supply_units,
inv.currency_id as currency_id,
diff --git a/addons/sale_crm/wizard/crm_make_sale.py b/addons/sale_crm/wizard/crm_make_sale.py
index ca0230b1ddf..e54d5d2a374 100644
--- a/addons/sale_crm/wizard/crm_make_sale.py
+++ b/addons/sale_crm/wizard/crm_make_sale.py
@@ -98,7 +98,7 @@ class crm_make_sale(osv.osv_memory):
raise osv.except_osv(_('Data Insufficient!'),_('Customer has no addresses defined!'))
vals = {
- 'origin': 'CRM-Opportunity:%s' % str(case.id),
+ 'origin': 'Opportunity:%s' % str(case.id),
'section_id': case.section_id and case.section_id.id or False,
'picking_policy': make.picking_policy,
'shop_id': make.shop_id.id,
@@ -129,6 +129,8 @@ class crm_make_sale(osv.osv_memory):
case_obj.write(cr, uid, [case.id], {'ref': 'sale.order,%s' % new_id})
new_ids.append(new_id)
+ message = _('Opportunity ') + " '" + case.name + "' "+ _("is converted to Sales Quotation.")
+ self.log(cr, uid, case.id, message)
if make.close:
case_obj.case_close(cr, uid, data)
diff --git a/addons/sale_order_dates/__init__.py b/addons/sale_order_dates/__init__.py
index ed4a8b0a952..cca0e2251db 100644
--- a/addons/sale_order_dates/__init__.py
+++ b/addons/sale_order_dates/__init__.py
@@ -19,7 +19,7 @@
#
##############################################################################
-import sale
+import sale_order_dates
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/scrum/scrum.py b/addons/scrum/scrum.py
index 614ef493e96..d4434968c51 100644
--- a/addons/scrum/scrum.py
+++ b/addons/scrum/scrum.py
@@ -92,10 +92,16 @@ class scrum_sprint(osv.osv):
def button_open(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'open'}, context=context)
+ for (id, name) in self.name_get(cr, uid, ids):
+ message = _('Sprint ') + " '" + name + "' "+ _("is Open.")
+ self.log(cr, uid, id, message)
return True
def button_close(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'done'}, context=context)
+ for (id, name) in self.name_get(cr, uid, ids):
+ message = _('Sprint ') + " '" + name + "' "+ _("is Closed.")
+ self.log(cr, uid, id, message)
return True
def button_pending(self, cr, uid, ids, context={}):
@@ -205,12 +211,17 @@ class scrum_product_backlog(osv.osv):
def button_open(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'open'}, context=context)
+ for (id, name) in self.name_get(cr, uid, ids):
+ message = _('Product Backlog ') + " '" + name + "' "+ _("is Open.")
+ self.log(cr, uid, id, message)
return True
def button_close(self, cr, uid, ids, context={}):
self.write(cr, uid, ids, {'state':'done'}, context=context)
for backlog in self.browse(cr, uid, ids, context=context):
self.pool.get('project.task').write(cr, uid, [i.id for i in backlog.tasks_id], {'state': 'done'})
+ message = _('Product Backlog ') + " '" + backlog.name + "' "+ _("is Closed.")
+ self.log(cr, uid, backlog.id, message)
return True
def button_pending(self, cr, uid, ids, context={}):
diff --git a/addons/scrum/wizard/scrum_backlog_sprint.py b/addons/scrum/wizard/scrum_backlog_sprint.py
index 108e5a48cc3..308ac75795e 100644
--- a/addons/scrum/wizard/scrum_backlog_sprint.py
+++ b/addons/scrum/wizard/scrum_backlog_sprint.py
@@ -19,6 +19,7 @@
#
##############################################################################
from osv import osv, fields
+from tools.translate import _
class backlog_sprint_assign(osv.osv_memory):
_name = 'backlog.assign.sprint'
@@ -35,6 +36,7 @@ class backlog_sprint_assign(osv.osv_memory):
def assign_sprint(self, cr, uid, ids, context=None):
backlog_obj = self.pool.get('scrum.product.backlog')
+ sprint_obj = self.pool.get('scrum.sprint')
task = self.pool.get('project.task')
backlog_ids = []
if context is None:
@@ -43,7 +45,7 @@ class backlog_sprint_assign(osv.osv_memory):
for backlog in backlog_obj.browse(cr, uid, context['active_ids'], context=context):
backlog_ids.append(backlog.id)
if data['convert_to_task']:
- task.create(cr, uid, {
+ task_id = task.create(cr, uid, {
'product_backlog_id': backlog.id,
'name': backlog.name,
'description': backlog.note,
@@ -52,11 +54,16 @@ class backlog_sprint_assign(osv.osv_memory):
'planned_hours':backlog.expected_hours,
'remaining_hours':backlog.expected_hours,
})
+ message = _('Product Backlog') + " '" + backlog.name + "' "+ _("is converted into Task %d."%(task_id,))
+ self.log(cr, uid, backlog.id, message)
if data['state_open'] and backlog.state == "draft":
backlog_obj.write(cr, uid, backlog.id, {'state':'open'})
+ sprint = sprint_obj.browse(cr, uid, data['sprint_id'], context=context)
+ message = _('Product Backlog') + " '" + backlog.name + "' "+ _("is assigned sprint:%s"%(sprint.name))
+ self.log(cr, uid, backlog.id, message)
backlog_obj.write(cr, uid, backlog_ids, {'sprint_id': data['sprint_id']}, context=context)
return {}
backlog_sprint_assign()
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
diff --git a/addons/stock/stock.py b/addons/stock/stock.py
index 9bc40a1e691..d44c327b699 100644
--- a/addons/stock/stock.py
+++ b/addons/stock/stock.py
@@ -1843,7 +1843,9 @@ class stock_move(osv.osv):
'line_id': line,
'ref': move.picking_id and move.picking_id.name,
})
-
+
+ message = _('Move line') + " '" + move.name + "' "+ _("is processed.")
+ self.log(cr, uid, move.id, message)
# This can be removed
#tracking_lot = False
#if context:
@@ -1864,7 +1866,7 @@ class stock_move(osv.osv):
wf_service.trg_write(uid, 'stock.picking', pick_id, cr)
for (id,name) in picking_obj.name_get(cr, uid, picking_ids):
- message = _('Document') + " '" + name + "' "+ _("is processed")
+ message = _('Document') + " '" + name + "' "+ _("is processed.")
self.log(cr, uid, id, message)
return True
@@ -1938,6 +1940,8 @@ class stock_move(osv.osv):
new_move = self.copy(cr, uid, move.id, default_val)
#self.write(cr, uid, [new_move], {'move_history_ids':[(4,move.id)]}) #TODO : to track scrap moves
res += [new_move]
+ message = _('Product ') + " '" + move.product_id.name + "' "+ _("is scraped with") + " '" + str(move.product_qty) + "' "+ _("quantity.")
+ self.log(cr, uid, move.id, message)
self.action_done(cr, uid, res)
return res
@@ -2064,6 +2068,8 @@ class stock_move(osv.osv):
}
self.write(cr, uid, [move.id], update_val)
+ message = _('Product ') + " '" + move.product_id.name + "' "+ _("is consumed with") + " '" + str(move.product_qty) + "' "+ _("quantity.")
+ self.log(cr, uid, move.id, message)
self.action_done(cr, uid, res)
return res
@@ -2229,6 +2235,7 @@ class stock_inventory(osv.osv):
# price = line.product_id.standard_price or 0.0
amount = self.pool.get('stock.location')._product_get(cr, uid, line.location_id.id, [pid], {'uom': line.product_uom.id})[pid]
+ #TOCHECK: Why put restriction like new inventory qty should greater available qty ?
change = line.product_qty - amount
lot_id = line.prod_lot_id.id
if change:
@@ -2260,6 +2267,8 @@ class stock_inventory(osv.osv):
'product_qty': line.product_qty
})
move_ids.append(self._inventory_line_hook(cr, uid, line, value))
+ message = _('Inventory') + " '" + inv.name + "' "+ _("is done.")
+ self.log(cr, uid, inv.id, message)
self.write(cr, uid, [inv.id], {'state': 'done', 'date_done': time.strftime('%Y-%m-%d %H:%M:%S'), 'move_ids': [(6, 0, move_ids)]})
return True
diff --git a/addons/stock/wizard/stock_inventory_line_split.py b/addons/stock/wizard/stock_inventory_line_split.py
index b07d27c7656..5c4e8f708d2 100644
--- a/addons/stock/wizard/stock_inventory_line_split.py
+++ b/addons/stock/wizard/stock_inventory_line_split.py
@@ -47,7 +47,11 @@ class stock_inventory_line_split(osv.osv_memory):
res = {}
line = self.pool.get('stock.inventory.line').browse(cr, uid, record_id)
if 'product_id' in fields:
- res.update({'product_id':line.product_id.id})
+ res.update({'product_id':line.product_id.id})
+ if 'product_uom' in fields:
+ res.update({'product_uom': line.product_uom.id})
+ if 'qty' in fields:
+ res.update({'qty': line.product_qty})
return res
def split(self, cr, uid, ids, line_ids, context=None):
@@ -68,11 +72,13 @@ class stock_inventory_line_split(osv.osv_memory):
for inv_line in line_obj.browse(cr, uid, line_ids):
line_qty = inv_line.product_qty
quantity_rest = inv_line.product_qty
- new_line = []
- for line in data.line_ids:
+ new_line = []
+ if data.use_exist:
+ lines = [l for l in data.line_exist_ids if l]
+ else:
+ lines = [l for l in data.line_ids if l]
+ for line in lines:
quantity = line.quantity
-
-
if quantity <= 0 or line_qty == 0:
continue
quantity_rest -= quantity
@@ -85,14 +91,13 @@ class stock_inventory_line_split(osv.osv_memory):
current_line = line_obj.copy(cr, uid, inv_line.id, default_val)
new_line.append(current_line)
prodlot_id = False
- if line.use_exist and line.name:
- prodlot_id = prodlot_obj.search(cr, uid, [('prefix','=',line.name),('product_id','=',data.product_id.id)])
- if prodlot_id:
- prodlot_id = prodlot_id[0]
+ if data.use_exist:
+ prodlot_id = line.prodlot_id.id
if not prodlot_id:
- sequence = ir_sequence_obj.get(cr, uid, 'stock.lot.serial')
- prodlot_id = prodlot_obj.create(cr, uid, {'name': sequence, 'prefix' : line.name},
- {'product_id': data.product_id.id})
+ prodlot_id = prodlot_obj.create(cr, uid, {
+ 'name': line.name,
+ 'product_id': inv_line.product_id.id},
+ context=context)
line_obj.write(cr, uid, [current_line], {'prod_lot_id': prodlot_id})
prodlot = prodlot_obj.browse(cr, uid, prodlot_id)
diff --git a/addons/stock/wizard/stock_inventory_line_split_view.xml b/addons/stock/wizard/stock_inventory_line_split_view.xml
index 42b8a4648da..fc188184c42 100644
--- a/addons/stock/wizard/stock_inventory_line_split_view.xml
+++ b/addons/stock/wizard/stock_inventory_line_split_view.xml
@@ -1,38 +1,61 @@
-
-
- Split inventory lines
- stock.inventory.line.split
- form
-
-
-
-
-
-
+
+ Split Inventory Line
+ stock.inventory.line.split
+ form
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Split inventory linesir.actions.act_window
diff --git a/addons/survey/wizard/survey_selection.py b/addons/survey/wizard/survey_selection.py
index beb0fe6571f..29eaddff164 100644
--- a/addons/survey/wizard/survey_selection.py
+++ b/addons/survey/wizard/survey_selection.py
@@ -67,12 +67,16 @@ class survey_name_wiz(osv.osv_memory):
user_rec = user_obj.read(cr, uid, uid)
for sur in surv_obj.browse(cr, uid, surv_obj.search(cr, uid, [])):
if sur.state == 'open':
-# if group_id[0] in user_rec['groups_id']:
+ res = False
for i in group_id:
if i in user_rec['groups_id']:
- result.append((sur.id, sur.title))
+ res = True
+ break
elif sur.id in user_rec['survey_id']:
- result.append((sur.id, sur.title))
+ res = True
+ break
+ if res:
+ result.append((sur.id, sur.title))
return result
_columns = {
@@ -137,14 +141,13 @@ class survey_name_wiz(osv.osv_memory):
def on_change_survey(self, cr, uid, ids, survey_id, context=None):
"""
on change event of survey_id field, if note is available in selected survey then display this note in note fields.
-
- @param self: The object pointer
- @param cr: the current row, from the database cursor,
- @param uid: the current user’s ID for security checks,
@param ids: List of Survey IDs
+ @param survey_id: Id of Survey
@param context: A standard dictionary for contextual values
@return : Dictionary values of notes fields.
"""
+ if not survey_id:
+ return {}
notes = self.pool.get('survey').read(cr, uid, survey_id, ['note'])['note']
return {'value': {'note': notes}}
diff --git a/addons/thunderbird/installer.py b/addons/thunderbird/installer.py
index 8fe0a4aac33..2225c1b8dbb 100644
--- a/addons/thunderbird/installer.py
+++ b/addons/thunderbird/installer.py
@@ -50,7 +50,7 @@ class thunderbird_installer(osv.osv_memory):
'thunderbird' : True,
'name' : 'tiny_plugin-2.0.xpi',
'pdf_name' : 'Installation Guide to OpenERP Thunderbid Plug-in.pdf',
- 'description' : """ * Save the Thunderbird plugin. \n * Follow the following step to install Thunderbird plugin. \n -> 1.From Menu Bar of Thunderbird, open Tools > Add ons. \n -> 2. Click on install button and a browser window appears. \n -> 3. Select the plug-in(.xpi file) and click Ok. \n -> 4. Software installation window appears and within a short time “Install Now” button will be enabled -> 5. Click "Install Now". \n -> 6. Restart Thunderbird."""
+ 'description' : """ * Save the Thunderbird plugin. \n * Follows the following step to install Thunderbird plugin. \n -> 1.From Menu Bar of Thunderbird, open Tools > Add ons. \n -> 2. Click on install button and a browser window appears. \n -> 3. Select the plug-in(.xpi file) and click Ok. \n -> 4. Software installation window appears and within a short time “Install Now” button will be enabled -> 5. Click "Install Now". \n -> 6. Restart Thunderbird."""
}
thunderbird_installer()
diff --git a/addons/thunderbird/plugin/tiny_plugin-2.0.xpi b/addons/thunderbird/plugin/tiny_plugin-2.0.xpi
index 9b9e95aec2f..2cba195ac62 100644
Binary files a/addons/thunderbird/plugin/tiny_plugin-2.0.xpi and b/addons/thunderbird/plugin/tiny_plugin-2.0.xpi differ
diff --git a/addons/wiki/__openerp__.py b/addons/wiki/__openerp__.py
index 074c44b0a87..1b65dd4d92b 100644
--- a/addons/wiki/__openerp__.py
+++ b/addons/wiki/__openerp__.py
@@ -42,8 +42,8 @@ keep track for the wiki groups, pages, and history
'data/wiki_main.xml',
'security/ir.model.access.csv'
],
- 'demo_xml': ['test/wiki_test00.yml'],
- # 'test': ['test/wiki_test00.yml'],
+ 'demo_xml': [],
+ 'test': ['test/wiki_test00.yml'],
'installable': True,
'active': False,
'certificate': '0086363630317',
diff --git a/addons/wiki/test/wiki_test00.yml b/addons/wiki/test/wiki_test00.yml
index 48cdacab11d..e53871ed277 100755
--- a/addons/wiki/test/wiki_test00.yml
+++ b/addons/wiki/test/wiki_test00.yml
@@ -21,11 +21,7 @@
FAQs, quality manuals, technical references, etc.
'
--
- I Get Help on this current page by clicking on "Basic wiki Editing" wizard
--
- !python {model: wiki.wiki}: |
- self.open_wiki_page(cr, uid, [ref("wiki_wiki_openerpwikiediting0")], context)
+
-
I create Index on this current page by clicking on "Create Index" wizard
-