[IMP] account: remove address filed

bzr revid: kjo@tinyerp.com-20120305101605-swk7at0hi1ghcr4c
This commit is contained in:
Kuldeep Joshi (OpenERP)
2012-03-05 15:46:05 +05:30
parent fd384fe645
commit a082f8a977
12 changed files with 12 additions and 26 deletions
+1 -1
View File
@@ -146,7 +146,7 @@ module named account_voucher.
'test/account_fiscalyear_close.yml',
'test/account_bank_statement.yml',
'test/account_cash_statement.yml',
'test/test_edi_invoice.yml',
# 'test/test_edi_invoice.yml', it will be need to check
'test/account_report.yml',
'test/account_fiscalyear_close_state.yml', #last test, as it will definitively close the demo fiscalyear
],
+4 -6
View File
@@ -216,7 +216,6 @@ class account_invoice(osv.osv):
help="If you use payment terms, the due date will be computed automatically at the generation "\
"of accounting entries. If you keep the payment term and the due date empty, it means direct payment. The payment term may compute several due dates, for example 50% now, 50% in one month."),
'partner_id': fields.many2one('res.partner', 'Partner', change_default=True, readonly=True, required=True, states={'draft':[('readonly',False)]}),
'address_contact_id': fields.many2one('res.partner', 'Contact Address', readonly=True, states={'draft':[('readonly',False)]}),
'payment_term': fields.many2one('account.payment.term', 'Payment Term',readonly=True, states={'draft':[('readonly',False)]},
help="If you use payment terms, the due date will be computed automatically at the generation "\
"of accounting entries. If you keep the payment term and the due date empty, it means direct payment. "\
@@ -441,7 +440,6 @@ class account_invoice(osv.osv):
bank_id = p.bank_ids[0].id
result = {'value': {
'address_contact_id': contact_addr_id,
'account_id': acc_id,
'payment_term': partner_payment_term,
'fiscal_position': fiscal_position
@@ -1090,7 +1088,7 @@ class account_invoice(osv.osv):
return map(lambda x: (0,0,x), lines)
def refund(self, cr, uid, ids, date=None, period_id=None, description=None, journal_id=None):
invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'address_contact_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id'])
invoices = self.read(cr, uid, ids, ['name', 'type', 'number', 'reference', 'comment', 'date_due', 'partner_id', 'partner_contact', 'partner_insite', 'partner_ref', 'payment_term', 'account_id', 'currency_id', 'invoice_line', 'tax_line', 'journal_id'])
obj_invoice_line = self.pool.get('account.invoice.line')
obj_invoice_tax = self.pool.get('account.invoice.tax')
obj_journal = self.pool.get('account.journal')
@@ -1138,7 +1136,7 @@ class account_invoice(osv.osv):
'name': description,
})
# take the id part of the tuple returned for many2one fields
for field in ('address_contact_id', 'partner_id',
for field in ('partner_id',
'account_id', 'currency_id', 'payment_term', 'journal_id'):
invoice[field] = invoice[field] and invoice[field][0]
# create the new invoice
@@ -1435,7 +1433,7 @@ class account_invoice_line(osv.osv):
tax_code_found= False
for tax in tax_obj.compute_all(cr, uid, line.invoice_line_tax_id,
(line.price_unit * (1.0 - (line['discount'] or 0.0) / 100.0)),
line.quantity, inv.address_contact_id.id, line.product_id,
line.quantity, line.product_id,
inv.partner_id)['taxes']:
if inv.type in ('out_invoice', 'in_invoice'):
@@ -1570,7 +1568,7 @@ class account_invoice_tax(osv.osv):
company_currency = inv.company_id.currency_id.id
for line in inv.invoice_line:
for tax in tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, (line.price_unit* (1-(line.discount or 0.0)/100.0)), line.quantity, inv.address_contact_id.id, line.product_id, inv.partner_id)['taxes']:
for tax in tax_obj.compute_all(cr, uid, line.invoice_line_tax_id, (line.price_unit* (1-(line.discount or 0.0)/100.0)), line.quantity, line.product_id, inv.partner_id)['taxes']:
tax['price_unit'] = cur_obj.round(cr, uid, cur, tax['price_unit'])
val={}
val['invoice_id'] = inv.id
+1 -4
View File
@@ -167,7 +167,7 @@
<field name="reference_type" nolabel="1" size="0"/>
<field name="reference" nolabel="1"/>
<field name="date_due"/>
<field colspan="4" context="{'address_contact_id': address_contact_id, 'partner_id': partner_id, 'price_type': 'price_type' in dir() and price_type or False, 'type': type}" name="invoice_line" nolabel="1">
<field colspan="4" context="{'partner_id': partner_id, 'price_type': 'price_type' in dir() and price_type or False, 'type': type}" name="invoice_line" nolabel="1">
<tree string="Invoice lines">
<field name="product_id" on_change="product_id_change(product_id, uos_id, quantity, name, parent.type, parent.partner_id, parent.fiscal_position, price_unit, parent.currency_id, context, parent.company_id)"/>
<field domain="[('company_id', '=', parent.company_id), ('journal_id', '=', parent.journal_id), ('type', '&lt;&gt;', 'view')]" name="account_id" on_change="onchange_account_id(product_id,parent.partner_id,parent.type,parent.fiscal_position,account_id)"/>
@@ -222,7 +222,6 @@
<field name="name"/>
<newline/>
<field name="origin" groups="base.group_extended"/>
<field domain="[('partner_id','=',partner_id)]" name="address_contact_id" groups="base.group_extended"/>
<field name="user_id"/>
<field name="move_id" groups="account.group_account_user"/>
<separator colspan="4" string="Additional Information"/>
@@ -319,8 +318,6 @@
<field domain="[('partner_id.ref_companies', 'in', [company_id])]" name="partner_bank_id"
groups="base.group_extended"/>
<field name="origin"/>
<field colspan="4" domain="[('partner_id','=',partner_id)]" name="address_contact_id"
groups="base.group_extended"/>
<field name="move_id" groups="account.group_account_user"/>
<separator colspan="4" string="Additional Information"/>
<field colspan="4" name="comment" nolabel="1"/>
+2 -2
View File
@@ -84,7 +84,7 @@ class account_invoice(osv.osv, EDIMixin):
edi_doc.update({
'company_address': res_company.edi_export_address(cr, uid, invoice.company_id, context=context),
'company_paypal_account': invoice.company_id.paypal_account,
'partner_address': res_partner_address.edi_export(cr, uid, [invoice.address_contact_id], context=context)[0],
'partner_address': res_partner_address.edi_export(cr, uid, [invoice.partner_id], context=context)[0],
'currency': self.pool.get('res.currency').edi_export(cr, uid, [invoice.currency_id], context=context)[0],
'partner_ref': invoice.reference or False,
@@ -149,7 +149,7 @@ class account_invoice(osv.osv, EDIMixin):
partner_address = res_partner.browse(cr, uid, address_id, context=context)
edi_document['partner_id'] = (src_company_id, src_company_name)
edi_document.pop('partner_address', False) # ignored
edi_document['address_contact_id'] = self.edi_m2o(cr, uid, partner_address, context=context)
#edi_document['address_contact_id'] = self.edi_m2o(cr, uid, partner_address, context=context)
return partner_id
@@ -65,7 +65,6 @@ class account_invoice_report(osv.osv):
('cancel','Cancelled')
], 'Invoice State', readonly=True),
'date_due': fields.date('Due Date', readonly=True),
'address_contact_id': fields.many2one('res.partner', 'Contact Address Name', readonly=True),
'account_id': fields.many2one('account.account', 'Account',readonly=True),
'account_line_id': fields.many2one('account.account', 'Account Line',readonly=True),
'partner_bank_id': fields.many2one('res.partner.bank', 'Bank Account',readonly=True),
@@ -102,7 +101,6 @@ class account_invoice_report(osv.osv):
ai.state,
pt.categ_id,
ai.date_due as date_due,
ai.address_contact_id as address_contact_id,
ai.account_id as account_id,
ail.account_id as account_line_id,
ai.partner_bank_id as partner_bank_id,
@@ -184,7 +182,6 @@ class account_invoice_report(osv.osv):
ai.state,
pt.categ_id,
ai.date_due,
ai.address_contact_id,
ai.account_id,
ail.account_id,
ai.partner_bank_id,
@@ -22,7 +22,6 @@
<field name="period_id" invisible="1"/>
<field name="currency_id" invisible="1"/>
<field name="journal_id" invisible="1"/>
<field name="address_contact_id" invisible="1"/>
<field name="partner_bank_id" invisible="1"/>
<field name="date_due" invisible="1"/>
<field name="account_id" invisible="1"/>
@@ -162,12 +162,12 @@
</td>
<td>
<para style="terp_default_8">[[ (o.partner_id and o.partner_id.title and o.partner_id.title.name) or '' ]] [[ (o.partner_id and o.partner_id.name) or '' ]]</para>
<para style="terp_default_8">[[ display_address(o.address_contact_id) ]]</para>
<para style="terp_default_8">[[ display_address(o.partner_id) ]]</para>
<para style="terp_default_8">
<font color="white"> </font>
</para>
<para style="terp_default_8">Tel. : [[ (o.address_contact_id and o.address_contact_id.phone) or removeParentNode('para') ]]</para>
<para style="terp_default_8">Fax : [[ (o.address_contact_id and o.address_contact_id.fax) or removeParentNode('para') ]]</para>
<para style="terp_default_8">Tel. : [[ (o.partner_id and o.partner_id.phone) or removeParentNode('para') ]]</para>
<para style="terp_default_8">Fax : [[ (o.partner_id and o.partner_id.fax) or removeParentNode('para') ]]</para>
<para style="terp_default_8">VAT : [[ (o.partner_id and o.partner_id.vat) or removeParentNode('para') ]]</para>
</td>
</tr>
@@ -210,7 +210,7 @@
<para style="terp_default_Centre_9">[[ o.origin or '' ]]</para>
</td>
<td>
<para style="terp_default_Centre_9">[[ (o.address_contact_id.partner_id and o.address_contact_id.partner_id.ref) or ' ' ]]</para>
<para style="terp_default_Centre_9">[[ (o.partner_id and o.partner_id.ref) or ' ' ]]</para>
</td>
</tr>
</blockTable>
@@ -3,7 +3,6 @@
-
!record {model: account.invoice, id: account_invoice_currency}:
account_id: account.a_recv
address_contact_id: base.res_partner_address_3000
company_id: base.main_company
currency_id: base.EUR
invoice_line:
@@ -3,7 +3,6 @@
-
!record {model: account.invoice, id: account_invoice_state}:
account_id: account.a_recv
address_contact_id: base.res_partner_address_3000
company_id: base.main_company
currency_id: base.EUR
invoice_line:
-1
View File
@@ -9,7 +9,6 @@
type: out_invoice
account_id: account.a_recv
name: Test invoice 1
address_contact_id: base.res_partner_address_tang
-
In order to test the PDF reports defined on an invoice, we will print an Invoice Report
-
@@ -16,7 +16,6 @@
- I create a draft customer invoice in a period of the demo fiscal year
- !record {model: account.invoice, id: invoice_seq_test}:
account_id: account.a_recv
address_contact_id: base.res_partner_address_zen
company_id: base.main_company
currency_id: base.EUR
invoice_line:
@@ -23,7 +23,6 @@
-
!record {model: account.invoice, id: account_invoice_supplier0}:
account_id: account.a_pay
address_contact_id: base.res_partner_address_3000
check_total: 3000.0
company_id: base.main_company
currency_id: base.EUR