[IMP] fix on PoS module

bzr revid: fp@tinyerp.com-20111208120111-skr3af91uiqot1ie
This commit is contained in:
Fabien Pinckaers
2011-12-08 13:01:11 +01:00
parent eacd5ff1f2
commit 75fb009dae
3 changed files with 42 additions and 93 deletions
+9 -7
View File
@@ -122,10 +122,10 @@ class pos_order(osv.osv):
'partner_id': fields.many2one('res.partner', 'Customer', change_default=True, select=1, states={'draft': [('readonly', False)], 'paid': [('readonly', False)]}),
'state': fields.selection([('draft', 'New'),
('paid', 'Done'),
('cancel', 'Cancelled'),
('paid', 'Paid'),
('done', 'Posted'),
('invoiced', 'Invoiced'),
('cancel', 'Cancelled')],
('invoiced', 'Invoiced')],
'State', readonly=True),
'invoice_id': fields.many2one('account.invoice', 'Invoice'),
@@ -691,10 +691,12 @@ pos_category()
class product_product(osv.osv):
_inherit = 'product.product'
_columns = {
'income_pdt': fields.boolean('Product for Input'),
'expense_pdt': fields.boolean('Product for Output'),
'img': fields.binary('Pos Image, must be 50x50'),
'pos_categ_id': fields.many2one('pos.category','POS Category', change_default=True, domain="[('type','=','normal')]" ,help="Select a pos category for the current product")
'income_pdt': fields.boolean('PoS Cash Input', help="This is a product you can use to put cash into a statement for the point of sale backend."),
'expense_pdt': fields.boolean('PoS Cash Output', help="This is a product you can use to take cash from a statement for the point of sale backend, exemple: money lost, transfer to bank, etc."),
'img': fields.binary('Product Image, must be 50x50', help="Use an image size of 50x50."),
'pos_categ_id': fields.many2one('pos.category','PoS Category',
domain="[('type','=','normal')]",
help="If you want to sell this product through the point of sale, select the category it belongs to.")
}
product_product()
+29 -83
View File
@@ -12,11 +12,11 @@
<field name="model">pos.order</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sales Order POS">
<form string="PoS Orders">
<group col="7" colspan="4">
<field name="name"/>
<field name="date_order"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id)" groups="base.group_extended"/>
<field name="partner_id" on_change="onchange_partner_id(partner_id)"/>
<button name="invoice" string="Invoice" icon="gtk-apply" type="workflow" states="paid" attrs="{'invisible': ['|',('partner_id','=',False),('state','&lt;&gt;','paid')]}"/>
</group>
<notebook colspan="4">
@@ -49,7 +49,7 @@
<separator colspan="4"/>
<group colspan="4" col="8">
<field name="state" />
<field name="state" widget="statusbar" statusbar_visible="draft,paid,done" statusbar_colors='{"cancel":"red"}'/>
<button name="%(action_pos_payment)d" string="Payment" icon="gtk-apply" type="action" states="draft"/>
<button name="refund" string="Return Products" type="object" icon="gtk-ok"
attrs="{'invisible':[('state','=','draft')]}"/>
@@ -59,9 +59,9 @@
<page string="Payment">
<field name="statement_ids" colspan="4" nolabel="1">
<tree editable="bottom" string="Statement lines">
<field name="amount"/>
<field name="journal_id"/>
<field name="statement_id" />
<field name="amount"/>
</tree>
<form string="Statement lines">
<field name="account_id"/>
@@ -99,11 +99,12 @@
</field>
</record>
<record model="ir.actions.act_window" id="action_pos_pos_form">
<field name="name">Point of Sale</field>
<field name="name">PoS Orders</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">pos.order</field>
<field name="view_type">form</field>
<field name="view_id" ref="view_pos_pos_form"/>
<field name="view_mode">tree,form</field>
<field name="view_id" eval="False"/>
<field name="domain">[]</field>
</record>
<record model="ir.ui.view" id="view_pos_order_tree">
@@ -154,10 +155,10 @@
</record>
<menuitem name="Daily Operations" id="menu_point_of_sale" parent="menu_point_root" sequence="10" />
<menuitem name="New Sale Order" parent="menu_point_of_sale" id="menu_point_ofsale" action="action_pos_pos_form" sequence="1" groups="group_pos_manager,group_pos_user"/>
<menuitem parent="menu_point_of_sale" id="menu_point_ofsale" action="action_pos_pos_form" sequence="1" groups="group_pos_manager,group_pos_user"/>
<menuitem name="Products" id="menu_point_of_sale_product" parent="menu_point_root" sequence="15" />
<menuitem action="product.product_normal_action" id="menu_pos_products" parent="menu_point_of_sale_product" sequence="2" name="Products"/>
<menuitem action="product.product_normal_action" id="menu_pos_products" parent="menu_point_of_sale_product" sequence="2"/>
<record model="ir.ui.view" id="view_pos_order_line">
<field name="name">Sale lines</field>
@@ -580,6 +581,19 @@
<field name="domain">[('date_order','like',time.strftime('%Y-%m'))]</field>
</record>
<record id="product_normal_form_pos_view" model="ir.ui.view">
<field name="name">product.normal.pos.form.inherit</field>
<field name="model">product.product</field>
<field name="type">form</field>
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<field name="categ_id" position="after">
<field name="pos_categ_id"/>
</field>
</field>
</record>
<record id="product_normal_form_view" model="ir.ui.view">
<field name="name">product.normal.form.inherit</field>
<field name="model">product.product</field>
@@ -599,68 +613,24 @@
<field name="name">pos.category.tree</field>
<field name="model">pos.category</field>
<field name="type">tree</field>
<field name="field_parent">child_id</field>
<field name="field_parent" eval="False"/>
<field name="arch" type="xml">
<tree toolbar="True" string="Product Pos Categories">
<tree string="PoS Categories">
<field name="name"/>
</tree>
</field>
</record>
<record id="pos_category_action" model="ir.actions.act_window">
<field name="name">Products by POS-Category</field>
<field name="name">PoS Categories</field>
<field name="type">ir.actions.act_window</field>
<field name="res_model">pos.category</field>
<field name="domain">[('parent_id','=',False)]</field>
<field name="view_type">tree</field>
<field name="view_id" ref="pos_category_tree_view"/>
<field name="help">Here is a list of all your products classified by POS category. You can click a category to get the list of all products linked to this category or to a child of this category.</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="view_id" eval="False"/>
</record>
<menuitem action="pos_category_action" id="menu_pos_category" parent="menu_point_of_sale_product" sequence="0" />
<!-- END -->
<record id="product_input_output_form_view" model="ir.ui.view">
<field name="name">product.normal.form.inherit</field>
<field name="model">product.product</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Product">
<group colspan="4" col="6">
<group colspan="4" col="2">
<separator string="Product Description" colspan="4"/>
<field name="name" />
<field groups="base.group_extended" name="variants" />
</group>
<group colspan="1" col="2">
<separator string="Codes" colspan="2"/>
<field name="default_code"/>
<field groups="base.group_extended" name="ean13"/>
</group>
</group>
<notebook colspan="4">
<page string="Information">
<group colspan="2" col="2" name="Type">
<separator string="Product Type" colspan="2"/>
<field name="categ_id"/>
<field name="property_account_income" string="Account" required="1"/>
<field name="type"/>
</group>
<group colspan="2" col="2" name="Miscelleanous">
<separator string="Miscelleanous" colspan="2"/>
<field name="income_pdt"/>
<field name="expense_pdt"/>
<field name="company_id" groups="base.group_extended,base.group_multi_company"/>
</group>
<group colspan="2" col="2" name="Prices">
<separator string="Prices" colspan="2"/>
<field name="lst_price"/>
<field name="standard_price"/>
</group>
</page>
</notebook>
</form>
</field>
</record>
<menuitem name="Configuration" parent="menu_point_root"
id="menu_point_config_product" sequence="25" groups="group_pos_manager"/>
@@ -673,18 +643,6 @@
<field name="domain">[('expense_pdt','=',True)]</field>
<field name="context">{'default_expense_pdt': True}</field>
</record>
<record model="ir.actions.act_window.view" id="action_product_input_tree_tag">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="product.product_product_tree_view"/>
<field name="act_window_id" ref="action_product_input"/>
</record>
<record model="ir.actions.act_window.view" id="action_product_input_form_tag">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="product_input_output_form_view"/>
<field name="act_window_id" ref="action_product_input"/>
</record>
<menuitem
parent="menu_point_config_product"
action="action_product_input"
@@ -700,18 +658,6 @@
<field name="domain">[('income_pdt','=',True)]</field>
<field name="context">{'default_income_pdt': True}</field>
</record>
<record model="ir.actions.act_window.view" id="action_product_output_tree_tag">
<field name="sequence" eval="1"/>
<field name="view_mode">tree</field>
<field name="view_id" ref="product.product_product_tree_view"/>
<field name="act_window_id" ref="action_product_output"/>
</record>
<record model="ir.actions.act_window.view" id="action_product_output_form_tag">
<field name="sequence" eval="2"/>
<field name="view_mode">form</field>
<field name="view_id" ref="product_input_output_form_view"/>
<field name="act_window_id" ref="action_product_output"/>
</record>
<menuitem
parent="menu_point_config_product"
action="action_product_output"
@@ -733,7 +679,7 @@
<field name="res_model">account.journal</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="context">{'default_journal_user': 1}</field>
<field name="context" eval="{'default_journal_user': 1, 'default_view_id': ref('account.account_journal_bank_view'), 'default_type': 'cash'}"/>
<field name="domain">[('journal_user','=', 1)]</field>
<field name="help">Payment methods are defined by accounting journals having the field Payment Method checked.</field>
</record>
@@ -65,8 +65,9 @@
"access_account_sequence_fiscalyear_manager","account.sequence.fiscalyear manager","account.model_account_sequence_fiscalyear","group_pos_manager",1,0,0,0
"access_stock_warehouse_manager","stock.warehouse manager","stock.model_stock_warehouse","group_pos_manager",1,0,0,0
"access_stock_location_manager","stock.location manager","stock.model_stock_location","group_pos_manager",1,0,0,0
"access_product_uom_manager","product.uom manager","product.model_product_uom","group_pos_manager",1,0,0,0
"access_product_uom_manager","product.uom manager","product.model_product_uom","group_pos_manager",1,1,1,1
"access_res_partner_manager","res.partner manager","base.model_res_partner","group_pos_manager",1,0,0,0
"access_product_category_manager","product.category manager","product.model_product_category","group_pos_manager",1,0,0,0
"access_product_category_manager","product.category manager","product.model_product_category","group_pos_manager",1,1,1,1
"access_product_pricelist_manager","product.pricelist manager","product.model_product_pricelist","group_pos_manager",1,0,0,0
"access_product_category_pos_manager","pos.category manager","model_pos_category","group_pos_manager",1,0,0,0"
"access_product_category_pos_manager","pos.category manager","model_pos_category","group_pos_manager",1,1,1,1"
"access_product_category_pos_user","pos.category user","model_pos_category","group_pos_user",1,0,0,0"
Can't render this file because it contains an unexpected character in line 72 and column 110.