[MERGE]: Merge with lp:~openerp-dev/openobject-addons/ron-dev-addons2
bzr revid: rpa@tinyerp.com-20101123120508-jjbld5da36xwy85r
This commit is contained in:
commit
3b9aac2a4a
|
@ -6,6 +6,7 @@
|
|||
id="report_shipping"
|
||||
model="stock.picking"
|
||||
name="sale.shipping"
|
||||
multi="True"
|
||||
rml="delivery/report/shipping.rml"
|
||||
string="Delivery order"/>
|
||||
|
||||
|
|
|
@ -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>
|
||||
|
@ -271,5 +274,18 @@
|
|||
</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="%(report_shipping)d" string="Delivery Order" states="done,assigned" type="action" icon="gtk-print"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
|
@ -30,6 +30,34 @@ from tools.translate import _
|
|||
def is_pair(x):
|
||||
return not x%2
|
||||
|
||||
def check_ean(eancode):
|
||||
if not eancode:
|
||||
return True
|
||||
if len(eancode) <> 13:
|
||||
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
|
||||
#----------------------------------------------------------
|
||||
|
@ -452,25 +480,9 @@ class product_product(osv.osv):
|
|||
return False
|
||||
|
||||
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
|
||||
for product in self.browse(cr, uid, ids):
|
||||
res = check_ean(product.ean13)
|
||||
return res
|
||||
|
||||
_constraints = [(_check_ean_key, 'Error: Invalid ean code', ['ean13'])]
|
||||
|
||||
|
@ -600,6 +612,13 @@ class product_packaging(osv.osv):
|
|||
}
|
||||
|
||||
|
||||
def _check_ean_key(self, cr, uid, ids):
|
||||
for pack in self.browse(cr, uid, ids):
|
||||
res = check_ean(pack.ean)
|
||||
return res
|
||||
|
||||
_constraints = [(_check_ean_key, 'Error: Invalid ean code', ['ean'])]
|
||||
|
||||
def name_get(self, cr, uid, ids, context={}):
|
||||
if not len(ids):
|
||||
return []
|
||||
|
|
|
@ -646,10 +646,7 @@ class purchase_order_line(osv.osv):
|
|||
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:
|
||||
|
@ -665,12 +662,22 @@ class purchase_order_line(osv.osv):
|
|||
date_order = time.strftime('%Y-%m-%d')
|
||||
qty = qty or 1.0
|
||||
seller_delay = 0
|
||||
|
||||
prod_name = self.pool.get('product.product').name_get(cr, uid, [prod.id])[0][1]
|
||||
for s in prod.seller_ids:
|
||||
if s.name.id == partner_id:
|
||||
seller_delay = s.delay
|
||||
temp_qty = s.qty # supplier _qty assigned to temp
|
||||
if qty < temp_qty: # If the supplier quantity is greater than entered from user, set minimal.
|
||||
qty = temp_qty
|
||||
prod_suppl_name = s.product_name
|
||||
prod_suppl_code = s.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
|
||||
if price_unit:
|
||||
price = price_unit
|
||||
else:
|
||||
|
@ -680,15 +687,7 @@ class purchase_order_line(osv.osv):
|
|||
'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]
|
||||
|
||||
|
||||
res = {'value': {'price_unit': price, 'name': name or prod_name,
|
||||
'taxes_id':map(lambda x: x.id, prod.supplier_taxes_id),
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
date_order: '2010-05-11'
|
||||
invoice_method: manual
|
||||
location_id: stock.stock_location_stock
|
||||
name: PO00010
|
||||
order_line:
|
||||
- date_planned: '2010-05-13'
|
||||
name: iPod
|
||||
|
@ -99,7 +98,7 @@
|
|||
from tools.translate import _
|
||||
pur_id1=self.browse(cr, uid, ref("purchase_order_po1"))
|
||||
account_obj = self.pool.get('account.invoice')
|
||||
ids = account_obj.search(cr, uid, [('origin', '=', pur_id1.name)])
|
||||
ids = account_obj.search(cr, uid, [('origin', '=', 'PO-'+str(pur_id1.id))])
|
||||
assert ids, _('Pending Invoice is not created!')
|
||||
-
|
||||
I check that the order which was initially in the confirmed state has transit to approved state.
|
||||
|
|
|
@ -31,7 +31,6 @@
|
|||
date_order: '2010-05-11'
|
||||
invoice_method: picking
|
||||
location_id: stock.stock_location_stock
|
||||
name: PO00008
|
||||
order_line:
|
||||
- date_planned: '2010-05-13'
|
||||
name: iPod
|
||||
|
@ -99,7 +98,7 @@
|
|||
from tools.translate import _
|
||||
pur_id1=self.browse(cr, uid, ref("purchase_order_po2"))
|
||||
account_obj = self.pool.get('account.invoice')
|
||||
ids = account_obj.search(cr, uid, [('origin', '=', pur_id1.name)])
|
||||
ids = account_obj.search(cr, uid, [('origin', '=', 'PO-'+str(pur_id1.id))])
|
||||
assert ids, _('Pending Invoice is not created!')
|
||||
-
|
||||
I check that the order which was initially in the confirmed state has transit to approved state.
|
||||
|
|
|
@ -783,7 +783,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" />
|
||||
|
@ -928,7 +928,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"/>
|
||||
|
@ -937,6 +937,7 @@
|
|||
<button name="force_assign" states="confirmed" string="Force Availability" type="object" icon="gtk-jump-to"/>
|
||||
<button name="action_process" states="assigned" string="Process" type="object" icon="gtk-go-forward"/>
|
||||
<button name="%(action_stock_invoice_onshipping)d" string="Create Invoice" states="done" type="action" icon="terp-gtk-go-back-rtl"/>
|
||||
<button name="%(act_stock_return_picking)d" string="Return Products" states="done" type="action" icon="gtk-execute"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Additional info" groups="base.group_extended,base.group_multi_company">
|
||||
|
@ -1158,6 +1159,7 @@
|
|||
<group colspan="1" states="done">
|
||||
<button name="%(action_stock_invoice_onshipping)d" string="Create Invoice" type="action" icon="terp-gtk-go-back-rtl"/>
|
||||
</group>
|
||||
<button name="%(act_stock_return_picking)d" string="Return Products" states="done" type="action" icon="gtk-execute"/>
|
||||
</group>
|
||||
</page>
|
||||
<page string="Additional Info" groups="base.group_extended,base.group_multi_company">
|
||||
|
|
|
@ -63,7 +63,6 @@ class stock_invoice_onshipping(osv.osv_memory):
|
|||
|
||||
|
||||
_columns = {
|
||||
# 'journal_id': fields.many2one('account.journal', 'Destination Journal', required=True,selection=_get_journal_id),
|
||||
'journal_id': fields.selection(_get_journal_id, 'Destination Journal',required=True),
|
||||
'group': fields.boolean("Group by partner"),
|
||||
'invoice_date': fields.date('Invoiced date'),
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
view_mode="form"
|
||||
target="new"
|
||||
key2="client_action_multi"
|
||||
multi="True"
|
||||
id="act_stock_return_picking"/>
|
||||
</data>
|
||||
</openerp>
|
||||
|
|
Loading…
Reference in New Issue