openerp-dev-web team mailing list archive
-
openerp-dev-web team
-
Mailing list archive
-
Message #00607
[Merge] lp:~openerp-dev/openobject-addons/ron-dev-addons2 into lp:~openerp-dev/openobject-addons/trunk-dev-addons2
ron(openerp) has proposed merging lp:~openerp-dev/openobject-addons/ron-dev-addons2 into lp:~openerp-dev/openobject-addons/trunk-dev-addons2.
Requested reviews:
OpenERP R&D Team (openerp-dev)
Related bugs:
#606325 EAN code validation fails
https://bugs.launchpad.net/bugs/606325
#663890 Creating invoices and grouping multiplies services
https://bugs.launchpad.net/bugs/663890
#666362 [6.0RC1] sale Invoice Control "Not from Picking" is bad wording
https://bugs.launchpad.net/bugs/666362
#667246 Wrong Journals when creating an invoice from picking
https://bugs.launchpad.net/bugs/667246
#667324 invoicing control in purchase orders
https://bugs.launchpad.net/bugs/667324
#669210 [trunk][mrp] stock_move.action_consume raises exception
https://bugs.launchpad.net/bugs/669210
#670056 [6.0RC1] stock moves - missing search field "Reference"
https://bugs.launchpad.net/bugs/670056
#670652 Demo data of purchase order is not relevant in terms of supplier address
https://bugs.launchpad.net/bugs/670652
#670921 Purchase module : problems in group by in seach view
https://bugs.launchpad.net/bugs/670921
#671386 PO Line description doesn't take Supplier Product Name or Code in Product's Suppliers Tab
https://bugs.launchpad.net/bugs/671386
https://bugs.launchpad.net/openobject-addons/+bug/674578
https://bugs.launchpad.net/openobject-addons/+bug/606325
https://bugs.launchpad.net/openobject-addons/+bug/670921
>>purchase: Improvment in code product supplier code name display in purchase line
--
https://code.launchpad.net/~openerp-dev/openobject-addons/ron-dev-addons2/+merge/41451
Your team OpenERP R&D Team is requested to review the proposed merge of lp:~openerp-dev/openobject-addons/ron-dev-addons2 into lp:~openerp-dev/openobject-addons/trunk-dev-addons2.
=== modified file 'delivery/delivery_report.xml'
--- delivery/delivery_report.xml 2010-07-12 08:06:45 +0000
+++ delivery/delivery_report.xml 2010-11-22 12:42:23 +0000
@@ -6,7 +6,8 @@
id="report_shipping"
model="stock.picking"
name="sale.shipping"
- rml="delivery/report/shipping.rml"
+ multi="True"
+ rml="delivery/report/shipping.rml"
string="Delivery order"/>
</data>
=== modified file 'delivery/delivery_view.xml'
--- delivery/delivery_view.xml 2010-11-03 10:28:20 +0000
+++ delivery/delivery_view.xml 2010-11-22 12:42:23 +0000
@@ -4,6 +4,9 @@
<!-- Delivery Carriers -->
<menuitem id="menu_delivery" name="Delivery" parent="stock.menu_stock_configuration" sequence="4"/>
+
+
+
<record id="view_delivery_carrier_tree" model="ir.ui.view">
<field name="name">delivery.carrier.tree</field>
<field name="model">delivery.carrier</field>
@@ -266,10 +269,24 @@
<field name="inherit_id" ref="sale.view_order_form"/>
<field name="arch" type="xml">
<xpath expr="/form/notebook/page[@string='Sales Order']/group[1]/button[@name='button_dummy']" position="after">
- <button name="%(action_delivery_cost)d" states="draft" string="Delivery Costs" type="action" icon="gtk-add" context="{'order_id':active_id}"/>
+ <button name="%(action_delivery_cost)d" states="draft" string="Delivery Costs" type="action" icon="gtk-add" context="{'order_id':active_id}"/>
</xpath>
</field>
</record>
+ <record id="view_delivary_order_inherit_stock" model="ir.ui.view">
+ <field name="name">stock.picking.out.form</field>
+ <field name="type">form</field>
+ <field name="model">stock.picking</field>
+ <field name="inherit_id" ref="stock.view_picking_out_form"/>
+ <field name="arch" type="xml">
+ <xpath expr="/form/notebook/page[@string='Products']/group/button[@name='action_process']" position="after">
+ <button name="%(stock.act_stock_return_picking)d" string="Return Products" states="done" type="action" icon="gtk-execute"/>
+ <button name="%(report_shipping)d" string="Delivery Order" states="done,assigned" type="action" icon="gtk-print"/>
+ </xpath>
+ </field>
+ </record>
+
+
</data>
</openerp>
=== modified file 'product/product.py'
--- product/product.py 2010-11-18 08:42:54 +0000
+++ product/product.py 2010-11-22 12:42:23 +0000
@@ -30,6 +30,34 @@
def is_pair(x):
return not x%2
+def check_ean(eancode):
+ if not eancode:
+ return True
+ if len(eancode) not in [13,14,8]:
+ return False
+ try:
+ int(eancode)
+ except:
+ return False
+ oddsum=0
+ evensum=0
+ total=0
+ eanvalue=eancode
+ reversevalue = eanvalue[::-1]
+ finalean=reversevalue[1:]
+
+ for i in range(len(finalean)):
+ if is_pair(i):
+ oddsum += int(finalean[i])
+ else:
+ evensum += int(finalean[i])
+ total=(oddsum * 3) + evensum
+
+ check = int(10 - math.ceil(total % 10.0))
+
+ if check != int(eancode[-1]):
+ return False
+ return True
#----------------------------------------------------------
# UOM
#----------------------------------------------------------
@@ -435,7 +463,7 @@
'active': fields.boolean('Active', help="If the active field is set to true, it will allow you to hide the product without removing it."),
'variants': fields.char('Variants', size=64),
'product_tmpl_id': fields.many2one('product.template', 'Product Template', required=True, ondelete="cascade"),
- 'ean13': fields.char('EAN13', size=13),
+ 'ean13': fields.char('EAN13', size=14),
'packaging' : fields.one2many('product.packaging', 'product_id', 'Logistical Units', help="Gives the different ways to package the same product. This has no impact on the picking order and is mainly used if you use the EDI module."),
'price_extra': fields.float('Variant Price Extra', digits_compute=dp.get_precision('Sale Price')),
'price_margin': fields.float('Variant Price Margin', digits_compute=dp.get_precision('Sale Price')),
@@ -453,24 +481,9 @@
def _check_ean_key(self, cr, uid, ids):
for partner in self.browse(cr, uid, ids):
- if not partner.ean13:
- continue
- if len(partner.ean13) <> 13:
- return False
- try:
- int(partner.ean13)
- except:
- return False
- sum=0
- for i in range(12):
- if is_pair(i):
- sum += int(partner.ean13[i])
- else:
- sum += 3 * int(partner.ean13[i])
- check = int(math.ceil(sum / 10.0) * 10 - sum)
- if check != int(partner.ean13[12]):
- return False
- return True
+ eancheck = partner.ean13
+ res = check_ean( eancheck )
+ return res
_constraints = [(_check_ean_key, 'Error: Invalid ean code', ['ean13'])]
@@ -600,6 +613,15 @@
}
+ def _check_ean_key_r(self, cr, uid, ids):
+ for partner in self.browse(cr, uid, ids):
+ eancheckp = partner.ean
+ res = check_ean(eancheckp)
+ return res
+
+ _constraints = [(_check_ean_key_r, 'Error: Invalid ean code', ['ean'])]
+
+
def name_get(self, cr, uid, ids, context={}):
if not len(ids):
return []
=== modified file 'purchase/purchase.py'
--- purchase/purchase.py 2010-11-18 08:42:54 +0000
+++ purchase/purchase.py 2010-11-22 12:42:23 +0000
@@ -646,10 +646,7 @@
return {'value': {'price_unit': price_unit or 0.0, 'name': name or '',
'notes': notes or'', 'product_uom' : uom or False}, 'domain':{'product_uom':[]}}
prod= self.pool.get('product.product').browse(cr, uid, product)
- if prod.product_tmpl_id.seller_ids:
- seller_get_id = prod.product_tmpl_id.seller_ids[0].name.id
- else:
- seller_get_id = False
+
lang=False
if partner_id:
@@ -680,15 +677,22 @@
'date': date_order,
})[pricelist]
dt = (datetime.now() + relativedelta(days=int(seller_delay) or 0.0)).strftime('%Y-%m-%d %H:%M:%S')
- if seller_get_id == partner_id:
- prod_suppl_name = self.pool.get('product.product').browse(cr, uid, prod.id).seller_ids[0].product_name
- prod_suppl_code = self.pool.get('product.product').browse(cr, uid, prod.id).seller_ids[0].product_code
- if prod_suppl_name == False or prod_suppl_code == False:
- prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id])[0][1]
- else:
- prod_name= '[' + prod_suppl_code + '] '+ prod_suppl_name
- else:
- prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id])[0][1]
+
+ seller_get_id = False
+
+ prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id])[0][1]
+
+ for seller_id in prod.product_tmpl_id.seller_ids:
+ if seller_id.name.id == partner_id:
+ prod_suppl_name = seller_id.product_name
+ prod_suppl_code = seller_id.product_code
+ if not (prod_suppl_name or prod_suppl_code):
+ prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id])[0][1]
+ elif (not prod_suppl_name) or (not prod_suppl_code):
+ prod_name= '[' + (prod_suppl_code or prod.default_code or '') + '] '+ (prod_suppl_name or prod.name or '')
+ else:
+ prod_name= '[' + prod_suppl_code + '] '+ prod_suppl_name
+
res = {'value': {'price_unit': price, 'name': name or prod_name,
'taxes_id':map(lambda x: x.id, prod.supplier_taxes_id),
=== modified file 'stock/stock_view.xml'
--- stock/stock_view.xml 2010-11-22 12:39:34 +0000
+++ stock/stock_view.xml 2010-11-22 12:42:23 +0000
@@ -786,7 +786,7 @@
</group>
<newline/>
<group expand="0" string="Group By..." colspan="4" col="8">
- <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'address_id'}"/>
+ <filter string="Partner" icon="terp-partner" domain="[]" context="{'group_by':'partner_id'}"/>
<separator orientation="vertical" />
<filter string="State" icon="terp-stock_effects-object-colorize" domain="[]" context="{'group_by':'state'}"/>
<separator orientation="vertical" />
@@ -931,7 +931,7 @@
</group>
</form>
</field>
- <group col="10" colspan="4">
+ <group col="12" colspan="4">
<field name="state" readonly="1"/>
<button name="button_cancel" states="assigned,confirmed,draft" string="_Cancel" icon="gtk-cancel"/>
<button name="draft_force_assign" states="draft" string="Process Later" type="object" icon="gtk-ok"/>
=== modified file 'stock/wizard/stock_return_picking_view.xml'
--- stock/wizard/stock_return_picking_view.xml 2010-08-10 13:37:05 +0000
+++ stock/wizard/stock_return_picking_view.xml 2010-11-22 12:42:23 +0000
@@ -1,12 +1,13 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
- <act_window name="Return Picking"
+ <act_window name="Return Picking"
res_model="stock.return.picking"
src_model="stock.picking"
view_mode="form"
- target="new"
- key2="client_action_multi"
- id="act_stock_return_picking"/>
+ target="new"
+ key2="client_action_multi"
+ multi="True"
+ id="act_stock_return_picking"/>
</data>
-</openerp>
+</openerp>
Follow ups