Hardik Ansodariya (OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/6.0-opw-381990-han into
lp:openobject-addons/6.0.
Requested reviews:
Naresh(OpenERP) (nch-openerp)
nel (nel-tinyerp)
Rifakat (OpenERP) (rha-openerp)
Hardik Ansodariya (OpenERP) (han-tinyerp)
Vinay Rana (openerp) (vra-openerp)
Related bugs:
Bug #924009 in OpenERP Addons: "Problem with side effect of automatic
chaining moves"
https://bugs.launchpad.net/openobject-addons/+bug/924009
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-381990-han/+merge/91269
Hello,
Fixed the issue Problem with side effect of automatic chaining moves
Thanks
Hardik
--
https://code.launchpad.net/~openerp-dev/openobject-addons/6.0-opw-381990-han/+merge/91269
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/6.0-opw-381990-han.
=== modified file 'account/report/account_tax_report.py'
--- account/report/account_tax_report.py 2011-01-14 00:11:01 +0000
+++ account/report/account_tax_report.py 2012-02-02 13:33:23 +0000
@@ -60,6 +60,16 @@
'get_basedon': self._get_basedon,
})
+ def _get_account(self, data):
+ if data['model']=='account.tax.code':
+ return self.pool.get('account.tax.code').browse(self.cr, self.uid, data['form']['chart_tax_id']).company_id.name
+ return super(tax_report ,self)._get_account(data)
+
+ '''def _get_fiscalyear(self, data):
+ if data['model'] == 'account.journal.period':
+ return self.pool.get('account.journal.period').browse(self.cr, self.uid, data['id']).fiscalyear_id.name
+ return super(journal_print,self)._get_fiscalyear(data)'''
+
def _get_basedon(self, form):
return form['form']['based_on']
@@ -229,4 +239,4 @@
report_sxw.report_sxw('report.account.vat.declaration', 'account.tax.code',
'addons/account/report/account_tax_report.rml', parser=tax_report, header="internal")
-# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'account/wizard/account_report_common.py'
--- account/wizard/account_report_common.py 2011-01-14 00:11:01 +0000
+++ account/wizard/account_report_common.py 2012-02-02 13:33:23 +0000
@@ -31,7 +31,7 @@
_columns = {
'chart_account_id': fields.many2one('account.account', 'Chart of account', help='Select Charts of Accounts', required=True, domain = [('parent_id','=',False)]),
- 'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal year', help='Keep empty for all open fiscal year'),
+ 'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal year123', help='Keep empty for all open fiscal year'),
'filter': fields.selection([('filter_no', 'No Filters'), ('filter_date', 'Date'), ('filter_period', 'Periods')], "Filter by", required=True),
'period_from': fields.many2one('account.period', 'Start period'),
'period_to': fields.many2one('account.period', 'End period'),
@@ -92,6 +92,7 @@
def _get_fiscalyear(self, cr, uid, context=None):
now = time.strftime('%Y-%m-%d')
fiscalyears = self.pool.get('account.fiscalyear').search(cr, uid, [('date_start', '<', now), ('date_stop', '>', now)], limit=1 )
+ print '------------',fiscalyears
return fiscalyears and fiscalyears[0] or False
def _get_all_journal(self, cr, uid, context=None):
=== modified file 'account/wizard/account_vat.py'
--- account/wizard/account_vat.py 2011-01-14 00:11:01 +0000
+++ account/wizard/account_vat.py 2012-02-02 13:33:23 +0000
@@ -29,18 +29,29 @@
'based_on': fields.selection([('invoices', 'Invoices'),
('payments', 'Payments'),],
'Based On', required=True),
- 'chart_tax_id': fields.many2one('account.tax.code', 'Chart of Tax', help='Select Charts of Taxes', required=True, domain = [('parent_id','=', False)]),
+ 'chart_tax_id': fields.many2one('account.tax.code', 'Chart of Tax123', help='Select Charts of Taxes', required=True, domain = [('parent_id','=', False)]),
+ 'fiscalyear_id': fields.many2one('account.fiscalyear', 'Fiscal year345', help='Keep empty for all open fiscal year'),
}
def _get_tax(self, cr, uid, context=None):
taxes = self.pool.get('account.tax.code').search(cr, uid, [('parent_id', '=', False)], limit=1)
return taxes and taxes[0] or False
-
+
_defaults = {
'based_on': 'invoices',
- 'chart_tax_id': _get_tax
+ 'chart_tax_id': _get_tax,
}
+ def onchange_fiscal(self, cr, uid, ids, fiscalyear_id,chart_tax_id):
+ fiscal = self.pool.get('account.fiscalyear')
+
+ if fiscalyear_id:
+ comp_id = fiscal.browse(cr, uid, [fiscalyear_id])[0]
+ print 'comp',comp_id.company_id.name
+ return {'value': {'chart_tax_id': comp_id.company_id.id}}
+ return {}
+
+
def create_vat(self, cr, uid, ids, context=None):
if context is None:
context = {}
@@ -56,4 +67,4 @@
account_vat_declaration()
-#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
\ No newline at end of file
+#vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
=== modified file 'account/wizard/account_vat_view.xml'
--- account/wizard/account_vat_view.xml 2011-08-18 16:49:07 +0000
+++ account/wizard/account_vat_view.xml 2012-02-02 13:33:23 +0000
@@ -12,7 +12,7 @@
<label colspan="4" nolabel="1" string="This menu prints a VAT declaration based on invoices. Select one or several periods of the fiscal year. The information required for a tax declaration is automatically generated by OpenERP from invoices (or payments, in some countries). This data is updated in real time. That’s very useful because it enables you to preview at any time the tax that you owe at the start and end of the month or quarter."/>
<newline/>
<field name="chart_tax_id" widget='selection'/>
- <field name="fiscalyear_id"/>
+ <field name="fiscalyear_id" on_change="onchange_fiscal(fiscalyear_id,chart_tax_id)"/>
<!-- It seems that we don't really support the option based on payment. So it's better to hide this choice for now -->
<!--<field name="based_on"/>-->
<separator string="Periods" colspan="4"/>
=== modified file 'stock/wizard/stock_return_picking.py'
--- stock/wizard/stock_return_picking.py 2011-01-18 13:41:41 +0000
+++ stock/wizard/stock_return_picking.py 2012-02-02 13:33:23 +0000
@@ -24,6 +24,7 @@
from osv import osv,fields
from tools.translate import _
+from itertools import chain
class stock_return_picking(osv.osv_memory):
_name = 'stock.return.picking'
@@ -147,6 +148,7 @@
record_id = context and context.get('active_id', False) or False
move_obj = self.pool.get('stock.move')
pick_obj = self.pool.get('stock.picking')
+ location_obj = self.pool.get('stock.location')
uom_obj = self.pool.get('product.uom')
wf_service = netsvc.LocalService("workflow")
@@ -169,6 +171,18 @@
'move_lines':[], 'state':'draft', 'type':new_type,
'date':date_cur, 'invoice_state':data['invoice_state'],})
new_location=move.location_dest_id.id
+
+ if move.location_dest_id.chained_auto_packing == "auto":
+ chained_id = location_obj.search(cr, uid, [('chained_location_type', '=', 'fixed')])
+ chained_location = location_obj.browse(cr, uid, chained_id, context=context)
+ location = chain(chained_location)
+ while True:
+ try:
+ last_location = location.next()
+ except StopIteration:
+ new_location=last_location.chained_location_id.id
+ break
+
if move.state=='done':
new_qty = data['return%s' % move.id]
returned_qty = move.product_qty
@@ -215,6 +229,7 @@
'type':'ir.actions.act_window',
'context':context,
}
+
stock_return_picking()
_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help : https://help.launchpad.net/ListHelp