Merge with main branch

bzr revid: mra@mra-laptop-20100730132024-kq94ju89uywdvu7x
This commit is contained in:
Mustufa Rangwala 2010-07-30 18:50:24 +05:30
commit 2152922daa
40 changed files with 297 additions and 212 deletions

View File

@ -629,8 +629,8 @@ class account_journal(osv.osv):
'currency': fields.many2one('res.currency', 'Currency', help='The currency used to enter statement'),
'entry_posted': fields.boolean('Skip \'Draft\' State for Created Entries', help='Check this box if you don\'t want new account moves to pass through the \'draft\' state and instead goes directly to the \'posted state\' without any manual validation.'),
'company_id': fields.many2one('res.company', 'Company', required=True, select=1, help="Company related to this journal"),
# 'invoice_sequence_id': fields.many2one('ir.sequence', 'Invoice Sequence', \
# help="The sequence used for invoice numbers in this journal."),
'invoice_sequence_id': fields.many2one('ir.sequence', 'Invoice Sequence', \
help="The sequence used for invoice numbers in this journal."),
'allow_date':fields.boolean('Check Date not in the Period', help= 'If set to True then do not accept the entry if the entry date is not into the period dates'),
}
@ -695,13 +695,13 @@ class account_journal(osv.osv):
'sequence_id':seq_id
})
# if journal.type in journal_type and not journal.invoice_sequence_id:
# res_ids = date_pool.search(cr, uid, [('model','=','ir.sequence'), ('name','=',journal_seq.get(journal.type, 'sale'))])
# inv_seq_id = date_pool.browse(cr, uid, res_ids[0]).res_id
# inv_seq_id
# res.update({
# 'invoice_sequence_id':inv_seq_id
# })
if journal.type in journal_type and not journal.invoice_sequence_id:
res_ids = date_pool.search(cr, uid, [('model','=','ir.sequence'), ('name','=',journal_seq.get(journal.type, 'sale'))])
inv_seq_id = date_pool.browse(cr, uid, res_ids[0]).res_id
inv_seq_id
res.update({
'invoice_sequence_id':inv_seq_id
})
result = self.write(cr, uid, [journal.id], res)

View File

@ -49,9 +49,16 @@ class account_bank_statement(osv.osv):
}
def _default_journal_id(self, cr, uid, context={}):
if context.get('journal_id', False):
return context['journal_id']
return False
journal_pool = self.pool.get('account.journal')
journal_type = context.get('journal_type', False)
journal_id = False
if journal_type:
ids = journal_pool.search(cr, uid, [('type', '=', journal_type)])
if ids:
journal_id = ids[0]
return journal_id
def _default_balance_start(self, cr, uid, context={}):
cr.execute('select id from account_bank_statement where journal_id=%s order by date desc limit 1', (1,))
@ -128,7 +135,7 @@ class account_bank_statement(osv.osv):
'date': fields.date('Date', required=True,
states={'confirm': [('readonly', True)]}),
'journal_id': fields.many2one('account.journal', 'Journal', required=True,
states={'confirm': [('readonly', True)]}, domain=[('type', '=', 'cash')]),
states={'confirm': [('readonly', True)]}, domain=[('type', '=', 'bank')]),
'period_id': fields.many2one('account.period', 'Period', required=True,
states={'confirm':[('readonly', True)]}),
'balance_start': fields.float('Starting Balance', digits_compute=dp.get_precision('Account'),

View File

@ -118,18 +118,18 @@ class account_cash_statement(osv.osv):
res2[statement.id]=encoding_total
return res2
def _default_journal_id(self, cr, uid, context={}):
# def _default_journal_id(self, cr, uid, context={}):
""" To get default journal for the object"
@param name: Names of fields.
@return: journal
"""
company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
journal = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', company_id)])
if journal:
return journal[0]
else:
return False
# """ To get default journal for the object"
# @param name: Names of fields.
# @return: journal
# """
# company_id = self.pool.get('res.users').browse(cr, uid, uid).company_id.id
# journal = self.pool.get('account.journal').search(cr, uid, [('type', '=', 'cash'), ('company_id', '=', company_id)])
# if journal:
# return journal[0]
# else:
# return False
def _end_balance(self, cursor, user, ids, name, attr, context=None):
res_currency_obj = self.pool.get('res.currency')
@ -174,7 +174,7 @@ class account_cash_statement(osv.osv):
return company_id
def _get_cash_box_lines(self, cr, uid, ids, context={}):
def _get_cash_open_box_lines(self, cr, uid, ids, context={}):
res = []
curr = [1, 2, 5, 10, 20, 50, 100, 500]
for rs in curr:
@ -182,12 +182,23 @@ class account_cash_statement(osv.osv):
'pieces':rs,
'number':0
}
res.append((0,0,dct))
res.append(dct)
return res
def _get_cash_close_box_lines(self, cr, uid, ids, context={}):
res = []
curr = [1, 2, 5, 10, 20, 50, 100, 500]
for rs in curr:
dct = {
'pieces':rs,
'number':0
}
res.append((0, 0, dct))
return res
_columns = {
'company_id':fields.many2one('res.company', 'Company', required=False),
'journal_id': fields.many2one('account.journal', 'Journal', required=True),
'journal_id': fields.many2one('account.journal', 'Journal', required=True, domain=[('type', '=', 'cash')]),
'balance_end_real': fields.float('Closing Balance', digits_compute=dp.get_precision('Account'), states={'confirm':[('readonly', True)]}, help="closing balance entered by the cashbox verifier"),
'state': fields.selection(
[('draft', 'Draft'),
@ -206,11 +217,10 @@ class account_cash_statement(osv.osv):
'state': lambda *a: 'draft',
'name': lambda *a: '/',
'date': lambda *a:time.strftime("%Y-%m-%d %H:%M:%S"),
'journal_id': _default_journal_id,
'user_id': lambda self, cr, uid, context=None: uid,
'company_id': _get_company,
'starting_details_ids':_get_cash_box_lines,
'ending_details_ids':_get_cash_box_lines
'starting_details_ids':_get_cash_open_box_lines,
'ending_details_ids':_get_cash_open_box_lines
}
def create(self, cr, uid, vals, context=None):
@ -224,7 +234,19 @@ class account_cash_statement(osv.osv):
open_jrnl = self.search(cr, uid, sql)
if open_jrnl:
raise osv.except_osv('Error', _('You can not have two open register for the same journal'))
if self.pool.get('account.journal').browse(cr, uid, vals['journal_id']).type == 'cash':
lines = end_lines = self._get_cash_close_box_lines(cr, uid, [], context)
vals.update({
'ending_details_ids':lines
})
else:
vals.update({
'ending_details_ids':False,
'starting_details_ids':False
})
res_id = super(account_cash_statement, self).create(cr, uid, vals, context=context)
self.write(cr, uid, [res_id], {})
return res_id
def write(self, cr, uid, ids, vals, context=None):

View File

@ -388,14 +388,15 @@
<field name="centralisation" groups="base.group_extended"/>
<field name="entry_posted"/>
</group>
<group colspan="2" col="2">
<separator string="Invoicing Data" colspan="4"/>
<field name="invoice_sequence_id"/>
<field name="group_invoice_lines"/>
</group>
<group colspan="2" col="2" groups="base.group_extended">
<separator string="Sequence" colspan="4"/>
<field name="sequence_id"/>
</group>
<group colspan="2" col="2">
<separator string="Invoicing Data" colspan="4"/>
<field name="group_invoice_lines"/>
</group>
</page>
<page string="Entry Controls" groups="base.group_extended">
<separator colspan="4" string="Accounts Type Allowed (empty for no control)"/>
@ -530,9 +531,13 @@
<field colspan="4" name="move_line_ids" nolabel="1"/>
</page>
</notebook>
<group col="7" colspan="4">
<group col="8" colspan="4">
<field name="state"/>
<field name="balance_end"/>
<button name="%(action_view_account_statement_from_invoice_lines)d"
string="Import Invoice" type="action" attrs="{'invisible':[('state','=','confirm')]}"/>
<button name="button_dummy" states="draft" string="Compute" icon="terp-stock_format-scientific"/>
<button name="button_confirm_bank" states="draft" string="Confirm" type="object" icon="terp-camera_test"/>
<button name="button_cancel" states="confirm" string="Cancel" type="object" icon="gtk-cancel"/>
@ -546,6 +551,7 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form,graph</field>
<field name="domain">[('journal_id.type', '=', 'bank')]</field>
<field name="context">{'journal_type':'bank'}</field>
</record>
<record model="ir.actions.act_window.view" id="action_bank_statement_tree_bank">
<field name="sequence" eval="1"/>
@ -2563,6 +2569,7 @@
<field name="view_id" ref="view_cash_statement_tree"/>
<field name="search_view_id" ref="view_account_bank_statement_filter"/>
<field name="domain">[('journal_id.type', '=', 'cash')]</field>
<field name="context">{'journal_type':'cash'}</field>
</record>
<record model="ir.actions.act_window.view" id="act_cash_statement1_all">
<field name="sequence" eval="1"/>

View File

@ -298,8 +298,8 @@ class account_installer(osv.osv_memory):
# Creating Journals Sales and Purchase
vals_journal={}
data_id = data_pool.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_sp_journal_view')])
data = data_pool.browse(cr, uid, data_id[0])
data_id = mod_obj.search(cr, uid, [('model','=','account.journal.view'), ('name','=','account_sp_journal_view')])
data = mod_obj.browse(cr, uid, data_id[0])
view_id = data.res_id
seq_id = obj_sequence.search(cr,uid,[('name','=','Account Journal')])[0]

View File

@ -231,8 +231,8 @@ class account_invoice(osv.osv):
('in_refund','Supplier Refund'),
],'Type', readonly=True, select=True, change_default=True),
'number': fields.related('move_id','name', type='char', readonly=True, size=64, relation='account.move', store=True, string='Number'),
#'number': fields.char('Invoice Number', size=32, readonly=True, help="Unique number of the invoice, computed automatically when the invoice is created."),
# 'number': fields.related('move_id','name', type='char', readonly=True, size=64, relation='account.move', store=True, string='Number'),
'number': fields.char('Invoice Number', size=32, readonly=True, help="Unique number of the invoice, computed automatically when the invoice is created."),
'reference': fields.char('Invoice Reference', size=64, help="The partner reference of this invoice."),
'reference_type': fields.selection(_get_reference_type, 'Reference Type',
required=True, readonly=True, states={'draft':[('readonly',False)]}),
@ -769,7 +769,7 @@ class account_invoice(osv.osv):
cur_obj = self.pool.get('res.currency')
context = {}
for inv in self.browse(cr, uid, ids):
if not inv.journal_id.sequence_id:
if not inv.journal_id.invoice_sequence_id:
raise osv.except_osv(_('Error !'), _('Please define sequence on invoice journal'))
if not inv.invoice_line:
raise osv.except_osv(_('No Invoice Lines !'), _('Please create some invoice lines.'))
@ -927,35 +927,45 @@ class account_invoice(osv.osv):
}
def action_number(self, cr, uid, ids, *args):
#TODO: not correct fix but required a frech values before reading it.
self.write(cr, uid, ids, {})
# #TODO: not correct fix but required a frech values before reading it.
# self.write(cr, uid, ids, {})
#
cr.execute('SELECT id, type, number, move_id, reference ' \
'FROM account_invoice ' \
'WHERE id IN ('+','.join(map(str,ids))+')')
obj_inv = self.browse(cr, uid, ids)[0]
for obj_inv in self.browse(cr, uid, ids):
id = obj_inv.id
invtype = obj_inv.type
number = obj_inv.number
move_id = obj_inv.move_id and obj_inv.move_id.id or False
reference = obj_inv.reference or ''
if invtype in ('in_invoice', 'in_refund'):
ref = reference
else:
ref = self._convert_ref(cr, uid, number)
cr.execute('UPDATE account_move SET ref=%s ' \
'WHERE id=%s AND (ref is null OR ref = \'\')',
(ref, move_id))
cr.execute('UPDATE account_move_line SET ref=%s ' \
'WHERE move_id=%s AND (ref is null OR ref = \'\')',
(ref, move_id))
cr.execute('UPDATE account_analytic_line SET ref=%s ' \
'FROM account_move_line ' \
'WHERE account_move_line.move_id = %s ' \
'AND account_analytic_line.move_id = account_move_line.id',
for (id, invtype, number, move_id, reference) in cr.fetchall():
if not number:
if obj_inv.journal_id.invoice_sequence_id:
sid = obj_inv.journal_id.invoice_sequence_id.id
number = self.pool.get('ir.sequence').get_id(cr, uid, sid, 'id', {'fiscalyear_id': obj_inv.period_id.fiscalyear_id.id})
else:
number = self.pool.get('ir.sequence').get(cr, uid, 'account.invoice.' + invtype)
if invtype in ('in_invoice', 'in_refund'):
ref = reference
else:
ref = self._convert_ref(cr, uid, number)
cr.execute('UPDATE account_invoice SET number=%s ' \
'WHERE id=%s', (number, id))
cr.execute('UPDATE account_move SET ref=%s ' \
'WHERE id=%s AND (ref is null OR ref = \'\')',
(ref, move_id))
cr.execute('UPDATE account_move_line SET ref=%s ' \
'WHERE move_id=%s AND (ref is null OR ref = \'\')',
(ref, move_id))
cr.execute('UPDATE account_analytic_line SET ref=%s ' \
'FROM account_move_line ' \
'WHERE account_move_line.move_id = %s ' \
'AND account_analytic_line.move_id = account_move_line.id',
(ref, move_id))
for inv_id, name in self.name_get(cr, uid, [id]):
message = _('Invoice ') + " '" + name + "' "+ _("is validated.")
self.log(cr, uid, inv_id, message)
return True
def action_cancel(self, cr, uid, ids, *args):

View File

@ -71,7 +71,7 @@
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="currency_id" widget="selection"/>
<field name="general_account_id" widget="selection"/>
<field name="product_uom_id" widget="selection"/>

View File

@ -100,7 +100,7 @@
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="journal_id"/>
<field name="fiscalyear_id"/>
<field name="period_id"/>

View File

@ -113,7 +113,7 @@
<filter string="Year" name="year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="product_id"/>
<field name="account_id"/>
<separator orientation="vertical"/>

View File

@ -2,30 +2,75 @@
<openerp>
<data>
<record id="view_account_move_line_reconcile_prompt" model="ir.ui.view">
<field name="name">account.move.line.reconcile.prompt.form</field>
<field name="model">account.move.line.reconcile.prompt</field>
<!-- <record id="view_account_move_line_reconcile_prompt" model="ir.ui.view">-->
<!-- <field name="name">account.move.line.reconcile.prompt.form</field>-->
<!-- <field name="model">account.move.line.reconcile.prompt</field>-->
<!-- <field name="type">form</field>-->
<!-- <field name="arch" type="xml">-->
<!-- <form string="Reconciliation">-->
<!-- <separator string="Are you sure you want to reconcile entries?" colspan="4"/>-->
<!-- <group colspan="4" col="6">-->
<!-- <label string ="" colspan="2"/>-->
<!---->
<!-- <button icon="gtk-cancel" special="cancel" string="Cancel"/>-->
<!-- <button icon="gtk-ok" string="Ok" name="ask_reconcilation" type="object" default_focus="1"/>-->
<!-- </group>-->
<!-- </form>-->
<!-- </field>-->
<!-- </record>-->
<!-- <record id="action_view_account_move_line_reconcile_prompt" model="ir.actions.act_window">-->
<!-- <field name="name">Reconcile Entries</field>-->
<!-- <field name="res_model">account.move.line.reconcile.prompt</field>-->
<!-- <field name="view_type">form</field>-->
<!-- <field name="view_mode">tree,form</field>-->
<!-- <field name="view_id" ref="view_account_move_line_reconcile_prompt"/>-->
<!-- <field name="target">new</field>-->
<!-- </record>-->
<!-- <record model="ir.values" id="action_account_move_line_reconcile_prompt_values">-->
<!-- <field name="model_id" ref="account.model_account_move_line" />-->
<!-- <field name="object" eval="1" />-->
<!-- <field name="name">Reconcile Entries</field>-->
<!-- <field name="key2">client_action_multi</field>-->
<!-- <field name="value" eval="'ir.actions.act_window,' +str(ref('action_view_account_move_line_reconcile_prompt'))" />-->
<!-- <field name="key">action</field>-->
<!-- <field name="model">account.move.line</field>-->
<!-- </record>-->
<record id="view_account_move_line_reconcile_full" model="ir.ui.view">
<field name="name">account.move.line.reconcile.full.form</field>
<field name="model">account.move.line.reconcile</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Reconciliation">
<separator string="Are you sure you want to reconcile entries?" colspan="4"/>
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-ok" string="Ok" name="ask_reconcilation" type="object" default_focus="1"/>
</group>
<group height="210" width="550">
<separator string="Reconciliation transactions" colspan="4"/>
<field name="trans_nbr"/>
<newline/>
<field name="credit"/>
<field name="debit"/>
<separator string="Write-Off" colspan="4"/>
<field name="writeoff"/>
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="terp-stock_effects-object-colorize" string="Reconcile" name="trans_rec_reconcile_full" type="object" default_focus="1" attrs="{'invisible':[('writeoff','!=',0)]}"/>
<button icon="gtk-ok" string="Reconcile With Write-Off" name="trans_rec_addendum_writeoff" type="object" attrs="{'invisible':[('writeoff','==',0)]}"/>
<button icon="gtk-ok" string="Partial Reconcile" name="trans_rec_reconcile_partial_reconcile" type="object" attrs="{'invisible':[('writeoff','==',0)]}"/>
</group>
</group>
</form>
</field>
</record>
<record id="action_view_account_move_line_reconcile_prompt" model="ir.actions.act_window">
<field name="name">Reconcile Entries</field>
<field name="res_model">account.move.line.reconcile.prompt</field>
<record id="action_view_account_move_line_reconcile" model="ir.actions.act_window">
<field name="name">Reconcile Entries</field>
<field name="res_model">account.move.line.reconcile</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" ref="view_account_move_line_reconcile_prompt"/>
<field name="target">new</field>
<field name="view_id" ref="view_account_move_line_reconcile_full"/>
<field name="target">new</field>
</record>
<record model="ir.values" id="action_account_move_line_reconcile_prompt_values">
@ -36,73 +81,72 @@
<field name="value" eval="'ir.actions.act_window,' +str(ref('action_view_account_move_line_reconcile_prompt'))" />
<field name="key">action</field>
<field name="model">account.move.line</field>
</record>
<record id="view_account_move_line_reconcile_full" model="ir.ui.view">
<field name="name">account.move.line.reconcile.full.form</field>
<field name="model">account.move.line.reconcile</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Reconciliation">
<separator string="Reconciliation transactions" colspan="4"/>
<field name="trans_nbr"/>
<newline/>
<field name="credit"/>
<field name="debit"/>
<separator string="Write-Off" colspan="4"/>
<field name="writeoff"/>
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="terp-stock_effects-object-colorize" string="Reconcile" name="trans_rec_reconcile_full" type="object" default_focus="1"/>
</group>
</form>
</field>
</record>
<!-- <record id="view_account_move_line_reconcile_full" model="ir.ui.view">-->
<!-- <field name="name">account.move.line.reconcile.full.form</field>-->
<!-- <field name="model">account.move.line.reconcile</field>-->
<!-- <field name="type">form</field>-->
<!-- <field name="arch" type="xml">-->
<!-- <form string="Reconciliation">-->
<!-- <separator string="Reconciliation transactions" colspan="4"/>-->
<!-- <field name="trans_nbr"/>-->
<!-- <newline/>-->
<!-- <field name="credit"/>-->
<!-- <field name="debit"/>-->
<!-- <separator string="Write-Off" colspan="4"/>-->
<!-- <field name="writeoff"/>-->
<!-- <group colspan="4" col="6">-->
<!-- <label string ="" colspan="2"/>-->
<!-- <button icon="gtk-cancel" special="cancel" string="Cancel"/>-->
<!-- <button icon="terp-stock_effects-object-colorize" string="Reconcile" name="trans_rec_reconcile_full" type="object" default_focus="1"/>-->
<!-- </group>-->
<!-- </form>-->
<!-- </field>-->
<!-- </record>-->
<!---->
<!-- <record id="view_account_move_line_reconcile_partial" model="ir.ui.view">-->
<!-- <field name="name">account.move.line.reconcile.partial.form</field>-->
<!-- <field name="model">account.move.line.reconcile</field>-->
<!-- <field name="type">form</field>-->
<!-- <field name="arch" type="xml">-->
<!-- <form string="Reconciliation">-->
<!-- <separator string="Reconciliation transactions" colspan="4"/>-->
<!-- <field name="trans_nbr"/>-->
<!-- <newline/>-->
<!-- <field name="credit"/>-->
<!-- <field name="debit"/>-->
<!-- <separator string="Write-Off" colspan="4"/>-->
<!-- <field name="writeoff"/>-->
<!-- <group colspan="4" col="6">-->
<!-- <label string ="" colspan="2"/>-->
<!-- <button icon="gtk-cancel" special="cancel" string="Cancel"/>-->
<!-- <button icon="gtk-ok" string="Reconcile With Write-Off" name="trans_rec_addendum_writeoff" type="object" default_focus="1"/>-->
<!-- <button icon="gtk-ok" string="Partial Reconcile" name="trans_rec_reconcile_partial_reconcile" type="object"/>-->
<!-- </group>-->
<!-- </form>-->
<!-- </field>-->
<!-- </record>-->
<record id="view_account_move_line_reconcile_partial" model="ir.ui.view">
<field name="name">account.move.line.reconcile.partial.form</field>
<field name="model">account.move.line.reconcile</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Reconciliation">
<separator string="Reconciliation transactions" colspan="4"/>
<field name="trans_nbr"/>
<newline/>
<field name="credit"/>
<field name="debit"/>
<separator string="Write-Off" colspan="4"/>
<field name="writeoff"/>
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-ok" string="Reconcile With Write-Off" name="trans_rec_addendum_writeoff" type="object" default_focus="1"/>
<button icon="gtk-ok" string="Partial Reconcile" name="trans_rec_reconcile_partial_reconcile" type="object"/>
</group>
</form>
</field>
</record>
<record id="account_move_line_reconcile_writeoff" model="ir.ui.view">
<record id="account_move_line_reconcile_writeoff" model="ir.ui.view">
<field name="name">account.move.line.reconcile.writeoff.form</field>
<field name="model">account.move.line.reconcile.writeoff</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Information addendum">
<separator string="Write-Off Move" colspan="4"/>
<field name="journal_id"/>
<field name="writeoff_acc_id" domain="[('type', '&lt;&gt;', 'view')]"/>
<field name="date_p"/>
<field name="comment"/>
<separator string="Analytic" colspan="4"/>
<field name="analytic_id"/>
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-stock_effects-object-colorize" string="Reconcile" name="trans_rec_reconcile" type="object" default_focus="1"/>
<separator string="Write-Off Move" colspan="4"/>
<field name="journal_id"/>
<field name="writeoff_acc_id" domain="[('type', '&lt;&gt;', 'view')]"/>
<field name="date_p"/>
<field name="comment"/>
<separator string="Analytic" colspan="4"/>
<field name="analytic_id"/>
<group colspan="4" col="6">
<label string ="" colspan="2"/>
<button icon="gtk-cancel" special="cancel" string="Cancel"/>
<button icon="gtk-stock_effects-object-colorize" string="Reconcile" name="trans_rec_reconcile" type="object" default_focus="1"/>
</group>
</form>
</field>
</record>
</data>
</data>
</openerp>

View File

@ -124,7 +124,7 @@ Create dashboard for CRM that includes:
],
'test': [
'test/test_crm_lead.yml',
#'test/test_crm_meeting.yml',
'test/test_crm_meeting.yml',
'test/test_crm_opportunity.yml',
'test/test_crm_phonecall.yml',
],

View File

@ -163,12 +163,6 @@ class crm_lead(osv.osv, crm_case):
'priority': lambda *a: crm.AVAILABLE_PRIORITIES[2][0],
}
def create(self, cr, uid, vals, context=None):
# FIXME: Do we really need this? if yes, this is not a correct way to check for stage
# if not vals.get('stage_id',False):
# raise osv.except_osv('Error', _('There is no stage defined for this Sales Team'))
return super(crm_lead, self).create(cr, uid, vals, context=context)
def onchange_partner_address_id(self, cr, uid, ids, add, email=False):
"""This function returns value of partner email based on Partner Address
@param self: The object pointer
@ -182,7 +176,7 @@ class crm_lead(osv.osv, crm_case):
return {'value': {'email_from': False, 'country_id': False}}
address = self.pool.get('res.partner.address').browse(cr, uid, add)
return {'value': {'email_from': address.email, 'phone': address.phone, 'country_id': address.country_id.id}}
def case_open(self, cr, uid, ids, *args):
"""Overrides cancel for crm_case for setting Open Date
@param self: The object pointer
@ -195,9 +189,10 @@ class crm_lead(osv.osv, crm_case):
res = super(crm_lead, self).case_open(cr, uid, ids, *args)
if old_state == 'draft':
stage_id = super(crm_lead, self).stage_next(cr, uid, ids, *args)
if not stage_id:
raise osv.except_osv(_('Warning !'), _('There is no stage defined for this Sale Team.'))
value = self.onchange_stage_id(cr, uid, ids, stage_id, context={})['value']
if stage_id:
value = self.onchange_stage_id(cr, uid, ids, stage_id, context={})['value']
else:
value = {}
value.update({'date_open': time.strftime('%Y-%m-%d %H:%M:%S'), 'stage_id': stage_id})
self.write(cr, uid, ids, value)

View File

@ -317,20 +317,6 @@
help="Show Sales Team"/>
</field>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<field name="stage_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
<separator orientation="vertical"/>
<field name="country_id" context="{'invisible_country': False}">
<filter icon="terp-personal+" context="{'invisible_country': False}" help="Show countries"/>
</field>
<separator orientation="vertical"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<newline/>
<field name="create_date" string="Creation Date"/>
<field name="date_closed"/>
</group>
<newline/>
<group expand="0" string="Group By...">
<filter string="Stage" icon="terp-stage" domain="[]" context="{'group_by':'stage_id'}"/>
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
@ -343,6 +329,20 @@
<filter string="Creation" icon="terp-go-month"
domain="[]" context="{'group_by':'create_date'}" />
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="stage_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
<separator orientation="vertical"/>
<field name="country_id" context="{'invisible_country': False}">
<filter icon="terp-personal+" context="{'invisible_country': False}" help="Show countries"/>
</field>
<separator orientation="vertical"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<newline/>
<field name="create_date" string="Creation Date"/>
<field name="date_closed"/>
</group>
</search>
</field>
</record>

View File

@ -309,20 +309,6 @@
help="Show Sales Team"/>
</field>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<field name="stage_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
<separator orientation="vertical"/>
<field name="country_id" context="{'invisible_country': False}">
<filter icon="terp-personal+" context="{'invisible_country': False}" help="Show countries"/>
</field>
<separator orientation="vertical"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<newline/>
<field name="create_date" string="Creation Date"/>
<field name="date_closed"/>
</group>
<newline/>
<group expand="0" string="Group By..." colspan="16">
<filter string="Stage" icon="terp-stage" domain="[]"
context="{'group_by':'stage_id'}" />
@ -345,6 +331,20 @@
help="Expected Closing" domain="[]"
context="{'group_by':'date_deadline'}" />
</group>
<newline/>
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="stage_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
<field name="categ_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]"/>
<separator orientation="vertical"/>
<field name="country_id" context="{'invisible_country': False}">
<filter icon="terp-personal+" context="{'invisible_country': False}" help="Show countries"/>
</field>
<separator orientation="vertical"/>
<field name="company_id" widget="selection" groups="base.group_multi_company"/>
<newline/>
<field name="create_date" string="Creation Date"/>
<field name="date_closed"/>
</group>
</search>
</field>
</record>

View File

@ -131,7 +131,7 @@
domain="[]" context="{'group_by':'name'}" />
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="partner_id"/>
<separator orientation="vertical"/>
<field name="stage_id" widget="selection" domain="[('object_id.model', '=', 'crm.lead')]" />

View File

@ -145,7 +145,7 @@
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="partner_id"/>
<separator orientation="vertical"/>
<field name="stage_id" widget="selection" domain="[('object_id.model', '=', 'crm.phonecall')]"/>

View File

@ -55,8 +55,8 @@
I will search for one of the recurrent event and count the number of meeting.
-
!python {model: crm.meeting}: |
ids = self.search(cr, uid, [('date', '>=', '2010-05-21 00:00:00'), ('date', '<=', '2010-04-21 00:00:00')] )
assert len(ids) == 9
ids = self.search(cr, uid, [('date', '>=', '2010-04-21 00:00:00'), ('date', '<=', '2010-05-21 00:00:00')] )
assert len(ids) == 10
- |
Now If I want to edit meetings information for all occurence I click on "Edit All" button.
@ -81,11 +81,6 @@
partner_id: base.res_partner_9
user_ids:
- base.user_demo
- |
If I set Send mail boolean as True I can see that an email is send to
specified email address with proper meeting information.
-
#This is not working for send mail boolean as True.
-
I click on "Invite" button of "Invite attendee" wizard.
-

View File

@ -72,7 +72,6 @@
partner_address_id: base.res_partner_address_1
partner_id: base.res_partner_9
phonecall_id: 'crm_phonecall_interviewcall0'
rrule_type: weekly
state: open
- |

View File

@ -162,7 +162,7 @@
domain="[]" context="{'group_by':'name'}" />
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<filter icon="terp-dialog-close"
string="Done"
domain="[('state','=','done')]"/>

View File

@ -153,7 +153,7 @@
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<filter icon="terp-dialog-close"
string="Done"
domain="[('state','=','done')]"/>

View File

@ -144,7 +144,7 @@
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<filter string="Priority" icon="terp-rating-rated"
domain="[]" context="{'group_by':'priority'}" />
</group>

View File

@ -23,6 +23,9 @@
<attribute name='rowspan'>15</attribute>
<attribute name='string'></attribute>
</xpath>
<xpath expr="//button[@name='action_next']" position="attributes">
<attribute name="string">Configure</attribute>
</xpath>
<group string="res_config_contents" position="replace">
<field name="meeting"/>
<field name="opportunity"/>

View File

@ -74,7 +74,7 @@
<filter string="Year" icon="terp-go-month" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="rating"/>
<separator orientation="vertical"/>
<field name="deadline"/>

View File

@ -71,7 +71,7 @@
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12">
<group expand="0" string="Extended Filters..." colspan="10" col="12">
<field name="holiday_status_id" widget="selection"/>
<field name="department_id" widget="selection"/>
</group>

View File

@ -80,7 +80,7 @@
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12">
<group expand="0" string="Extended Filters..." colspan="10" col="12">
<field name="holiday_status_id"/>
<field name="category_id"/>
<separator orientation="vertical"/>

View File

@ -101,7 +101,7 @@
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="state"/>
<separator orientation="vertical"/>
<field name="date"/>

View File

@ -81,7 +81,7 @@
<filter string="Year" icon="terp-go-year" context="{'group_by':'name'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12">
<group expand="0" string="Extended Filters..." colspan="10" col="12">
<field name="date"/>
<separator orientation="vertical"/>
<field name="invoice_id" widget="selection"/>

View File

@ -72,7 +72,7 @@
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="general_account_id"/>
<field name="product_id"/>
<field name="journal_id"/>

View File

@ -96,7 +96,7 @@
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="general_account_id"/>
<field name="to_invoice" widget="selection"/>
<separator orientation="vertical"/>

View File

@ -60,7 +60,8 @@ class mrp_workcenter(osv.osv):
'resource_id': fields.many2one('resource.resource','Resource',ondelete='cascade'),
}
_defaults = {
'capacity_per_cycle': lambda *a: 1.0,
'capacity_per_cycle': 1.0,
'resource_type': 'material',
}
mrp_workcenter()

View File

@ -86,7 +86,7 @@
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<filter icon="terp-emblem-important" string="Picking Exception" domain="[('state','=','picking_except')]"/>
<filter icon="terp-gtk-media-pause" string="Waiting Goods" domain="[('state','=','confirmed')]"/>
<filter icon="terp-camera_test" string="Ready to Produce" domain="[('state','=','ready')]"/>

View File

@ -86,7 +86,7 @@
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="date_validation"/>
<field name="date_payment"/>
</group>

View File

@ -27,7 +27,7 @@
<filter string='Type' icon="terp-stock_symbol-selection" domain="[]" context="{'group_by' : 'type'}" />
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="pricelist_id" widget="selection" context="{'pricelist': self}" />
</group>
</search>

View File

@ -123,7 +123,7 @@
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12" groups="base.group_extended">
<group expand="0" string="Extended Filters..." colspan="10" col="12" groups="base.group_extended">
<field name="type" widget="selection"/>
<separator orientation="vertical"/>
<field name="date_start"/>

View File

@ -130,7 +130,7 @@
</group>
<newline/>
<group expand="0" string="Extended options..." colspan="10" col="12" groups="base.group_extended">
<group expand="0" string="Extended Filters..." colspan="10" col="12" groups="base.group_extended">
<field name="partner_id"/>
<field name="assigned_to" widget="selection"/>
<separator orientation="vertical"/>

View File

@ -190,6 +190,8 @@ class project_phase(osv.osv):
return super(project_phase, self).write(cr, uid, ids, vals, context=context)
# Consider calendar and efficiency if the phase is performed by a resource
# otherwise consider the project's working calendar
if isinstance(ids, (int, long)):
ids = [ids]
phase = self.browse(cr, uid, ids[0], context=context)
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)],context=context)
@ -246,7 +248,7 @@ class project_resource_allocation(osv.osv):
_rec_name = 'resource_id'
_columns = {
'resource_id': fields.many2one('resource.resource', 'Resource', required=True),
'phase_id': fields.many2one('project.phase', 'Project Phase', required=True),
'phase_id': fields.many2one('project.phase', 'Project Phase', ondelete='cascade', required=True),
'phase_id_date_start': fields.related('phase_id', 'date_start', type='date', string='Starting Date of the phase'),
'phase_id_date_end': fields.related('phase_id', 'date_end', type='date', string='Ending Date of the phase'),
'useability': fields.float('Usability', help="Usability of this resource for this project phase in percentage (=50%)"),

View File

@ -104,7 +104,7 @@
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="date"/>
<field name="date_confirm"/>
<separator orientation="vertical"/>

View File

@ -50,7 +50,7 @@
<filter string="Year" icon="terp-account" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="date" string="Date Invoiced"/>
<separator orientation="vertical"/>
<field name="partner_id" widget="selection"/>

View File

@ -103,7 +103,7 @@
<filter string="Year" icon="terp-go-year" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="location_id" widget = "selection"/>
<field name="location_dest_id" widget = "selection"/>
<separator orientation="vertical"/>
@ -201,7 +201,7 @@
<filter string="State" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="partner_id" context="{'contact_display':'partner'}"/>
<field name="prodlot_id"/>
<field name="state"/>

View File

@ -90,7 +90,7 @@
<filter string="Year" icon="terp-go-year" domain="[]" context="{'group_by':'year'}"/>
</group>
<newline/>
<group expand="0" string="Extended options..." groups="base.group_extended">
<group expand="0" string="Extended Filters..." groups="base.group_extended">
<field name="product_id"/>
<separator orientation="vertical"/>
<field name="type"/>