[IMP] improved UI for PoS - mainly forms version=7.0

bzr revid: fp@openerp.com-20120811133406-jvso3qhmozmgnj3j
This commit is contained in:
Fabien Pinckaers 2012-08-11 15:34:06 +02:00
parent c5c7ed79e3
commit c17b2443e7
14 changed files with 136 additions and 110 deletions

View File

@ -6,17 +6,17 @@
<field name="model">cash.box.in</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Put Money In">
<form string="Put Money In" version="7.0">
<separator string="Fill in this form if you put money in the cash register:" colspan="4" />
<field name="name" />
<field name="amount" />
<separator colspan="4" />
<group colspan="4" col="4">
<group col="2" colspan="2" />
<button icon="gtk-stop" special="cancel" string="Cancel" />
<button name="run" string="Put Money In" colspan="1" type="object" icon="gtk-apply" />
<group>
<field name="name" class="oe_inline"/>
<field name="amount" class="oe_inline"/>
</group>
<footer>
<button name="run" string="Put Money In" type="object" class="oe_highlight"/>
or
<button special="cancel" string="Cancel" class="oe_link"/>
</footer>
</form>
</field>
</record>
@ -35,17 +35,18 @@
<field name="model">cash.box.out</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Take Money Out">
<separator string="Describe why you take money from the cash register:" colspan="4" />
<field name="name" />
<field name="amount" />
<separator colspan="4" />
<group colspan="4" col="4">
<group col="2" colspan="2" />
<button icon="gtk-stop" special="cancel" string="Cancel" />
<button name="run" string="Take Money Out" colspan="1" type="object" icon="gtk-apply" />
<form string="Take Money Out" version="7.0">
<separator string="Describe why you take money from the cash register:"/>
<group>
<field name="name" class="oe_inline"/>
<field name="amount" class="oe_inline"/>
</group>
<footer>
<button name="run" string="Take Money Out" type="object" class="oe_highlight"/>
or
<button class="oe_link" special="cancel" string="Cancel" />
</footer>
</form>
</field>
</record>

View File

@ -156,6 +156,15 @@ class pos_session(osv.osv):
('closed', 'Closed & Posted'),
]
def _compute_cash_journal_id(self, cr, uid, ids, fieldnames, args, context=None):
result = dict.fromkeys(ids, False)
for record in self.browse(cr, uid, ids, context=context):
for st in record.statement_ids:
if st.journal_id.type == 'cash':
result[record.id] = st.journal_id.id
break
return result
def _compute_cash_register_id(self, cr, uid, ids, fieldnames, args, context=None):
result = dict.fromkeys(ids, False)
for record in self.browse(cr, uid, ids, context=context):
@ -211,6 +220,9 @@ class pos_session(osv.osv):
required=True, readonly=True,
select=1),
'cash_journal_id' : fields.function(_compute_cash_journal_id, method=True,
type='many2one', relation='account.journal',
string='Cash Journal', store=True),
'cash_register_id' : fields.function(_compute_cash_register_id, method=True,
type='many2one', relation='account.bank.statement',
string='Cash Register', store=True),

View File

@ -18,16 +18,14 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Point of Sale Orders" version="7.0">
<div class="oe_form_topbar">
<button name="%(action_pos_payment)d" string="Payment" icon="gtk-apply" type="action" states="draft" context="{'pos_session_id' : session_id}"/>
<button name="action_invoice" string="Invoice" icon="gtk-apply" type="object" states="paid" attrs="{'readonly': [('partner_id','=',False)]}"/>
<button name="refund" string="Return Products" type="object" icon="gtk-ok"
<header>
<button name="%(action_pos_payment)d" string="Payment" class="oe_highlight" type="action" states="draft" context="{'pos_session_id' : session_id}"/>
<button name="action_invoice" string="Invoice" type="object" states="paid" attrs="{'readonly': [('partner_id','=',False)]}"/>
<button name="refund" string="Return Products" type="object"
attrs="{'invisible':[('state','=','draft')]}"/>
<button name="%(action_report_pos_receipt)d" string="Reprint" icon="gtk-print" type="action" states="paid,done,invoiced"/>
<div class="oe_right">
<field name="state" nolabel="1" widget="statusbar" statusbar_visible="draft,paid,done" statusbar_colors='{"cancel":"red"}'/>
</div>
</div>
<button name="%(action_report_pos_receipt)d" string="Reprint" type="action" states="paid,done,invoiced"/>
<field name="state" widget="statusbar" statusbar_visible="draft,paid,done" statusbar_colors='{"cancel":"red"}'/>
</header>
<sheet>
<group col="4" colspan="4">
<field name="name"/>
@ -61,7 +59,7 @@
<group class="oe_subtotal_footer">
<field name="amount_tax"/>
<field name="amount_total"/>
<button name="button_dummy" string="Update" icon="gtk-execute" states="draft"/>
<button name="button_dummy" string="Update" class="oe_link" states="draft"/>
</group>
</page>
<page string="Payments">
@ -927,12 +925,12 @@
Point of Sale Session:
<field name="name" attrs="{'invisible': [('name','=','/')]}" class="oe_inline"/>
</h1>
<field name="config_id" invisible="1"/>
<field name="has_opening_control" invisible="1" />
<field name="has_closing_control" invisible="1" />
<group>
<group>
<field name="user_id"/>
<field name="config_id" attrs="{'invisible' : [('config_id', '&lt;&gt;', False)]}"/>
</group>
<group>
<field name="start_at" attrs="{'invisible' : [('state', '=', 'opening_control')]}"/>
@ -965,10 +963,11 @@
<field name="cash_register_total_entry_encoding" attrs="{'invisible' : [('state', '=', 'opening_control')]}" string="+ Transactions"/>
<field name="cash_register_balance_end" attrs="{'invisible' : [('state', '=', 'opening_control')]}" string="= Theorical Balance"/>
</group>
<div attrs="{'invisible' : [('state', '&lt;&gt;', 'opening_control')]}" class="oe_view_nocontent" groups="point_of_sale.group_pos_manager">
<div class="oe_clear"/>
<div attrs="{'invisible' : [('cash_journal_id', '=', False)]}" class="oe_view_nocontent" groups="point_of_sale.group_pos_manager">
<p class="oe_view_nocontent_create">
You can define another list of available currencies on the
<i>Cash Registers</i> tab of the <b><field name="cash_register_id" class="oe_inline"/></b>
<i>Cash Registers</i> tab of the <b><field name="cash_journal_id" class="oe_inline"/></b>
payment method.
</p>
</div>
@ -1044,6 +1043,19 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
<field name="search_view_id" ref="view_pos_session_search" />
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to start a new session.
</p><p>
A session is a period of time, usually one day, during which
you sell through the point of sale. The user has to check the
currencies in your cash registers at the beginning and the end
of each session.
</p><p>
Note that you should better to use the menu <i>Your Session</i>
to quickly open a new session.
</p>
</field>
</record>
<menuitem

View File

@ -8,22 +8,24 @@
<field name="model">pos.box.entries</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Put Money">
<separator string="Fill in this form if you put money in the cash register:" colspan="4"/>
<field name="journal_id"/>
<field name="product_id"/>
<field name="amount"/>
<field name="session_id"/>
<field name="name"/>
<field name="user_id" invisible="1"/>
<separator colspan="4"/>
<group colspan="4" col="4">
<group col="2" colspan="2"/>
<button icon="gtk-stop" special="cancel"
string="Cancel"/>
<button name="get_in" string="Put Money"
colspan="1" type="object" icon="gtk-apply"/>
<form string="Put Money" version="7.0">
<separator string="Fill in this form if you put money in the cash register:"/>
<group col="4">
<field name="journal_id"/>
<field name="product_id"/>
<field name="amount"/>
<field name="session_id"/>
<field name="name"/>
<field name="user_id" invisible="1"/>
</group>
<footer>
<button name="get_in" string="Put Money" class="oe_highlight"
type="object"/>
or
<button class="oe_link" special="cancel"
string="Cancel"/>
</footer>
</form>
</field>
</record>

View File

@ -8,22 +8,23 @@
<field name="model">pos.box.out</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Output Operation">
<separator string="Describe why you take money from the cash register:" colspan="4"/>
<field name="journal_id"/>
<field name="product_id"/>
<field name="amount"/>
<field name="session_id" />
<field name="name"/>
<field name="user_id" invisible="1" />
<separator colspan="4"/>
<group colspan="4" col="4">
<group col="2" colspan="2"/>
<button icon="gtk-stop" special="cancel"
string="Cancel" />
<button name="get_out" string="Take Money"
colspan="1" type="object" icon="gtk-apply" />
<form string="Output Operation" version="7.0">
<separator string="Describe why you take money from the cash register:"/>
<group colspan="4">
<field name="journal_id"/>
<field name="product_id"/>
<field name="amount"/>
<field name="session_id" />
<field name="name"/>
<field name="user_id" invisible="1" />
</group>
<footer>
<button name="get_out" string="Take Money"
type="object" class="oe_highlight"/> or
<button icon="gtk-stop" special="cancel"
string="Cancel" class="oe_link"/>
</footer>
</form>
</field>
</record>

View File

@ -8,13 +8,13 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Post All Orders" version="7.0">
<header>
<separator string="Generate Journal Entries"/>
<label string="Generate all sale journal entries for non invoiced orders linked to a closed cash register or statement."/>
<footer>
<button name="action_confirm" string="Generate Entries" type="object" class="oe_highlight" />
or
<button string="Cancel" class="oe_link" special="cancel" />
</header>
<separator string="Generate Journal Entries"/>
<label string="Generate all sale journal entries for non invoiced orders linked to a closed cash register or statement."/>
</footer>
</form>
</field>
</record>

View File

@ -9,16 +9,16 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="POS Details" version="7.0">
<header>
<button name="print_report" type="object" string="Print Report" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/>
</header>
<group col="4" string="Dates">
<field name="date_start"/>
<field name="date_end"/>
</group>
<field name="user_ids"/>
<footer>
<button name="print_report" type="object" string="Print Report" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/>
</footer>
</form>
</field>
</record>

View File

@ -9,14 +9,14 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Apply Discount" version="7.0">
<header>
<button name="apply_discount" string="Apply Discount" type="object" class="oe_highlight" />
or
<button string="Cancel" class="oe_link" special="cancel" />
</header>
<group>
<field name="discount"/>
</group>
<footer>
<button name="apply_discount" string="Apply Discount" type="object" class="oe_highlight" />
or
<button string="Cancel" class="oe_link" special="cancel" />
</footer>
</form>
</field>
</record>

View File

@ -9,13 +9,13 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Open Statements" version="7.0">
<header>
<separator string="Do you want to open cash registers?"/>
<label string="The system will open all cash registers, so that you can start recording payments. We suggest you to control the opening balance of each register, using their CashBox tab."/>
<footer>
<button name="open_statement" type="object" string="Open Registers" class="oe_highlight"/>
or
<button string="Cancel" class="oe_link" special="cancel"/>
</header>
<separator string="Do you want to open cash registers?"/>
<label string="The system will open all cash registers, so that you can start recording payments. We suggest you to control the opening balance of each register, using their CashBox tab."/>
</footer>
</form>
</field>
</record>

View File

@ -3,25 +3,21 @@
<data>
<record id="view_pos_payment" model="ir.ui.view">
<field name="name">Add payment :</field>
<field name="name">Pay Order</field>
<field name="model">pos.make.payment</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Add payment :">
<group colspan="4" col="4" >
<group colspan="4">
<field name="journal_id" />
<field name="amount" />
<field name="payment_name"/>
</group>
<newline/>
<separator colspan="4"/>
<group colspan="2"/>
<group colspan="2">
<button icon="gtk-stop" special="cancel" string="Cancel"/>
<button name="check" string="Make Payment" colspan="1" type="object" icon="gtk-apply"/>
</group>
<form string="Pay Order" version="7.0">
<group>
<field name="journal_id" />
<field name="amount" />
<field name="payment_name"/>
</group>
<footer>
<button name="check" string="Make Payment" type="object" class="oe_highlight"/>
or
<button icon="gtk-stop" special="cancel" string="Cancel" class="oe_link"/>
</footer>
</form>
</field>
</record>

View File

@ -4,7 +4,7 @@
<!-- pos.details -->
<record id="view_pos_payment_report" model="ir.ui.view">
<field name="name">Pyament Report</field>
<field name="name">Payment Report</field>
<field name="model">pos.payment.report</field>
<field name="type">form</field>
<field name="arch" type="xml">

View File

@ -9,16 +9,16 @@
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Sale By User" version="7.0">
<header>
<button name="print_report" type="object" string="Print Report" class="oe_highlight"/>
or
<button string="Cancel" special="cancel" class="oe_link"/>
</header>
<group col="4">
<field name="date_start"/>
<field name="date_end"/>
<field name="user_id"/>
</group>
<footer>
<button name="print_report" type="object" string="Print Report" class="oe_highlight"/>
or
<button string="Cancel" special="cancel" class="oe_link"/>
</footer>
</form>
</field>
</record>

View File

@ -49,7 +49,7 @@
<field name="virtual_available"/>
<field name="lst_price"/>
<field name="price" invisible="not context.get('pricelist',False)"/>
<field name="standard_price"/>
<field name="standard_price" invisible="1"/>
<field name="state"/>
<field name="company_id" groups="base.group_multi_company" invisible="1"/>
</tree>

View File

@ -64,7 +64,7 @@
<label string="Cost Price" for="standard_price" align="1.0" groups="base.group_user"/>
<div groups="base.group_user">
<field name="standard_price" attrs="{'readonly':[('cost_method','=','average')]}" nolabel="1"/> -
<button name="%(action_view_change_standard_price)d" string="Update"
<button name="%(action_view_change_standard_price)d" string="update"
type="action" attrs="{'invisible':[('cost_method','&lt;&gt;','average')]}"
class="oe_link"/>
</div>
@ -104,17 +104,19 @@
<field name="inherit_id" ref="product.product_normal_form_view"/>
<field name="arch" type="xml">
<group name="status" position="before" version="7.0">
<group string="Stock and Expected Variations">
<field name="qty_available"/>
<field name="incoming_qty" groups="base.group_user"/>
<group string="Stock and Expected Variations" attrs="{'invisible': [('type', '=', 'service')]}">
<label for="qty_available"/>
<div>
<field name="qty_available" class="oe_inline"/>
<button name="%(action_view_change_product_quantity)d" string="update"
type="action" groups="stock.group_stock_manager,stock.group_stock_user"
class="oe_link"/>
</div>
<label for="virtual_available" groups="base.group_user"/>
<div groups="base.group_user">
<field name="virtual_available" class="oe_inline"/>
<button name="%(action_view_change_product_quantity)d" string="Update" attrs="{'invisible': [('type', '=', 'service')]}"
type="action" icon="gtk-execute" groups="stock.group_stock_manager,stock.group_stock_user" class="oe_inline"/>
(+<field name="incoming_qty" class="oe_inline"/> -<field name="outgoing_qty" class="oe_inline"/>)
</div>
<field name="outgoing_qty" groups="base.group_user"/>
</group>
<group name="lot" groups="stock.group_tracking_lot,stock.group_production_lot" string="Lots">
<field name="track_production" groups="stock.group_production_lot"/>