[IMP] purchase invoice control wizard improvemens
bzr revid: fp@tinyerp.com-20111002154802-pnl31a0ulf688jcp
This commit is contained in:
@@ -188,7 +188,7 @@ class purchase_order(osv.osv):
|
||||
'shipped_rate': fields.function(_shipped_rate, string='Received', type='float'),
|
||||
'invoiced': fields.function(_invoiced, string='Invoiced & Paid', type='boolean', help="It indicates that an invoice has been paid"),
|
||||
'invoiced_rate': fields.function(_invoiced_rate, string='Invoiced', type='float'),
|
||||
'invoice_method': fields.selection([('manual','Based on purchase order'),('order','Draft invoices pre-generated'),('picking','Based on receptions')], 'Invoicing Control', required=True,
|
||||
'invoice_method': fields.selection([('manual','Based on purchase order lines'),('order','Draft invoices pre-generated'),('picking','Based on receptions')], 'Invoicing Control', required=True,
|
||||
help="Based on orders: a draft invoice will be generated based on the purchase order. The accountant " \
|
||||
"will just have to validate this invoice for control.\n" \
|
||||
"Based on receptions: a draft invoice will be generated based on validated receptions.\n" \
|
||||
|
||||
@@ -497,14 +497,14 @@
|
||||
|
||||
|
||||
<record id="purchase_line_form_action2" model="ir.actions.act_window">
|
||||
<field name="name">On Purchase Order Line</field>
|
||||
<field name="name">On Purchase Order Lines</field>
|
||||
<field name="type">ir.actions.act_window</field>
|
||||
<field name="res_model">purchase.order.line</field>
|
||||
<field name="domain">[('order_id.invoice_method','<>','picking'), ('state','in',('confirmed','done')), ('invoiced', '=', False)]</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">tree,form</field>
|
||||
<field name="search_view_id" ref="purchase_order_line_search"/>
|
||||
<field name="help">If you set the invoicing control on a purchase order as "Manual", you can track here all the purchase order lines for which you have not received the supplier invoice yet. Once you are ready to receive a supplier invoice, you can generate a draft supplier invoice based on the lines from this menu.</field>
|
||||
<field name="help">If you set the invoicing control on a purchase order as "Based on Purchase Order Lines", you can track here all the purchase order lines for which you have not received the supplier invoice yet. Once you are ready to receive a supplier invoice, you can generate a draft supplier invoice based on the lines from this menu.</field>
|
||||
</record>
|
||||
<record id="purchase_line_form_action_tree2" model="ir.actions.act_window.view">
|
||||
<field eval="1" name="sequence"/>
|
||||
|
||||
@@ -31,24 +31,24 @@ purchase_installer()
|
||||
|
||||
class purchase_config_wizard(osv.osv_memory):
|
||||
_name = 'purchase.config.wizard'
|
||||
_inherit = 'res.config'
|
||||
|
||||
_columns = {
|
||||
'default_method' : fields.selection(
|
||||
[('manual', 'Based on Purchase Orders'),
|
||||
[('manual', 'Based on Purchase Order Lines'),
|
||||
('picking', 'Based on Receptions'),
|
||||
('order', 'Pre-Generate Draft Invoices on Purchase Orders'),
|
||||
],
|
||||
'Default Invoicing Control Method',
|
||||
required=True,
|
||||
),
|
||||
('order', 'Pre-Generate Draft Invoices on Based Purchase Orders'),
|
||||
], 'Default Invoicing Control Method', required=True,
|
||||
)
|
||||
}
|
||||
_defaults = {
|
||||
'default_method': lambda s,c,u,ctx: s.pool.get('purchase.order').default_get(c,u,['invoice_method'],context=ctx)['invoice_method']
|
||||
}
|
||||
|
||||
def validate_cb(self, cr, uid, ids, context=None):
|
||||
def execute(self, cr, uid, ids, context=None):
|
||||
wizard = self.browse(cr, uid, ids, context=context)[0]
|
||||
|
||||
proxy = self.pool.get('ir.values')
|
||||
proxy.set(cr, uid, 'default', False, 'invoice_method', ['purchase.order'], wizard.default_method),
|
||||
|
||||
return {'type' : 'ir.actions.act_window_close'}
|
||||
|
||||
purchase_config_wizard()
|
||||
|
||||
@@ -40,32 +40,49 @@
|
||||
</record>
|
||||
|
||||
<record id="view_purchase_config" model="ir.ui.view">
|
||||
<field name="name">purchase.view_purchase_config</field>
|
||||
<field name="type">form</field>
|
||||
<field name="name">Invoicing Control on Purchases</field>
|
||||
<field name="model">purchase.config.wizard</field>
|
||||
<field name="type">form</field>
|
||||
<field name="inherit_id" ref="base.res_config_view_base"/>
|
||||
<field name="arch" type="xml">
|
||||
<form string="Purchase Config">
|
||||
<label string="Set Your Default Invoicing Control Method" />
|
||||
<field name="default_method" nolabel="1"/>
|
||||
|
||||
<group colspan="4">
|
||||
<button special="cancel" icon="gtk-cancel" string="Cancel" />
|
||||
<button name="validate_cb" string="Validate" icon="gtk-apply" type="object" />
|
||||
</group>
|
||||
<data>
|
||||
<form position="attributes">
|
||||
<attribute name="string">Invoicing Control on Purchases</attribute>
|
||||
</form>
|
||||
|
||||
<xpath expr="//separator[@string="title"]" position="attributes">
|
||||
<attribute name="string">Invoicing Control on Purchases</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//label[@string='description']" position="attributes">
|
||||
<attribute name="string">This tool will help you to select the method you want to use to control supplier invoices.</attribute>
|
||||
</xpath>
|
||||
<xpath expr="//separator[@string="vsep"]" position="attributes">
|
||||
<attribute name="string"/>
|
||||
<attribute name="rowspan">12</attribute>
|
||||
</xpath>
|
||||
<group string="res_config_contents" position="replace">
|
||||
<group colspan="4" col="4">
|
||||
<field name="default_method"/>
|
||||
</group>
|
||||
</group>
|
||||
</data>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
|
||||
<record id="action_purchase_config" model="ir.actions.act_window">
|
||||
<field name="name">Set the Default Invoicing Control Method</field>
|
||||
<field name="res_model">purchase.config.wizard</field>
|
||||
<field name="view_type">form</field>
|
||||
<field name="view_mode">form</field>
|
||||
<field name="target">new</field>
|
||||
<field name="view_id" ref="view_purchase_config"/>
|
||||
</record>
|
||||
|
||||
<record id="todo_purchase_config" model="ir.actions.todo">
|
||||
<field name="action_id" ref="action_purchase_config" />
|
||||
<field name="category_id" ref="category_purchase_config" />
|
||||
<field name="type">once</field>
|
||||
</record>
|
||||
</data>
|
||||
</openerp>
|
||||
|
||||
Reference in New Issue
Block a user