'auction_wizard.xml'
],
'demo_xml': ['auction_demo.xml'],
-# 'test' : ['test/auction.yml','test/auction_wizard.yml'],
'installable': True,
'active': False,
'certificate': '0039333102717',
<field eval="'Gardner Group'" name="name"/>
<field eval="'(282) 603-7489'" name="phone"/>
</record>
+ <record id="crm_case_webvisitor0" model="crm.lead">
+ <field eval="1" name="active"/>
+ <field name="type_id" ref="crm.type_lead5"/>
+ <field eval=""1"" name="priority"/>
+ <field name="type">lead</field>
+ <field name="user_id" ref="base.user_demo"/>
+ <field eval=""Questionnaire"" name="name"/>
+ <field eval=""open"" name="state"/>
+ <field name="section_id" ref="crm.section_sales_department"/>
+ <field eval=""Smith John"" name="partner_name2"/>
+ <field eval=""(487) 013-1504"" name="partner_mobile"/>
+ <field name="categ_id" ref="crm.categ_oppor6"/>
+ <field eval=""Website Visitor"" name="partner_name"/>
+ <field eval=""smith_john@gmail.com"" name="email_from"/>
+ <field eval="time.strftime('%Y-%m-16 10:05:15')" name="date"/>
+ </record>
+ <record id="crm_case_business_card0" model="crm.lead">
+ <field eval="1" name="active"/>
+ <field name="type_id" ref="crm.type_lead3"/>
+ <field eval=""2"" name="priority"/>
+ <field name="type">lead</field>
+ <field name="user_id" ref="base.user_root"/>
+ <field eval=""Marketing Products"" name="name"/>
+ <field eval=""open"" name="state"/>
+ <field name="section_id" ref="crm.section_sales_department"/>
+ <field eval=""Elvis Borne"" name="partner_name2"/>
+ <field eval=""(147) 014-6574"" name="partner_mobile"/>
+ <field name="categ_id" ref="crm.categ_oppor5"/>
+ <field name="stage_id" ref="crm.stage_lead1"/>
+ <field eval=""Business Card"" name="partner_name"/>
+ <field eval=""(124) 587-8974"" name="partner_phone"/>
+ <field eval="time.strftime('%Y-%m-16 11:05:15')" name="date"/>
+ </record>
+ <record id="crm_case_imported_contact0" model="crm.lead">
+ <field eval="1" name="active"/>
+ <field name="type_id" ref="crm.type_lead8"/>
+ <field eval=""2"" name="priority"/>
+ <field name="type">lead</field>
+ <field name="user_id" ref="base.user_demo"/>
+ <field eval=""Business Group"" name="name"/>
+ <field eval=""cancel"" name="state"/>
+ <field name="section_id" ref="crm.section_sales_department"/>
+ <field eval=""Drew Clark"" name="partner_name2"/>
+ <field eval=""(125) 021-4781"" name="partner_mobile"/>
+ <field name="categ_id" ref="crm.categ_oppor1"/>
+ <field name="stage_id" ref="crm.stage_lead2"/>
+ <field eval=""Imported Contact"" name="partner_name"/>
+ </record>
+ <record id="crm_case_employee0" model="crm.lead">
+ <field eval="1" name="active"/>
+ <field name="type_id" ref="crm.type_lead3"/>
+ <field eval=""3"" name="priority"/>
+ <field name="type">lead</field>
+ <field name="user_id" ref="base.user_root"/>
+ <field eval=""OpenERP Campaining"" name="name"/>
+ <field eval=""draft"" name="state"/>
+ <field name="section_id" ref="crm.section_sales_department"/>
+ <field eval=""Carl Nelson"" name="partner_name2"/>
+ <field eval=""(874) 022-6574"" name="partner_mobile"/>
+ <field name="categ_id" ref="crm.categ_oppor3"/>
+ <field name="stage_id" ref="crm.stage_lead3"/>
+ <field eval=""Campaining"" name="partner_name"/>
+ <field eval=""(232) 147-6329"" name="partner_phone"/>
+ </record>
+ <record id="crm_case_company_partnership0" model="crm.lead">
+ <field eval="1" name="active"/>
+ <field name="type_id" ref="crm.type_lead3"/>
+ <field eval=""3"" name="priority"/>
+ <field name="type">lead</field>
+ <field name="user_id" ref="base.user_demo"/>
+ <field eval=""Offer"" name="name"/>
+ <field eval=""done"" name="state"/>
+ <field name="section_id" ref="crm.section_sales_department"/>
+ <field eval=""Joe Lucas"" name="partner_name2"/>
+ <field eval=""(234) 031-1254"" name="partner_mobile"/>
+ <field name="categ_id" ref="crm.categ_oppor7"/>
+ <field name="stage_id" ref="crm.stage_lead1"/>
+ <field eval=""Partnership Offer"" name="partner_name"/>
+ <field eval=""(254) 954-2147"" name="partner_phone"/>
+ </record>
</data>
</openerp>
<field name="type_id" ref="crm.type_oppor1"/>
<field name="partner_id" ref="base.res_partner_8"/>
<field eval=""3"" name="priority"/>
- <field name="user_id" ref="base.user_root"/>
+ <field name="user_id" ref="base.user_demo"/>
<field eval=""pending"" name="state"/>
<field eval="55000.0" name="planned_revenue"/>
<field eval="70" name="probability"/>
<field name="stage_id" ref="crm.stage_oppor6"/>
<field eval=""Dirt Mining Ltd 271742 - 1000 units"" name="name"/>
</record>
+ <record id="crm_case_dreamweaversunits0" model="crm.lead">
+ <field eval="75" name="probability"/>
+ <field name="partner_address_id" ref="base.res_partner_address_9"/>
+ <field name="type">opportunity</field>
+ <field eval="1" name="active"/>
+ <field name="type_id" ref="crm.type_oppor1"/>
+ <field name="partner_id" ref="base.res_partner_2"/>
+ <field eval=""3"" name="priority"/>
+ <field name="user_id" ref="base.user_demo"/>
+ <field eval=""open"" name="state"/>
+ <field eval="35000.0" name="planned_cost"/>
+ <field eval="42000.0" name="planned_revenue"/>
+ <field name="section_id" ref="crm.section_sales_department"/>
+ <field name="categ_id" ref="crm.categ_oppor4"/>
+ <field name="stage_id" ref="crm.stage_oppor1"/>
+ <field eval=""Dream Weavers - 2000 units"" name="name"/>
+ </record>
+ <record id="crm_case_supervalueunits0" model="crm.lead">
+ <field eval="70" name="probability"/>
+ <field name="partner_address_id" ref="base.res_partner_address_11"/>
+ <field name="type">opportunity</field>
+ <field eval="1" name="active"/>
+ <field name="type_id" ref="crm.type_oppor1"/>
+ <field name="partner_id" ref="base.res_partner_sednacom"/>
+ <field eval=""2"" name="priority"/>
+ <field name="user_id" ref="base.user_root"/>
+ <field eval=""open"" name="state"/>
+ <field eval="38000.0" name="planned_cost"/>
+ <field eval="49000.0" name="planned_revenue"/>
+ <field name="section_id" ref="crm.section_sales_department"/>
+ <field name="categ_id" ref="crm.categ_oppor5"/>
+ <field name="stage_id" ref="crm.stage_oppor3"/>
+ <field eval=""Super Value 84581- 1500 units"" name="name"/>
+ </record>
+ <record id="crm_case_business_solutionunits0" model="crm.lead">
+ <field eval="85" name="probability"/>
+ <field name="partner_address_id" ref="base.res_partner_address_zen"/>
+ <field name="type">opportunity</field>
+ <field eval="1" name="active"/>
+ <field name="type_id" ref="crm.type_oppor1"/>
+ <field name="partner_id" ref="base.res_partner_3"/>
+ <field eval=""1"" name="priority"/>
+ <field name="user_id" ref="base.user_demo"/>
+ <field eval=""done"" name="state"/>
+ <field eval="35000.0" name="planned_cost"/>
+ <field eval="40000.0" name="planned_revenue"/>
+ <field name="section_id" ref="crm.section_sales_department"/>
+ <field name="categ_id" ref="crm.categ_oppor6"/>
+ <field name="stage_id" ref="crm.stage_oppor6"/>
+ <field eval=""Business Solutions 21478- 2000 units"" name="name"/>
+ </record>
+ <record id="crm_case_sunrisemarketingunits0" model="crm.lead">
+ <field eval="45" name="probability"/>
+ <field name="partner_address_id" ref="base.res_partner_address_7"/>
+ <field name="type">opportunity</field>
+ <field eval="1" name="active"/>
+ <field name="type_id" ref="crm.type_oppor1"/>
+ <field name="partner_id" ref="base.res_partner_4"/>
+ <field eval=""3"" name="priority"/>
+ <field name="user_id" ref="base.user_root"/>
+ <field eval=""draft"" name="state"/>
+ <field eval="45000.0" name="planned_cost"/>
+ <field eval="50000.0" name="planned_revenue"/>
+ <field name="section_id" ref="crm.section_sales_department"/>
+ <field name="categ_id" ref="crm.categ_oppor6"/>
+ <field name="stage_id" ref="crm.stage_oppor6"/>
+ <field eval=""Sunrise Marketing - 3000 units"" name="name"/>
+ </record>
+ <record id="crm_case_alphaunits0" model="crm.lead">
+ <field eval="50" name="probability"/>
+ <field name="partner_address_id" ref="base.res_partner_address_6"/>
+ <field name="type">opportunity</field>
+ <field eval="1" name="active"/>
+ <field name="type_id" ref="crm.type_oppor1"/>
+ <field name="partner_id" ref="base.res_partner_6"/>
+ <field eval=""2"" name="priority"/>
+ <field name="user_id" ref="base.user_demo"/>
+ <field eval=""cancel"" name="state"/>
+ <field eval="30000.0" name="planned_cost"/>
+ <field eval="40000.0" name="planned_revenue"/>
+ <field name="section_id" ref="crm.section_sales_department"/>
+ <field name="categ_id" ref="crm.categ_oppor7"/>
+ <field name="stage_id" ref="crm.stage_oppor2"/>
+ <field eval=""Alpha Appliances - 2000 units"" name="name"/>
+ </record>
</data>
</openerp>
'company_id': lambda self, cr, uid, c: self.pool.get('res.company')._company_default_get(cr, uid, 'mrp.production', context=c),
}
_order = 'date_planned asc, priority desc';
-
+
+ def _check_qty(self, cr, uid, ids):
+ orders = self.browse(cr, uid, ids)
+ for order in orders:
+ if order.product_qty <= 0:
+ return False
+ return True
+
+ _constraints = [
+ (_check_qty, 'Order quantity cannot be negative or zero !', ['product_qty']),
+ ]
+
def unlink(self, cr, uid, ids, context=None):
productions = self.read(cr, uid, ids, ['state'])
unlink_ids = []
<field name="routing_id" ref="mrp_routing_2"/>
<field name="type">normal</field>
<field model="product.product" name="product_id" ref="product.product_product_cpu_gen"/>
+ <field name="multi_level_bom">True</field>
</record>
<record id="mrp_bom_1" model="mrp.bom">
<field name="product_qty">1.0</field>
<field name="routing_id" ref="mrp_routing_0"/>
<field model="product.product" name="product_id" ref="product.product_product_pc2" />
+ <field name="multi_level_bom">True</field>
</record>
<record id="mrp_bom_2" model="mrp.bom">
<field name="name">Assembly Medium PC</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field model="product.product" name="product_id" ref="product.product_product_pc3"/>
+ <field name="multi_level_bom">True</field>
</record>
<record id="mrp_bom_3" model="mrp.bom">
<field name="name">Assembly Customizable PC</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field model="product.product" name="product_id" ref="product.product_product_pc4"/>
+ <field name="multi_level_bom">True</field>
</record>
<record id="mrp_bom_4" model="mrp.bom">
<field name="name">HDD on demand</field>
<field name="product_qty">1.0</field>
<field name="type">phantom</field>
<field model="product.product" name="product_id" ref="product.product_product_20"/>
+ <field name="multi_level_bom">True</field>
</record>
<record id="mrp_bom_5" model="mrp.bom">
<field name="name">RAM on demand</field>
<field name="product_qty">1.0</field>
<field name="type">phantom</field>
<field model="product.product" name="product_id" ref="product.product_product_21"/>
+ <field name="multi_level_bom">True</field>
</record>
<record id="mrp_bom_6" model="mrp.bom">
<field name="name">HDD on demand</field>
<field name="product_qty">1.0</field>
<field name="type">phantom</field>
<field model="product.product" name="product_id" ref="product.product_product_20"/>
+ <field name="multi_level_bom">True</field>
</record>
<record id="mrp_bom_7" model="mrp.bom">
<field name="name">HDD on demand</field>
<field name="product_qty">1.0</field>
<field name="type">phantom</field>
<field model="product.product" name="product_id" ref="product.product_product_20"/>
+ <field name="multi_level_bom">True</field>
</record>
<record id="mrp_bom_8" model="mrp.bom">
<field name="name">HDD Seagate</field>
<field name="product_qty">1.0</field>
<field name="type">normal</field>
<field model="product.product" name="product_id" ref="product.product_product_hdd1"/>
+ <field name="multi_level_bom">True</field>
</record>
<record id="mrp_bom_9" model="mrp.bom">
<field name="name">Assembly Basic PC</field>
<field name="routing_id" ref="mrp_routing_0"/>
<field name="type">normal</field>
<field model="product.product" name="product_id" ref="product.product_product_pc1"/>
+ <field name="multi_level_bom">True</field>
</record>
<record id="mrp_bom_10" model="mrp.bom">
<field name="name">Complete PC with peripherals</field>
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field model="product.product" name="product_id" ref="product.product_product_23"/>
+ <field name="multi_level_bom">True</field>
</record>
<record id="mrp_bom_11" model="mrp.bom">
<field name="name">RAM on demand</field>
<field name="product_qty">1.0</field>
<field name="type">phantom</field>
<field model="product.product" name="product_id" ref="product.product_product_23"/>
+ <field name="multi_level_bom">True</field>
</record>
<record id="mrp_bom_13" model="mrp.bom">
<field name="product_uom" ref="product.product_uom_unit"/>
<field name="product_qty">1.0</field>
<field model="product.product" name="product_id" ref="product.product_product_cpu3"/>
+ <field name="multi_level_bom">True</field>
</record>
<record id="mrp_bom_kit" model="mrp.bom">
<field name="type">ir.actions.act_window</field>
<field name="res_model">mrp.bom</field>
<field name="view_type">form</field>
- <field name="domain">[('bom_id','=',False)]</field>
+ <field name="domain">[('bom_id','=',False),('multi_level_bom','=',True)]</field>
<field name="search_view_id" ref="view_mrp_bom_filter"/>
</record>
<record id="mrp_bom_form_action2" model="ir.actions.act_window">
class product_product(osv.osv):
_inherit = "product.product"
+ def get_product_accounts(self, cr, uid, product_id, context={}):
+ """ To get the stock input account, stock output account and stock journal related to product.
+ @param product_id: product id
+ @return: dictionary which contains information regarding stock input account, stock output account and stock journal
+ """
+ product_obj = self.pool.get('product.product').browse(cr, uid, product_id, False)
+
+ stock_input_acc = product_obj.property_stock_account_input and product_obj.property_stock_account_input.id or False
+ if not stock_input_acc:
+ stock_input_acc = product_obj.categ_id.property_stock_account_input_categ and product_obj.categ_id.property_stock_account_input_categ.id or False
+
+ stock_output_acc = product_obj.property_stock_account_output and product_obj.property_stock_account_output.id or False
+ if not stock_output_acc:
+ stock_output_acc = product_obj.categ_id.property_stock_account_output_categ and product_obj.categ_id.property_stock_account_output_categ.id or False
+
+ journal_id = product_obj.categ_id.property_stock_journal and product_obj.categ_id.property_stock_journal.id or False
+
+ res = {}
+ res.update({'stock_account_input': stock_input_acc})
+ res.update({'stock_account_output': stock_output_acc})
+ res.update({'stock_journal': journal_id})
+
+ return res
+
def do_change_standard_price(self, cr, uid, ids, datas, context={}):
""" Changes the Standard Price of Product and parent products and creates an account move accordingly.
@param datas: dict. contain default datas like new_price, stock_output_account, stock_input_account, stock_journal
import pos
import account_bank_statement
import pos_account_bank_statement
+import stock
import wizard
import report
"""Create a picking for each order and validate it."""
picking_obj = self.pool.get('stock.picking')
- pick_name=self.pool.get('ir.sequence').get(cr, uid, 'stock.picking.out')
+
orders = self.browse(cr, uid, ids, context)
for order in orders:
if not order.picking_id:
new = True
picking_id = picking_obj.create(cr, uid, {
- 'name':pick_name,
'origin': order.name,
'type': 'out',
'state': 'draft',
if line.qty < 0:
location_id, stock_dest_id = stock_dest_id, location_id
- self.pool.get('stock.move').create(cr, uid, {
+ self.pool.get('stock.move').create(cr, uid, {
'name': 'Stock move (POS %d)' % (order.id, ),
'product_uom': line.product_id.uom_id.id,
'product_uos': line.product_id.uom_id.id,
raise osv.except_osv(_('No Pricelist !'),
_('You have to select a pricelist in the sale form !\n' \
'Please set one before choosing a product.'))
- p_obj = self.pool.get('product.product').browse(cr,uid,[product_id])[0]
- uom_id=p_obj.uom_po_id.id
+ p_obj = self.pool.get('product.product').browse(cr,uid,product_id).list_price
price = self.pool.get('product.pricelist').price_get(cr, uid,
- [pricelist], product_id, qty or 1.0, partner_id,{'uom': uom_id})[pricelist]
- unit_price=price or p_obj.list_price
- if unit_price is False:
- raise osv.except_osv(_('No valid pricelist line found !'),
- _("Couldn't find a pricelist line matching this product" \
- " and quantity.\nYou have to change either the product," \
- " the quantity or the pricelist."))
- return unit_price
-
+ [pricelist], product_id, qty or 1.0, partner_id)[pricelist]
+ # Todo need to check
+# if price is False:
+# raise osv.except_osv(_('No valid pricelist line found !'),
+# _("Couldn't find a pricelist line matching this product" \
+# " and quantity.\nYou have to change either the product," \
+# " the quantity or the pricelist."))
+ return price or p_obj
+
def onchange_product_id(self, cr, uid, ids, pricelist, product_id, qty=0, partner_id=False):
price = self.price_by_product(cr, uid, ids, pricelist, product_id, qty, partner_id)
self.write(cr,uid,ids,{'price_unit':price})
'disc_controle': lambda *a: True,
}
product_product()
-
-class stock_picking(osv.osv):
-
- _inherit = 'stock.picking'
- _columns = {
- 'pos_order': fields.many2one('pos.order', 'Pos order'),
- }
-stock_picking()
-
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
--- /dev/null
+# -*- encoding: utf-8 -*-
+##############################################################################
+#
+# OpenERP, Open Source Management Solution
+# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved
+# $Id$
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+#
+##############################################################################
+
+from osv import osv, fields
+import time
+import netsvc
+
+
+class stock_picking(osv.osv):
+
+ _inherit = 'stock.picking'
+ _columns = {
+ 'pos_order': fields.many2one('pos.order', 'Pos order'),
+ }
+stock_picking()
+
+# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
+
'type': 'ir.actions.act_window',
}
def close_action(self, cr, uid, ids, context):
- """
- To get the product and Make the payment .
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
- @return : Return the Make Payment
- """
record_id = context and context.get('active_id', False)
order_obj= self.pool.get('pos.order')
def view_init(self, cr, uid, fields_list, context=None):
- """
- Creates view dynamically and adding fields at runtime.
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
- @return: New arch of view with new columns.
- """
res = super(pos_discount, self).view_init(cr, uid, fields_list, context=context)
record_id = context and context.get('active_id', False) or False
order = self.pool.get('pos.order').browse(cr, uid, record_id)
"""
return result
- def check(self, cr, uid, ids, context):
+ def check(self, cr, uid, ids, context=None):
"""Check the order:
if the order is not paid: continue payment,
return self.create_invoice(cr,uid,ids,context)
else:
context.update({'flag': True})
- order_obj.action_paid(cr,uid,[active_id],context)
- if context.get('return'):
- order_obj.write(cr, uid, [active_id],{'state':'done'})
- else:
- order_obj.write(cr, uid, [active_id],{'state':'paid'})
+ order_obj.action_paid(cr,uid,[active_id],context)
+ order_obj.write(cr, uid, [active_id],{'state':'paid'})
return self.print_report(cr, uid, ids, context)
if order.amount_paid > 0.0:
context.update({'flag': True})
def create_invoice(self, cr, uid, ids, context):
-
- """
- Create a invoice
- """
wf_service = netsvc.LocalService("workflow")
active_ids = [context and context.get('active_id',False)]
for i in active_ids:
}
def print_report(self, cr, uid, ids, context=None):
+ if not context:
+ context={}
"""
@summary: To get the date and print the report
@param self: The object pointer.
@param uid: ID of the user currently logged in
@param context: A standard dictionary
@return : retrun report
- """
- if not context:
- context={}
+ """
active_id=context.get('active_id',[])
datas = {'ids' : [active_id]}
res = {}
class pos_payment_report_date(osv.osv_memory):
+ '''
+ Open ERP Model
+ '''
_name = 'pos.payment.report.date'
_description = 'POS Payment Report according to date'
def print_report(self, cr, uid, ids, context=None):
class pos_payment_report_user(osv.osv_memory):
+ '''
+ Open ERP Model
+ '''
_name = 'pos.payment.report.user'
_description = 'Sales lines by Users'
def print_report(self, cr, uid, ids, context=None):
}
def view_init(self, cr, uid, fields_list, context=None):
- """
- Creates view dynamically and adding fields at runtime.
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
- @return: New arch of view with new columns.
- """
order_lst = self. pool.get('pos.order').browse(cr, uid, context['active_id'])
for order in order_lst:
if order.state_2 in ('to_verify'):
return res
def view_init(self, cr, uid, fields_list, context=None):
- """
- Creates view dynamically and adding fields at runtime.
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
- @return: New arch of view with new columns.
- """
res = super(pos_return, self).view_init(cr, uid, fields_list, context=context)
order_obj=self.pool.get('pos.order')
if not context:
return res
def fields_view_get(self, cr, uid, view_id=None, view_type='form', context=None, toolbar=False,submenu=False):
-
- """
- Changes the view dynamically
-
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
-
- @return: New arch of view.
-
- """
result = super(pos_return, self).fields_view_get(cr, uid, view_id, view_type, context, toolbar,submenu)
if not context:
context={}
def create_returns(self, cr, uid, data, context):
- """
- @param self: The object pointer.
- @param cr: A database cursor
- @param uid: ID of the user currently logged in
- @param context: A standard dictionary
-
- @return: Return the add product form again for adding more product
-
- """
return {
'name': _('Add Product'),
'view_type': 'form',
line_obj.copy(cr,uid,line.id,{'qty':-qty ,
'order_id': new_order,
})
- order_obj.write(cr,uid, active_id, {'state':'done'})
order_obj.write(cr,uid, new_order, {'state':'done'})
wf_service.trg_validate(uid, 'stock.picking',new_picking,'button_confirm', cr)
picking_obj.force_assign(cr, uid, [new_picking], context)
})
wf_service.trg_validate(uid, 'stock.picking',new_picking,'button_confirm', cr)
picking_obj.force_assign(cr, uid, [new_picking], context)
- obj=order_obj.browse(cr,uid, active_ids[0])
- context.update({'return':'return'})
-
+ obj=order_obj.browse(cr,uid, active_ids[0])
+
if obj.amount_total != obj.amount_paid:
return {
'name': _('Make Payment'),
<field name="move_id" groups="base.group_extended"/>
<field name="date_close"/>
<field name="close_move" groups="base.group_extended"/>
- <group colspan="4" groups="base.group_extended">
+ <group colspan="4" groups="base.group_extended" expand="1">
<separator colspan="4" string="Properties" />
<field colspan="4" name="property_ids" nolabel="1"/>
</group>
partner_list = sorted([(partner_id.sequence, partner_id) for partner_id in procurement.product_id.seller_ids if partner_id])
partner_rec = partner_list and partner_list[0] and partner_list[0][1] or False
partner = partner_rec.name or False
- partner_id = partner_rec.id or False
+ partner_id = partner.id or False
address_id = partner_obj.address_get(cr, uid, [partner_id], ['delivery'])['delivery']
pricelist_id = partner.property_product_pricelist_purchase.id
-
- In order to test the purchase flow,I start by creating a new product 'iPod'
+ In order to test the purchase flow,I start by creating a new product 'iPod'
-
!record {model: product.product, id: product_product_ipod0}:
categ_id: 'product.product_category_3'
weight: 0.0
weight_net: 0.0
-
- In order to test the purchase flow,I create a new record where "invoice_method" is From Manual
+ In order to test the purchase flow,I create a new record where "invoice_method" is From Manual
-
- I create purchase order for iPod.
+ Creating an purchase.order record
-
!record {model: purchase.order, id: purchase_order_po1}:
company_id: base.main_company
date_order: '2010-05-11'
- invoice_method: manual
+ invoice_method: order
location_id: stock.stock_location_stock
name: PO00010
order_line:
partner_id: base.res_partner_4
pricelist_id: purchase.list0
-
- Initially purchase order is in the draft state
+ Initially purchase order is in the draft state
-
!assert {model: purchase.order, id: purchase_order_po1}:
- state == 'draft'
-
- I confirm the purchase order.
+ Then an order is confirmed by clicking on the "Confirm Purchase Order" button
+-
+ !python {model: purchase.order}: |
+ self.wkf_confirm_order(cr, uid, [ref("purchase_order_po1")])
+-
+ Performing a workflow action purchase_confirm on module purchase.order
-
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po1}
-
- I check that the order which was initially in the draft state has transit to confirm state.
+ I check that the order which was initially in the draft state has transit to confirm state.
-
!assert {model: purchase.order, id: purchase_order_po1}:
- state == 'confirmed'
-
- I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line
+ I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line
-
!python {model: purchase.order}: |
from tools.translate import _
search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name) ])
assert search_ids, _('Purchase order line is not created!')
-
- To check that wizard "Create Invoices" gets opened
+ To check that wizard "Create Invoices" gets opened
-
- I create purchase order line invoice entry.
+ Creating a purchase.order.line_invoice record
-
!record {model: purchase.order.line_invoice, id: purchase_order_line_invoice_0}:
{}
-
- I create invoice for products in the purchase order.
+ Performing an osv_memory action makeInvoices on module purchase.order.line_invoice
-
!python {model: purchase.order.line_invoice}: |
pur_obj=self.pool.get('purchase.order')
ids.append(line.id)
self.makeInvoices(cr, uid, [1], context={'active_ids': ids})
-
- I check that invoice gets created.
+ I check that invoice gets created
-
!python {model: purchase.order}: |
from tools.translate import _
search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name),('invoiced', '=', '1') ])
assert search_ids, _('Invoice is not created!')
-
- I check that a record gets created in the Pending Invoices.
+ I check that a record gets created in the Pending Invoices
-
!python {model: purchase.order}: |
from tools.translate import _
ids = account_obj.search(cr, uid, [('origin', '=', pur_id1.name)])
assert ids, _('Pending Invoice is not created!')
-
- Supplier approve the purchase order.
+ Then an order is approved by clicking on the "Approved by Supplier" button
+-
+ !python {model: purchase.order}: |
+ self.wkf_approve_order(cr, uid, [ref("purchase_order_po1")])
+-
+ Performing a workflow action purchase_approve on module purchase.order
-
!workflow {model: purchase.order, action: purchase_approve, ref: purchase_order_po1}
-
- I check that the order which was initially in the confirmed state has transit to approved state.
+ I check that the order which was initially in the confirmed state has transit to approved state.
-
!assert {model: purchase.order, id: purchase_order_po1}:
- state == 'approved'
-
- I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved.
+ I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po1"))
assert(pur_id.date_approve)
-
- I check that an entry gets created in the stock pickings.
+ I check that an entry gets created in the stock.picking
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po1"))
assert(pur_id.picking_ids)
-
- I check that an entry gets created in the stock moves.
+ I check that an entry gets created in the stock.move
-
!python {model: purchase.order}: |
from tools.translate import _
search_id = move_obj.search(cr, uid, [('picking_id', '=', pick_id.name)])
assert search_id, _('No Incoming Product!')
-
- I check that Traceability moves are created.
+ I check that Traceability moves are created
-
- In order to test the purchase flow,I start by creating a new product 'iPod'
+ In order to test the purchase flow,I start by creating a new product 'iPod'
-
!record {model: product.product, id: product_product_ipod0}:
categ_id: 'product.product_category_3'
weight: 0.0
weight_net: 0.0
-
- In order to test the purchase flow,I create a new record where "invoice_method" is From Order.
+ In order to test the purchase flow,I create a new record where "invoice_method" is From Order
-
- I create purchase order for iPod.
+ Creating a purchase.order record
-
!record {model: purchase.order, id: purchase_order_po0}:
company_id: base.main_company
partner_id: base.res_partner_4
pricelist_id: purchase.list0
-
- Initially purchase order is in the draft state.
+ Initially purchase order is in the draft state
-
!assert {model: purchase.order, id: purchase_order_po0}:
- state == 'draft'
-
- I confirm the purchase order for iPod.
+ Then an order is confirmed by clicking on the "Confirm Purchase Order" button
+-
+ !python {model: purchase.order}: |
+ self.wkf_confirm_order(cr, uid, [ref("purchase_order_po0")])
+-
+ Performing a workflow action purchase_confirm on module purchase.order
-
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po0}
-
- I check that the order which was initially in the draft state has transit to confirm state.
+ I check that the order which was initially in the draft state has transit to confirm state.
-
!assert {model: purchase.order, id: purchase_order_po0}:
- state == 'confirmed'
-
- I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line.
+ I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line
-
!python {model: purchase.order}: |
from tools.translate import _
search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name) ])
assert search_ids, _('Purchase order line is not created!')
-
- To check that wizard "Create Invoices" gets called.
+ To check that wizard "Create Invoices" gets called
-
- I create purchase order line invoice entry.
+ Creating a purchase.order.line_invoice record
-
!record {model: purchase.order.line_invoice, id: purchase_order_line_invoice_0}:
{}
-
- I create invoice for products in the purchase order.
+ Performing an osv_memory action makeInvoices on module purchase.order.line_invoice
-
!python {model: purchase.order.line_invoice}: |
pur_obj=self.pool.get('purchase.order')
ids.append(line.id)
self.makeInvoices(cr, uid, [1], context={'active_ids': ids})
-
- I check that invoice gets created.
+ I check that invoice gets created
-
!python {model: purchase.order}: |
from tools.translate import _
search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name),('invoiced', '=', '1') ])
assert search_ids, _('Invoice is not created!')
-
- I check that a record gets created in the Pending Invoices.
+ I check that a record gets created in the Pending Invoices
-
!python {model: purchase.order}: |
from tools.translate import _
ids = account_obj.search(cr, uid, [('origin', '=', pur_id1.name)])
assert ids, _('Pending Invoice is not created!')
-
- Supplier approve the purchase order.
+ Then an order is approved by clicking on the "Approved by Supplier" button
+-
+ !python {model: purchase.order}: |
+ self.wkf_approve_order(cr, uid, [ref("purchase_order_po0")])
+-
+ Performing a workflow action purchase_approve on module purchase.order
-
!workflow {model: purchase.order, action: purchase_approve, ref: purchase_order_po0}
-
- I check that the order which was initially in the confirmed state has transit to approved state.
+ I check that the order which was initially in the confirmed state has transit to approved state.
-
!assert {model: purchase.order, id: purchase_order_po0}:
- state == 'approved'
-
- I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved.
+ I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po0"))
assert(pur_id.date_approve)
-
- I check that an entry gets created in the pickings.
+ I check that an entry gets created in the stock.picking
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po0"))
assert(pur_id.picking_ids)
-
- I check that an entry gets created in the stock moves.
+ I check that an entry gets created in the stock.move
-
!python {model: purchase.order}: |
from tools.translate import _
search_id = move_obj.search(cr, uid, [('picking_id', '=', pick_id.name)])
assert search_id, _('No Incoming Product!')
-
- I check that Traceability moves are created.
+ I check that Traceability moves are created
-
- I check that an invoice_id field of Delivery&Invoices gets bind with the value.
+ I check that an invoice_id field of Delivery&Invoices gets bind with the value
-
!python {model: purchase.order}: |
pur_id2=self.browse(cr, uid, ref("purchase_order_po0"))
-
- In order to test the purchase flow,I start by creating a new product 'iPod'
+ In order to test the purchase flow,I start by creating a new product 'iPod'
-
!record {model: product.product, id: product_product_ipod0}:
categ_id: 'product.product_category_3'
weight: 0.0
weight_net: 0.0
-
- In order to test the purchase flow,I create a new record where "invoice_method" is From Picking
+ In order to test the purchase flow,I create a new record where "invoice_method" is From Picking
-
- I create purchase order for iPod.
+ Creating an purchase.order record
-
!record {model: purchase.order, id: purchase_order_po2}:
company_id: base.main_company
partner_id: base.res_partner_4
pricelist_id: purchase.list0
-
- Initially purchase order is in the draft state.
+ Initially purchase order is in the draft state
-
!assert {model: purchase.order, id: purchase_order_po2}:
- state == 'draft'
-
- I confirm the purchase order for iPod.
+ Then an order is confirmed by clicking on the "Confirm Purchase Order" button
+-
+ !python {model: purchase.order}: |
+ self.wkf_confirm_order(cr, uid, [ref("purchase_order_po2")])
+-
+ Performing a workflow action purchase_confirm on module purchase.order
-
!workflow {model: purchase.order, action: purchase_confirm, ref: purchase_order_po2}
-
!assert {model: purchase.order, id: purchase_order_po2}:
- state == 'confirmed'
-
- I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line.
+ I check that an entry gets created in the "Lines to Invoice" of Invoice Control on the basis of purchase order line
-
!python {model: purchase.order}: |
from tools.translate import _
search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name) ])
assert search_ids, _('Purchase order line is not created!')
-
- To check that wizard "Create Invoices" gets opened.
+ To check that wizard "Create Invoices" gets opened
-
- I create purchase order line invoice entry.
+ Creating a purchase.order.line_invoice record
-
!record {model: purchase.order.line_invoice, id: purchase_order_line_invoice_0}:
{}
-
- I create invoice for products in the purchase order.
+ Performing an osv_memory action makeInvoices on module purchase.order.line_invoice
-
!python {model: purchase.order.line_invoice}: |
pur_obj=self.pool.get('purchase.order')
ids.append(line.id)
self.makeInvoices(cr, uid, [1], context={'active_ids': ids})
-
- I check that invoice gets created.
+ I check that invoice gets created
-
!python {model: purchase.order}: |
from tools.translate import _
search_ids=pur_line.search(cr, uid, [('order_id', '=', pur_order_obj.name),('invoiced', '=', '1') ])
assert search_ids, _('Invoice is not created!')
-
- I check that a record gets created in the Pending Invoices.
+ I check that a record gets created in the Pending Invoices
-
!python {model: purchase.order}: |
from tools.translate import _
ids = account_obj.search(cr, uid, [('origin', '=', pur_id1.name)])
assert ids, _('Pending Invoice is not created!')
-
- Supplier approve the purchase order.
+ Then an order is approved by clicking on the "Approved by Supplier" button
+-
+ !python {model: purchase.order}: |
+ self.wkf_approve_order(cr, uid, [ref("purchase_order_po2")])
+-
+ Performing a workflow action purchase_approve on module purchase.order
-
!workflow {model: purchase.order, action: purchase_approve, ref: purchase_order_po2}
-
!assert {model: purchase.order, id: purchase_order_po2}:
- state == 'approved'
-
- I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved.
+ I check that date_approve field of Delivery&Invoices gets bind with the date on which it has been approved
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po2"))
assert(pur_id.date_approve)
-
- I check that an entry gets created in the stock.picking.
+ I check that an entry gets created in the stock.picking
-
!python {model: purchase.order}: |
pur_id=self.browse(cr, uid, ref("purchase_order_po2"))
assert(pur_id.picking_ids)
-
- I check that an entry gets created related to stock move.
+ I check that an entry gets created in the stock.move
-
!python {model: purchase.order}: |
from tools.translate import _
search_id = move_obj.search(cr, uid, [('picking_id', '=', pick_id.name)])
assert search_id, _('No Incoming Product!')
-
- I check that Traceability moves are created.
+ I check that Traceability moves are created
-
- Then I create an invoice from picking by clicking on "Create Invoice" wizard
+ Then I create an invoice from picking by clicking on "Create Invoice" wizard
-
- I create stock invoice on shipping entry.
+ Creating a stock.invoice.onshipping record
-
!record {model: stock.invoice.onshipping, id: stock_invoice_onshipping_0}:
invoice_date: '2010-05-11'
journal_id: account.bank_journal
type: in_invoice
-
- I create Invoice.
+ Performing an osv_memory action create_invoice on module stock.invoice.onshipping
-
!python {model: stock.invoice.onshipping}: |
pur_obj=self.pool.get('purchase.order')
"tz": False, "search_default_approved": 1, "active_model": "stock.picking",
"active_ids": ids, "active_id": ids[0], })
-
- I check that an invoice_id field of Delivery&Invoices gets bind with the value.
+ I check that an invoice_id field of Delivery&Invoices gets bind with the value
-
!python {model: purchase.order}: |
pur_id2=self.browse(cr, uid, ref("purchase_order_po2"))
-
I create two products.
-
- I create one product Table.
--
!record {model: product.product, id: product_product_table0}:
categ_id: product.cat1
name: Table
uom_id: product.product_uom_unit
uom_po_id: product.product_uom_unit
-
- I create another product Wood.
--
!record {model: product.product, id: product_product_wood0}:
categ_id: product.cat1
name: Wood
!record {model: product.category, id: product_category_services0}:
name: Mobile Services
-
- I define New Chocolate Slider Mobile template.
+ I define LG Viewty Smart product template.
-
!record {model: product.template, id: product_template_newchocolateslidermobile0}:
categ_id: product_category_allproductssellable0
uom_id: product.product_uom_unit
uom_po_id: product.product_uom_unit
-
- I define New Chocolate Slider Mobile.
+ I define LG Viewty Smart product.
-
!record {model: product.product, id: product_product_newchocolateslidermobile0}:
categ_id: product_category_allproductssellable0
In Order to test the picking I create picking with move lines.
-
!record {model: stock.picking, id: stock_picking_0}:
- name: test_picking
address_id: res_partner_address_0
company_id: base.main_company
date: '2010-05-11 15:18:52'
##############################################################################
import stock
-import mrp_pull
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
* Manage products to be rent.
""",
'author': 'Tiny',
- 'depends': ['procurement','stock'],
+ 'depends': ['stock'],
'init_xml': [],
- 'update_xml': ['stock_view.xml', 'security/ir.model.access.csv', 'mrp_pull_workflow.xml'],
+ 'update_xml': ['stock_view.xml', 'security/ir.model.access.csv'],
'demo_xml': [],
'installable': True,
'test':[