From 9e228b95cebe981e5022e25ddc25cc82a98239e7 Mon Sep 17 00:00:00 2001 From: sonal arora Date: Fri, 25 Sep 2020 14:53:51 +0530 Subject: [PATCH] work on laundary mgt --- laundary_mgt/data/ir_sequence_data.xml | 2 +- .../models/__pycache__/sale.cpython-36.pyc | Bin 2295 -> 2789 bytes laundary_mgt/models/sale.py | 20 +++- laundary_mgt/security/ir.model.access.csv | 2 + laundary_mgt/views/sale_views.xml | 87 ++++++++++++++++++ 5 files changed, 107 insertions(+), 4 deletions(-) diff --git a/laundary_mgt/data/ir_sequence_data.xml b/laundary_mgt/data/ir_sequence_data.xml index 451160e..18b7a66 100644 --- a/laundary_mgt/data/ir_sequence_data.xml +++ b/laundary_mgt/data/ir_sequence_data.xml @@ -6,7 +6,7 @@ Sales Order Line sale.order.line - Trac + 3 diff --git a/laundary_mgt/models/__pycache__/sale.cpython-36.pyc b/laundary_mgt/models/__pycache__/sale.cpython-36.pyc index a461ce34ef6df75ddccab3708dc2f2ce5c46abed..fbcb6f0dc76b3ce1b257d319cf513ab30f39293c 100644 GIT binary patch delta 842 zcmb_Z&ubGw6rQ)4o&C|>%_eOs4T-5l5+gB6>knvcDa2avP$*R>3lc+SwZ^6?lOP(R zA{B2v$ov)JNfi7GJhXp84kCzn(t{VTzS)LoJ$dND`}VzWX5M_?n_r2qsr;<#+Rpn{ z?Ttam7xLFfF<-*y{CJh$Kf6M>&l4{QPlQ%8y&DToB9r9f$czt}9G_SxrPSM>4`B+M z5r$D!4ela5y3;4u$n6dJT+3OP`_QCVmE~(K<2_-0(lq<*1nKKF>)pPV2e9S$*o{fL zU2la0w=3$62luz{)f#OcmJGQ(tz!W< zU&8pKgKA=7C`65OC}cEQ6r%ED7qW;Vl&_Hx8-*xxwKOfi83(?4lW1&0X%>s}gIR#I O{A5lV@uZhzN%k8T39A+W delta 465 zcmY+AJxc>Y5QcBgz0KWuce#s3{ET8G5RD%(2oVtk#lj*Wg2;3R`$@jLn;Zi-<5U z_0XyqHB(rmY|(ky5!$3Xg+tns1DQybZ<&_lpG zJ{*h6jM9?|Qwr1g#xq@PxmuE;T|THESBpob!-`B{BC;@)rIHbfhDR`g0n7wb)-%soo0d1U^|WTs4(>ys=aL WYHpvlG_UnWM+NnEL~OK3U%Y diff --git a/laundary_mgt/models/sale.py b/laundary_mgt/models/sale.py index 304d3c8..35125c2 100644 --- a/laundary_mgt/models/sale.py +++ b/laundary_mgt/models/sale.py @@ -26,7 +26,8 @@ class SaleOrder(models.Model): company_id = default=lambda self: self.env.company seq_date = fields.Datetime.now() for line in order.order_line: - line.tracking_code = self.env['ir.sequence'].next_by_code('sale.order.line', sequence_date=seq_date) or _('New') + tracking_code = self.env['ir.sequence'].next_by_code('sale.order.line', sequence_date=seq_date) or _('New') + line.tracking_code = self.name + tracking_code class SaleOrderLine(models.Model): @@ -34,8 +35,9 @@ class SaleOrderLine(models.Model): _description = 'Sales Order Line' wash_type = fields.Many2one('wash.type', string='Wash Type') - cloth_name = fields.Char(string='Cloth Name',copy=False) - tracking_code = fields.Char(string='Tracking Code',copy=False,readonly="1") + color = fields.Many2one('color.type', string='Color') + cloth_name = fields.Many2one('cloth.type',string='Cloth Name',copy=False) + tracking_code = fields.Char(string='Tracking Code',) remark = fields.Text('Remark',copy=False) upload_image = fields.Image("Upload Image") @@ -46,4 +48,16 @@ class WashType(models.Model): _name = 'wash.type' _description = 'Wash Type' + name = fields.Char(string='Name') + +class ColorType(models.Model): + _name = 'color.type' + _description = 'Color Type' + + name = fields.Char(string='Name') + +class ClothType(models.Model): + _name = 'cloth.type' + _description = 'Cloth Type' + name = fields.Char(string='Name') \ No newline at end of file diff --git a/laundary_mgt/security/ir.model.access.csv b/laundary_mgt/security/ir.model.access.csv index 643a646..57480db 100644 --- a/laundary_mgt/security/ir.model.access.csv +++ b/laundary_mgt/security/ir.model.access.csv @@ -1,2 +1,4 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_wash_type,wash.type,model_wash_type,sales_team.group_sale_salesman,1,1,1,1 +access_color_type,color.type,model_color_type,sales_team.group_sale_salesman,1,1,1,1 +access_cloth_type,cloth.type,model_cloth_type,sales_team.group_sale_salesman,1,1,1,1 diff --git a/laundary_mgt/views/sale_views.xml b/laundary_mgt/views/sale_views.xml index 239402a..ef74960 100644 --- a/laundary_mgt/views/sale_views.xml +++ b/laundary_mgt/views/sale_views.xml @@ -12,11 +12,98 @@ + + + + + + cloth.type.tree + cloth.type + + + + + + + + + Cloth Type + cloth.type + tree,kanban,form + [] + +

Cloth type +

+
+
+ + + + + wash.type.tree + wash.type + + + + + + + + + Wash Type + wash.type + tree,kanban,form + [] + +

Wash type +

+
+
+ + + + + + color.type.tree + color.type + + + + + + + + + Color Type + color.type + tree,form + [] + +

Create new Color +

+
+
+ + + +