Divyesh Makwana(OpenERP) has proposed merging
lp:~openerp-dev/openobject-addons/trunk-addons_16_sales-mdi into
lp:openobject-addons.
Requested reviews:
OpenERP Core Team (openerp)
For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-addons_16_sales-mdi/+merge/129622
Hello,
I have improved the following things:
1. Traceback when paying invoice by percentage in SO, after installing
sale_stock.
2. In product kanban view, rename 'Available' to 'Future Quantity' to be
coherent with the tree and form view.
3. Added a tooltip for 'date_deadline'.
Thanks,
Divyesh
--
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-addons_16_sales-mdi/+merge/129622
Your team OpenERP R&D Team is subscribed to branch
lp:~openerp-dev/openobject-addons/trunk-addons_16_sales-mdi.
=== modified file 'account/report/account_print_overdue.rml'
--- account/report/account_print_overdue.rml 2012-10-11 09:40:02 +0000
+++ account/report/account_print_overdue.rml 2012-10-15 09:06:28 +0000
@@ -277,7 +277,7 @@
<font color="white"> </font>
</para>
<section>
- <para style="terp_default_Bold_9">[[ getLines(o) and removeParentNode('section')]]There is nothing due with this customer</para>
+ <para style="terp_default_Bold_9">[[ getLines(o) and removeParentNode('section')]]There is nothing due with this customer.</para>
</section>
<para style="terp_default_9">
<font color="white"> </font>
=== modified file 'crm/crm_lead.py'
--- crm/crm_lead.py 2012-10-10 11:32:27 +0000
+++ crm/crm_lead.py 2012-10-15 09:06:28 +0000
@@ -236,7 +236,7 @@
'ref': fields.reference('Reference', selection=crm._links_get, size=128),
'ref2': fields.reference('Reference 2', selection=crm._links_get, size=128),
'phone': fields.char("Phone", size=64),
- 'date_deadline': fields.date('Expected Closing'),
+ 'date_deadline': fields.date('Expected Closing', help="Estimate of the date on which the opportunity will be completed."),
'date_action': fields.date('Next Action Date', select=True),
'title_action': fields.char('Next Action', size=64),
'color': fields.integer('Color Index'),
=== modified file 'sale_stock/sale_stock.py'
--- sale_stock/sale_stock.py 2012-10-05 09:15:16 +0000
+++ sale_stock/sale_stock.py 2012-10-15 09:06:28 +0000
@@ -635,34 +635,64 @@
class sale_advance_payment_inv(osv.osv_memory):
_inherit = "sale.advance.payment.inv"
- def _create_invoices(self, cr, uid, inv_values, sale_id, context=None):
- result = super(sale_advance_payment_inv, self)._create_invoices(cr, uid, inv_values, sale_id, context=context)
+ def create_invoices(self, cr, uid, ids, context=None):
+ """ create invoices for the active sale orders """
sale_obj = self.pool.get('sale.order')
- sale_line_obj = self.pool.get('sale.order.line')
+ act_window = self.pool.get('ir.actions.act_window')
wizard = self.browse(cr, uid, ids[0], context)
- sale = sale_obj.browse(cr, uid, sale_id, context=context)
- if sale.order_policy == 'postpaid':
- raise osv.except_osv(
- _('Error!'),
- _("You cannot make an advance on a sales order \
- that is defined as 'Automatic Invoice after delivery'."))
+ sale_ids = context.get('active_ids', [])
+ if wizard.advance_payment_method == 'all':
+ # create the final invoices of the active sale orders
+ res = sale_obj.manual_invoice(cr, uid, sale_ids, context)
+ if context.get('open_invoices', False):
+ return res
+ return {'type': 'ir.actions.act_window_close'}
- # If invoice on picking: add the cost on the SO
- # If not, the advance will be deduced when generating the final invoice
- line_name = inv_values.get('invoice_line') and inv_values.get('invoice_line')[2].get('name') or ''
- line_tax = inv_values.get('invoice_line') and inv_values.get('invoice_line')[2].get('invoice_line_tax_id') or False
- if sale.order_policy == 'picking':
- vals = {
- 'order_id': sale.id,
- 'name': line_name,
- 'price_unit': -inv_amount,
- 'product_uom_qty': wizard.qtty or 1.0,
- 'product_uos_qty': wizard.qtty or 1.0,
- 'product_uos': res.get('uos_id', False),
- 'product_uom': res.get('uom_id', False),
- 'product_id': wizard.product_id.id or False,
- 'discount': False,
- 'tax_id': line_tax,
+ if wizard.advance_payment_method == 'lines':
+ # open the list view of sale order lines to invoice
+ res = act_window.for_xml_id(cr, uid, 'sale', 'action_order_line_tree2', context)
+ res['context'] = {
+ 'search_default_uninvoiced': 1,
+ 'search_default_order_id': sale_ids and sale_ids[0] or False,
}
- sale_line_obj.create(cr, uid, vals, context=context)
- return result
+ return res
+ assert wizard.advance_payment_method in ('fixed', 'percentage')
+
+ inv_ids = []
+ for sale_id, inv_values in self._prepare_advance_invoice_vals(cr, uid, ids, context=context):
+
+ sale_obj = self.pool.get('sale.order')
+ sale_line_obj = self.pool.get('sale.order.line')
+ sale = sale_obj.browse(cr, uid, sale_id, context=context)
+ if sale.order_policy == 'postpaid':
+ raise osv.except_osv(
+ _('Error!'),
+ _("You cannot make an advance on a sales order \
+ that is defined as 'Automatic Invoice after delivery'."))
+
+ # If invoice on picking: add the cost on the SO
+ # If not, the advance will be deduced when generating the final invoice
+ line_name = inv_values.get('invoice_line') and inv_values.get('invoice_line')[0][2].get('name') or ''
+ line_tax = inv_values.get('invoice_line') and inv_values.get('invoice_line')[0][2].get('invoice_line_tax_id') or False
+ if sale.order_policy == 'picking':
+ vals = {
+ 'order_id': sale.id,
+ 'name': line_name,
+ 'price_unit': -inv_amount,
+ 'product_uom_qty': wizard.qtty or 1.0,
+ 'product_uos_qty': wizard.qtty or 1.0,
+ 'product_uos': res.get('uos_id', False),
+ 'product_uom': res.get('uom_id', False),
+ 'product_id': wizard.product_id.id or False,
+ 'discount': False,
+ 'tax_id': line_tax,
+ }
+ sale_line_obj.create(cr, uid, vals, context=context)
+
+ inv_ids.append(self._create_invoices(cr, uid, inv_values, sale_id, context=context))
+
+ if context.get('open_invoices', False):
+ return self.open_invoices( cr, uid, ids, inv_ids, context=context)
+ return {'type': 'ir.actions.act_window_close'}
+ res = super(sale_advance_payment_inv, self).create_invoices(self, cr, uid, ids, context=context)
+ return res
\ No newline at end of file
=== modified file 'stock/product_view.xml'
--- stock/product_view.xml 2012-10-13 11:22:53 +0000
+++ stock/product_view.xml 2012-10-15 09:06:28 +0000
@@ -219,7 +219,7 @@
</xpath>
<ul position="inside">
<li t-if="record.type.raw_value != 'service'">On hand: <field name="qty_available"/> <field name="uom_id"/></li>
- <li t-if="record.type.raw_value != 'service'">Available: <field name="virtual_available"/> <field name="uom_id"/></li>
+ <li t-if="record.type.raw_value != 'service'">Future Quantity: <field name="virtual_available"/> <field name="uom_id"/></li>
</ul>
</field>
</record>
_______________________________________________
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