Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
4 Trả lời
3097 Lượt xem

Hello everyone !

I would like to access the price of a product that will be paid by the customer so I though that using point of sale would be a good start because it displays this price.

I just don't know how to access this price because of the option that doesn't include taxes in product's sale price.
What I need is the value paid by the customer if he only bought the product.

Thank you for your time !

Ảnh đại diện
Huỷ bỏ

Where do you want to display prices including tax? I do not understand what you want to achieve.

Tác giả

I would like to build a XML body in my model that is linked to product.template class to send to a side server. In this XML i need to put the product's price including tax.

Tác giả

anything ?

Tác giả Câu trả lời hay nhất

Here's some code to show what i want to do : 

 

class myClass(models.Model):
      _name='mymodule.myclass'
      
      task_body=fields.Text(compute="_buildXML", store=True)
      
      products=fields.Many2many(comodel_name='product.template')
      
      @api.one
      @api.depends('products','products.name','products.list_price')
      def _buildXML(self):
            xmlBody=""
            xmlBody+="..."
            .
            .
            .
            for product in products:
                  xmlBody+="<field key='price' value='"+product.list_price+"'/>"
                  xmlBody+="<field key='name' value='"+product.name+"'/>"
            .
            .
            .
            self.task_body=xmlBody

So here it is. I list_price display the price you can enter on the product informations but it does not include the tax if tax is set not to be inside the price. I would like to display this list of prices to the very final customer so that he can have the price.

So with product.list_price, the problem is that the price may be incorrect if taxes are not included inside of it. I would like to show the all taxes included everytime.


Thank you for your time ! :)

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
0
thg 5 17
2926
0
thg 6 23
1667
0
thg 4 22
1203
6
thg 1 16
12593
2
thg 7 18
3967