[IMP] remove get_soryby from common header, separate it to general ledger, changes into account journal
[MERGE] merge with main branch bzr revid: mra@mra-laptop-20100726123421-mwew7myt3sfesdcz
This commit is contained in:
commit
97b969804f
|
@ -107,7 +107,7 @@ class journal_print(report_sxw.rml_parse, common_report_header):
|
|||
return 'Date'
|
||||
elif self.sort_selection == 'ref':
|
||||
return 'Reference Number'
|
||||
return super(journal_print ,self)._get_sortby(data)
|
||||
return 'Date'
|
||||
|
||||
report_sxw.report_sxw('report.account.journal.period.print', 'account.journal.period', 'addons/account/report/account_journal.rml', parser=journal_print, header='internal')
|
||||
|
||||
|
|
|
@ -81,12 +81,7 @@ class common_report_header(object):
|
|||
return ''
|
||||
|
||||
def _get_sortby(self, data):
|
||||
if data.get('form', False) and data['form'].get('sortby', False):
|
||||
if data['form']['sortby']=='sort_date':
|
||||
return 'Date'
|
||||
elif data['form']['sortby'] == 'sort_journal_partner':
|
||||
return 'Journal & Partner'
|
||||
return ''
|
||||
raise (_('Error'), _('Not implemented'))
|
||||
|
||||
def _get_filter(self, data):
|
||||
if data.get('form', False) and data['form'].get('filter', False):
|
||||
|
|
|
@ -229,6 +229,13 @@ class general_ledger(rml_parse.rml_parse, common_report_header):
|
|||
sum_currency += self.cr.fetchone()[0] or 0.0
|
||||
return str(sum_currency)
|
||||
|
||||
def _get_sortby(self, data):
|
||||
if self.sortby == 'sort_date':
|
||||
return 'Date'
|
||||
elif self.sortby == 'sort_journal_partner':
|
||||
return 'Journal & Partner'
|
||||
return 'Date'
|
||||
|
||||
report_sxw.report_sxw('report.account.general.ledger', 'account.account', 'addons/account/report/general_ledger.rml', parser=general_ledger, header='internal')
|
||||
report_sxw.report_sxw('report.account.general.ledger_landscape', 'account.account', 'addons/account/report/general_ledger_landscape.rml', parser=general_ledger, header='internal')
|
||||
|
||||
|
|
|
@ -282,6 +282,8 @@ the rule to mark CC(mail to any other person defined in actions)."),
|
|||
ok = ok and (not action.trg_state_from or action.trg_state_from==obj.state)
|
||||
if state_to:
|
||||
ok = ok and (not action.trg_state_to or action.trg_state_to==state_to)
|
||||
elif action.trg_state_to:
|
||||
ok = False
|
||||
reg_name = action.regex_name
|
||||
result_name = True
|
||||
if reg_name:
|
||||
|
|
|
@ -429,7 +429,7 @@ class crm_case(object):
|
|||
rule_obj = self.pool.get('base.action.rule')
|
||||
model_obj = self.pool.get('ir.model')
|
||||
model_ids = model_obj.search(cr, uid, [('model','=',self._name)])
|
||||
rule_ids = rule_obj.search(cr, uid, [('name','=',model_ids[0])])
|
||||
rule_ids = rule_obj.search(cr, uid, [('model_id','=',model_ids[0])])
|
||||
return rule_obj._action(cr, uid, rule_ids, cases, scrit=scrit, context=context)
|
||||
|
||||
def format_body(self, body):
|
||||
|
|
|
@ -738,7 +738,8 @@ class mrp_production(osv.osv):
|
|||
|
||||
wf_service = netsvc.LocalService("workflow")
|
||||
wf_service.trg_validate(uid, 'mrp.production', production_id, 'button_produce_done', cr)
|
||||
message = str(production_qty) + " '[" + production.product_id.code + '] ' + production.product_id.name + _("' have been manufactured for ") + production.name
|
||||
for (id, name) in self.pool.get('product.product').name_get(cr, uid, [production.product_id.id]):
|
||||
message = str(production_qty) + ' ' + production.product_uom.name +" '" + name + _("' have been manufactured for ") + production.name
|
||||
self.log(cr, uid, production_id, message)
|
||||
return True
|
||||
|
||||
|
|
|
@ -21,7 +21,9 @@
|
|||
|
||||
from osv import fields, osv
|
||||
import time
|
||||
from mx import DateTime
|
||||
from datetime import datetime
|
||||
from dateutil.relativedelta import relativedelta
|
||||
|
||||
class sale_order_dates(osv.osv):
|
||||
_inherit = 'sale.order'
|
||||
_name = 'sale.order'
|
||||
|
@ -45,7 +47,7 @@ class sale_order_dates(osv.osv):
|
|||
for order in self.browse(cr, uid, ids):
|
||||
dates_list = []
|
||||
for line in order.order_line:
|
||||
dt=DateTime.strptime(order.date_order, '%Y-%m-%d') + DateTime.RelativeDateTime(days=line.delay or 0.0)
|
||||
dt = datetime.strptime(order.date_order, '%Y-%m-%d') + relativedelta(days=line.delay or 0.0)
|
||||
dt_s = dt.strftime('%Y-%m-%d')
|
||||
dates_list.append(dt_s)
|
||||
if dates_list:
|
||||
|
|
Loading…
Reference in New Issue