openerp-dev-web team mailing list archive
-
openerp-dev-web team
-
Mailing list archive
-
Message #00699
[Merge] lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-psi into lp:~openerp-dev/openobject-addons/trunk-dev-addons3
psi (OpenERP) has proposed merging lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-psi into lp:~openerp-dev/openobject-addons/trunk-dev-addons3.
Requested reviews:
OpenERP R&D Team (openerp-dev)
Related bugs:
#662538 account - account_move_lines for payables and receivables must have partner_id - missing check
https://bugs.launchpad.net/bugs/662538
#665326 Multi_company : Journal entry missing for company OpenERP IN.
https://bugs.launchpad.net/bugs/665326
#667619 Export po file from OpenERP, Accounting reports does not translated.
https://bugs.launchpad.net/bugs/667619
account voucher:
add required writoff fields direct on account_voucher object.
Improve view of customer and vendor payment.
change in action_move_line_create method so it can take care of writeoff entries.
remaining : Writeoff entries are not reflecting in journal entries of respecting vouchers
--
https://code.launchpad.net/~openerp-commiter/openobject-addons/trunk-dev-addons3-psi/+merge/41687
Your team OpenERP R&D Team is requested to review the proposed merge of lp:~openerp-commiter/openobject-addons/trunk-dev-addons3-psi into lp:~openerp-dev/openobject-addons/trunk-dev-addons3.
=== modified file 'account_voucher/account_voucher.py'
--- account_voucher/account_voucher.py 2010-11-22 12:13:58 +0000
+++ account_voucher/account_voucher.py 2010-11-24 07:06:35 +0000
@@ -26,6 +26,7 @@
from osv import fields
from osv import osv
from tools.translate import _
+import decimal_precision as dp
class account_move_line(osv.osv):
_inherit = 'account.move.line'
@@ -190,6 +191,14 @@
'tax_id':fields.many2one('account.tax', 'Tax', readonly=True, states={'draft':[('readonly',False)]}),
'pre_line':fields.boolean('Previous Payments ?', required=False),
'date_due': fields.date('Due Date', readonly=True, states={'draft':[('readonly',False)]}),
+ 'payment_option':fields.selection([
+ ('not_reconcile', 'Without Write-off'),
+ ('close_balance', 'With Write-off'),
+ ], 'Payment Option', required=True, readonly=True, states={'draft': [('readonly', False)]}),
+ 'writeoff_acc_id': fields.many2one('account.account', 'Write-Off account', readonly=True, states={'draft': [('readonly', False)]}),
+ 'writeoff_journal_id': fields.many2one('account.journal', 'Write-Off journal', readonly=True, states={'draft': [('readonly', False)]}),
+ 'comment': fields.char('Comment', size=64, readonly=True, states={'draft': [('readonly', False)]}),
+ 'analytic_id': fields.many2one('account.analytic.account','Analytic Account', readonly=True, states={'draft': [('readonly', False)]}),
}
_defaults = {
'period_id': _get_period,
@@ -205,6 +214,8 @@
'date': lambda *a: time.strftime('%Y-%m-%d'),
'company_id': lambda self,cr,uid,c: self.pool.get('res.company')._company_default_get(cr, uid, 'account.voucher',context=c),
'tax_id': _get_tax,
+ 'payment_option': 'not_reconcile',
+ 'comment': 'Write-Off',
}
def compute_tax(self, cr, uid, ids, context={}):
@@ -694,6 +705,10 @@
if line.move_line_id.id:
rec_ids = [master_line, line.move_line_id.id]
rec_list_ids.append(rec_ids)
+ writeoff_account_id = False
+ writeoff_journal_id = False
+ writeoff_period_id = inv.period_id.id,
+ comment = False
if not currency_pool.is_zero(cr, uid, inv.currency_id, line_total):
diff = line_total
@@ -717,6 +732,15 @@
move_line['account_id'] = account_id
move_line_pool.create(cr, uid, move_line)
+ for rec_ids in rec_list_ids:
+ if len(rec_ids) >= 2:
+ if inv.payment_option == 'close_balance':
+ writeoff_account_id = inv.writeoff_acc_id.id
+ writeoff_journal_id = inv.writeoff_journal_id.id
+ comment = inv.comment
+ self.pool.get('account.move.line').reconcile(cr, uid, rec_ids, 'manual', writeoff_account_id, writeoff_period_id, writeoff_journal_id, context)
+ else:
+ move_line_pool.reconcile_partial(cr, uid, rec_ids)
self.write(cr, uid, [inv.id], {
'move_id': move_id,
@@ -724,9 +748,6 @@
'number': name,
})
move_pool.post(cr, uid, [move_id], context={})
- for rec_ids in rec_list_ids:
- if len(rec_ids) >= 2:
- move_line_pool.reconcile_partial(cr, uid, rec_ids)
return True
def copy(self, cr, uid, id, default={}, context=None):
=== modified file 'account_voucher/voucher_payment_receipt_view.xml'
--- account_voucher/voucher_payment_receipt_view.xml 2010-11-19 13:56:06 +0000
+++ account_voucher/voucher_payment_receipt_view.xml 2010-11-24 07:06:35 +0000
@@ -196,10 +196,27 @@
<field name="narration" colspan="2" nolabel="1"/>
</group>
<group col="2" colspan="1">
+ <group col="2" colspan="1">
+ <separator string="Payment Options" colspan="2"/>
+ <field name="payment_option" required="1"/>
+ <field name="writeoff_acc_id"
+ attrs="{'invisible':[('payment_option','!=','close_balance')], 'required':[('payment_option','=','close_balance')]}"
+ domain="[('type','=','liquidity')]"/>
+ <!-- should select income accounts only. Or use the journal for this ? -->
+ <field name="writeoff_journal_id"
+ attrs="{'invisible':[('payment_option','!=','close_balance')], 'required':[('payment_option','=','close_balance')]}"/>
+ <field name="comment"
+ attrs="{'invisible':[('payment_option','!=','close_balance')]}"/>
+ <field name="analytic_id"
+ attrs="{'invisible':[('payment_option','!=','close_balance')]}"
+ groups="analytic.group_analytic_accounting"/>
+ </group>
<separator string="Other Information" colspan="2"/>
- <field name="date" select="1" on_change="onchange_date(date)"/>
- <field name="currency_id" invisible="True"/>
- <field name="number"/>
+ <group col="4" colspan="1">
+ <field name="date" select="1" on_change="onchange_date(date)"/>
+ <field name="currency_id" invisible="True"/>
+ <field name="number"/>
+ </group>
</group>
</page>
<page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">
@@ -304,10 +321,27 @@
<field name="narration" colspan="2" nolabel="1"/>
</group>
<group col="2" colspan="1">
+ <group col="2" colspan="1">
+ <separator string="Payment Options" colspan="2"/>
+ <field name="payment_option" required="1"/>
+ <field name="writeoff_acc_id"
+ attrs="{'invisible':[('payment_option','!=','close_balance')], 'required':[('payment_option','=','close_balance')]}"
+ domain="[('type','=','liquidity')]"/>
+ <!-- should select income accounts only. Or use the journal for this ? -->
+ <field name="writeoff_journal_id"
+ attrs="{'invisible':[('payment_option','!=','close_balance')], 'required':[('payment_option','=','close_balance')]}"/>
+ <field name="comment"
+ attrs="{'invisible':[('payment_option','!=','close_balance')]}"/>
+ <field name="analytic_id"
+ attrs="{'invisible':[('payment_option','!=','close_balance')]}"
+ groups="analytic.group_analytic_accounting"/>
+ </group>
<separator string="Other Information" colspan="2"/>
- <field name="date" select="1" on_change="onchange_date(date)"/>
- <field name="currency_id" invisible="True"/>
- <field name="number"/>
+ <group col="4" colspan="1">
+ <field name="date" select="1" on_change="onchange_date(date)"/>
+ <field name="currency_id" invisible="True"/>
+ <field name="number"/>
+ </group>
</group>
</page>
<page string="Journal Items" groups="base.group_extended" attrs="{'invisible': [('state','!=','posted')]}">