gregoire
9 years ago
7 changed files with 188 additions and 43 deletions
-
1beesdoo_product/__init__.py
-
1beesdoo_product/__openerp__.py
-
36beesdoo_product/models/beesdoo_product.py
-
39beesdoo_product/views/beesdoo_product.xml
-
1beesdoo_product/wizard/__init__.py
-
22beesdoo_product/wizard/label_printing_utils.py
-
55beesdoo_product/wizard/views/label_printing_utils.xml
@ -1,2 +1,3 @@ |
|||||
# -*- coding: utf-8 -*- |
# -*- coding: utf-8 -*- |
||||
import models |
import models |
||||
|
import wizard |
@ -0,0 +1 @@ |
|||||
|
import label_printing_utils |
@ -0,0 +1,22 @@ |
|||||
|
# -*- coding: utf-8 -*- |
||||
|
from openerp import models, fields, api |
||||
|
|
||||
|
class RequestLabelPrintingWizard(models.TransientModel): |
||||
|
|
||||
|
_name = 'label.printing.wizard' |
||||
|
|
||||
|
def _get_selected_products(self): |
||||
|
return self.env.context['active_ids'] |
||||
|
|
||||
|
product_ids = fields.Many2many('product.template', default=_get_selected_products) |
||||
|
|
||||
|
|
||||
|
@api.one |
||||
|
def request_printing(self): |
||||
|
for product in self.product_ids: |
||||
|
product._request_label_printing() |
||||
|
|
||||
|
@api.one |
||||
|
def set_as_printed(self): |
||||
|
for product in self.product_ids: |
||||
|
product._set_label_as_printed() |
@ -0,0 +1,55 @@ |
|||||
|
<?xml version="1.0" encoding="utf-8"?> |
||||
|
<odoo> |
||||
|
<record id="printing_label_request_wizard" model="ir.ui.view"> |
||||
|
<field name="name">Request Label Printing Wizard</field> |
||||
|
<field name="model">label.printing.wizard</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form> |
||||
|
<field name="product_ids" /> |
||||
|
<footer> |
||||
|
<button |
||||
|
type="object" |
||||
|
name="request_printing" |
||||
|
string="Demander l'impression d'un label" |
||||
|
class="oe_highlight" /> |
||||
|
<button special="cancel" string="Annuler" /> |
||||
|
</footer> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
<act_window name="Request label printing" |
||||
|
res_model="label.printing.wizard" |
||||
|
src_model="product.template" |
||||
|
view_mode="form" |
||||
|
target="new" |
||||
|
view_id="printing_label_request_wizard" |
||||
|
key2="client_action_multi" |
||||
|
id="beesdoo_product_action_request_label_printing" |
||||
|
/> |
||||
|
<record id="set_label_as_printed_wizard" model="ir.ui.view"> |
||||
|
<field name="name">Request Label Printing Wizard</field> |
||||
|
<field name="model">label.printing.wizard</field> |
||||
|
<field name="arch" type="xml"> |
||||
|
<form> |
||||
|
<field name="product_ids" /> |
||||
|
<footer> |
||||
|
<button |
||||
|
type="object" |
||||
|
name="set_as_printed" |
||||
|
string="Marquer les labels comme imprimés" |
||||
|
class="oe_highlight" /> |
||||
|
<button special="cancel" string="Annuler" /> |
||||
|
</footer> |
||||
|
</form> |
||||
|
</field> |
||||
|
</record> |
||||
|
<act_window name="Set label as printed" |
||||
|
res_model="label.printing.wizard" |
||||
|
src_model="product.template" |
||||
|
view_mode="form" |
||||
|
view_id="set_label_as_printed_wizard" |
||||
|
target="new" |
||||
|
key2="client_action_multi" |
||||
|
id="beesdoo_product_action_set_label_as_printed" |
||||
|
/> |
||||
|
</odoo> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue