[FIX] sale: removed buggy and useless fields_view_get() from wizard sale_make_invoice_advance.py
bzr revid: qdp-launchpad@openerp.com-20120920131229-3bozie3no4302bk9
This commit is contained in:
parent
78a96ae65a
commit
6ab2b852d9
|
@ -18,7 +18,9 @@
|
|||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
import sale_make_invoice
|
||||
import sale_line_invoice
|
||||
import sale_make_invoice_advance
|
||||
import sale_make_invoice
|
||||
|
||||
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
|
|
@ -43,26 +43,6 @@ class sale_advance_payment_inv(osv.osv_memory):
|
|||
help="The amount to be invoiced in advance."),
|
||||
}
|
||||
|
||||
|
||||
def fields_view_get(self, cr, uid, view_id=None, view_type=False, context=None, toolbar=False, submenu=False):
|
||||
if context is None:context = {}
|
||||
user_obj = self.pool.get('res.users')
|
||||
res = super(sale_advance_payment_inv, self).fields_view_get(cr, uid, view_id=view_id, view_type=view_type, context=context, toolbar=toolbar, submenu=submenu)
|
||||
active_ids = context.get('active_ids', False)
|
||||
invoice_obj = self.pool.get('account.invoice')
|
||||
model = context.get('active_model', '')
|
||||
model_obj = self.pool.get(model)
|
||||
if context.get('active_model', '') in ['sale.order'] and context.get('active_ids', []):
|
||||
order_data = model_obj.read(cr, uid, context.get('active_ids'), ['invoice_ids'])[0]
|
||||
for inv in invoice_obj.browse(cr, uid, order_data.get('invoice_ids')):
|
||||
for line in inv.invoice_line:
|
||||
# if percentage(Advance payment) is given then remove sale order lines option..
|
||||
if str(line.name).startswith("Advance of"):
|
||||
for field in res['fields']:
|
||||
if field == 'advance_payment_method':
|
||||
res['fields'][field]['selection'] = [('all', 'Invoice all the Sale Order'), ('percentage', 'Percentage'), ('fixed', 'Fixed Price'),]
|
||||
return res
|
||||
|
||||
def _get_advance_product(self, cr, uid, context=None):
|
||||
try:
|
||||
product = self.pool.get('ir.model.data').get_object(cr, uid, 'sale', 'advance_product_0')
|
||||
|
|
Loading…
Reference in New Issue